/* 3Qadam: кабинеты. Сначала телефон, с 900px — две колонки и верхнее меню. */
/* Шрифты лежат у нас (web/static/fonts), внешних запросов нет. Лицензия обоих — SIL OFL 1.1 (файлы OFL-*.txt). */
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/fonts/manrope-cyrillic-ext-400.woff2') format('woff2'); unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/fonts/manrope-cyrillic-400.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400; font-display: swap;
  src: url('/static/fonts/manrope-latin-400.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; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/manrope-cyrillic-ext-500.woff2') format('woff2'); unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/manrope-cyrillic-500.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/manrope-latin-500.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; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/static/fonts/manrope-cyrillic-ext-600.woff2') format('woff2'); unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/static/fonts/manrope-cyrillic-600.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 600; font-display: swap;
  src: url('/static/fonts/manrope-latin-600.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; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/fonts/manrope-cyrillic-ext-700.woff2') format('woff2'); unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/fonts/manrope-cyrillic-700.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/fonts/manrope-latin-700.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; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/unbounded-cyrillic-ext-500.woff2') format('woff2'); unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/unbounded-cyrillic-500.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 500; font-display: swap;
  src: url('/static/fonts/unbounded-latin-500.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; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/fonts/unbounded-cyrillic-ext-700.woff2') format('woff2'); unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/fonts/unbounded-cyrillic-700.woff2') format('woff2'); unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-weight: 700; font-display: swap;
  src: url('/static/fonts/unbounded-latin-700.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 {
  --ground: #F3F4F6; --card: #FFFFFF; --ink: #14171C; --ink-2: #3A404A; --muted: #5B6370;
  --line: #E1E4E8; --line-strong: #9AA1AB; --accent: #FF6A2B; --accent-ink: #A83C0B; --accent-tint: #FFF0E8;
  --good: #1F7A4D; --good-ink: #17603C; --good-tint: #E3F2EA;
  --warn: #8A5A00; --warn-ink: #5C3B00; --warn-tint: #FBF0D9;
  --bad: #B3261E; --bad-ink: #8C1D17; --bad-tint: #FBE6E4;
  --display: 'Unbounded', 'Manrope', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.45 'Manrope', system-ui, sans-serif; padding-bottom: 72px; }
a { color: var(--accent-ink); }
a:hover { color: #7A2A06; }
h1 { margin: 0; font: 500 22px/1.25 var(--display); }
h2 { margin: 0; font-size: 18px; font-weight: 700; }
h3 { margin: 0; font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
p { margin: 0; }
ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.ico { flex: none; }
.muted { color: var(--muted); } .small { font-size: 13px; } .block { display: block; } .nowrap { white-space: nowrap; }
.right { text-align: right; } .wide { width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* шапка и меню */
.top { background: var(--ink); padding: 6px 16px; display: flex; align-items: center; gap: 8px 28px; flex-wrap: wrap; }
.logo { font: 700 18px var(--display); color: #fff; text-decoration: none; padding: 10px 0; }
.logo:hover { color: #fff; } .logo span { color: var(--accent); }
.top-nav { display: none; flex: 1; gap: 8px 24px; flex-wrap: wrap; }
.top-nav a, .top-link { min-height: 44px; display: inline-flex; align-items: center; color: #C9CED5; font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; }
.top-nav a[aria-current] { color: #fff; font-weight: 700; border-bottom-color: var(--accent); }
.top-link { margin-left: auto; color: #fff; }
.avatar { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; background: #2A2F37; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.avatar:hover { color: #fff; }
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; background: var(--card); border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom, 0); }
.bottom-nav a { flex: 1; min-height: 60px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); text-decoration: none; border-top: 3px solid transparent; }
.bottom-nav a[aria-current] { color: var(--ink); font-weight: 700; border-top-color: var(--accent); }
.banner { background: var(--warn-tint); color: #4A3000; padding: 10px 16px; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }

/* каркас страницы */
.page { max-width: 1168px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.head { display: grid; gap: 4px; }
.cols { display: grid; gap: 16px; align-items: start; }
.col-main, .col-side { display: grid; gap: 16px; min-width: 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: grid; gap: 12px; min-width: 0; }
.card.narrow { max-width: 560px; }
.card.locked { border-style: dashed; border-color: var(--line-strong); color: var(--ink-2); }
.link-card { display: flex; justify-content: space-between; align-items: center; color: var(--ink); font-weight: 600; text-decoration: none; }
.split { display: flex; flex-wrap: wrap; gap: 12px 16px; justify-content: space-between; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.eyebrow, .label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.back { justify-self: start; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); text-decoration: none; }
.alert { background: var(--bad-tint); color: var(--bad-ink); border-radius: 10px; padding: 12px 14px; font-weight: 600; }
.placeholder { min-height: 140px; border: 2px dashed var(--line-strong); border-radius: 12px; padding: 16px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); }
.chart { width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); }

/* кнопки и формы */
.btn { min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-accent { background: var(--accent); color: var(--ink); } .btn-accent:hover { color: var(--ink); background: #FF7D45; }
.btn-dark { background: var(--ink); color: #fff; } .btn-dark:hover { color: #fff; }
.btn-ghost { background: var(--card); color: var(--ink); border-color: var(--line-strong); } .btn-ghost:hover { color: var(--ink); background: var(--ground); }
.btn-danger { background: var(--card); color: var(--bad-ink); border-color: var(--bad); }
.icon-btn { width: 44px; height: 44px; border-radius: 10px; background: var(--ground); color: var(--ink); display: flex; align-items: center; justify-content: center; }
.link-strong { min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; }
label { font-size: 13px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 4px; }
input[type=text], input[type=date] { width: 100%; min-height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; padding: 0 12px; font: inherit; color: var(--ink); background: var(--card); }
input[readonly] { background: var(--ground); }
.form { display: grid; gap: 8px; } .form .btn { margin-top: 8px; justify-self: start; }
.form-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; } .grow { flex: 1 1 220px; }
.scopes { display: grid; gap: 4px; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 52px; margin: 0; color: var(--ink); font-size: 15px; cursor: pointer; }
.switch-row input { appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 30px; border-radius: 15px; background: #8A919C; position: relative; cursor: pointer; margin: 0; }
.switch-row input::after { content: ''; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch-row input:checked { background: var(--good); } .switch-row input:checked::after { left: 25px; }

/* плитки дисциплин */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.tile { min-height: 64px; padding: 6px 2px; border: 1px solid #C9CED5; border-radius: 12px; background: var(--card); color: var(--ink); font-size: 12px; font-weight: 600; text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; }
.tile:hover { color: var(--ink); border-color: var(--ink); }
.tile.on { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 700; } .tile.on .ico { color: var(--accent); }
.tile.off { border-style: dashed; border-color: var(--line-strong); background: var(--ground); color: var(--muted); }

/* показатели, метки, вердикты */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.metric { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 8px; }
.card .metric { background: var(--ground); border-color: transparent; }
.metric-label { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; line-height: 1.25; color: var(--muted); }
.metric-ico { flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--accent-tint); color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; }
.metric-value { font-weight: 700; font-size: 20px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.tag-important { background: var(--bad-tint); color: var(--bad-ink); }
.tag-attention { background: var(--warn-tint); color: var(--warn-ink); }
.tag-good { background: var(--good-tint); color: var(--good-ink); }
.tag-info { background: var(--line); color: var(--ink-2); }
.verdict { border-radius: 12px; padding: 14px 16px; font: 500 20px/1.2 var(--display); }
.pill { display: inline-block; font-size: 13px; font-weight: 700; border-radius: 6px; padding: 3px 10px; }
.v-go { background: var(--good-tint); color: var(--good-ink); }
.v-caution, .v-easy { background: var(--warn-tint); color: #4A3000; }
.v-rest { background: var(--bad-tint); color: var(--bad-ink); }
.score-row { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; } .score-row strong { font-size: 20px; }
progress.bar { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 4px; background: var(--line); overflow: hidden; }
progress.bar::-webkit-progress-bar { background: var(--line); border-radius: 4px; }
progress.bar::-webkit-progress-value { background: var(--warn); border-radius: 4px; }
progress.bar::-moz-progress-bar { background: var(--warn); border-radius: 4px; }
progress.bar.v-go::-webkit-progress-value { background: var(--good); } progress.bar.v-go::-moz-progress-bar { background: var(--good); }
progress.bar.v-rest::-webkit-progress-value { background: var(--bad); } progress.bar.v-rest::-moz-progress-bar { background: var(--bad); }
.reasons { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.finding .action { background: var(--ground); border-radius: 10px; padding: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; border-radius: 8px; padding: 6px 12px; }
.chip-on { background: var(--good-tint); color: var(--good-ink); } .chip-off { background: var(--line); color: var(--ink-2); font-weight: 600; }

/* списки и таблица */
.rows { list-style: none; margin: 0; padding: 0; }
.rows .row { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.rows .row:first-child { border-top: 0; padding-top: 0; }
.rows.plain { display: grid; gap: 10px; }
.row-main { display: flex; gap: 12px; align-items: center; min-width: 0; }
.row-title { font-weight: 700; }
.disc-ico { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-tint); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; }
.inline { display: inline-flex; align-items: center; gap: 6px; }
.table-box { padding: 0; overflow-x: auto; display: block; position: relative; }
table { width: 100%; min-width: 900px; border-collapse: collapse; text-align: left; }
th, td { padding: 14px 12px; border-top: 1px solid var(--line); vertical-align: top; }
thead th { border-top: 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
th:first-child, td:first-child { padding-left: 20px; } th:last-child, td:last-child { padding-right: 20px; }
tbody th { font-weight: 700; }
.dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
.dl dt { font-size: 12px; color: var(--muted); } .dl dd { margin: 0; font-weight: 700; }

/* календарь */
.cal { padding: 12px; gap: 8px; }
.cal-head { display: flex; justify-content: space-between; align-items: center; } .cal-title { font-weight: 700; font-size: 17px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; font-weight: 600; }
.cal-week { font-size: 12px; color: var(--muted); }
.cal-day { min-height: 44px; border-radius: 10px; border: 2px solid transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--ink); text-decoration: none; }
.cal-day i, .cal-legend i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: block; }
.cal-day.future { color: #6B7380; font-weight: 400; }
.cal-day.now { border-color: var(--accent); }
.cal-day.sel { background: var(--ink); color: #fff; border-color: var(--ink); }
.cal-legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); padding: 0 4px; }

/* приглашения и вход */
.invite { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; } .invite-side { flex: 1 1 200px; min-width: 0; display: grid; gap: 8px; justify-items: start; } .invite-side input { width: 100%; }
.qr-img { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.login-body { padding-bottom: 0; min-height: 100vh; display: flex; flex-direction: column; }
.login-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.login-card { width: 100%; max-width: 920px; padding: 24px; display: flex; flex-wrap: wrap; gap: 32px; align-items: center; }
.login-text { flex: 1 1 340px; min-width: 0; display: grid; gap: 16px; justify-items: start; }
.login-text h1 { font-size: 28px; }
.login-qr { flex: 0 1 260px; display: grid; gap: 12px; justify-items: center; text-align: center; margin: 0 auto; }
.qr { width: 240px; height: 240px; } .qr svg { width: 100%; height: 100%; }
.status { display: flex; align-items: center; gap: 10px; background: var(--ground); border-radius: 10px; padding: 12px 16px; font-size: 14px; justify-self: stretch; }
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s infinite; }
.status.stopped .dot { animation: none; background: var(--bad); }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } .switch-row input::after { transition: none; } }
.login-footer { padding: 16px; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }

@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .top { padding: 8px 32px; } .logo { font-size: 20px; }
  .top-nav { display: flex; } .bottom-nav { display: none; }
  .avatar { margin-left: 0; }
  .banner { padding: 10px 32px; }
  .page { padding: 24px; gap: 20px; }
  h1 { font-size: 30px; }
  .card { padding: 20px; }
  .cols { grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; }
  .cols.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols.flip { grid-template-columns: 360px minmax(0, 1fr); }
  .col-main, .col-side { gap: 20px; }
  .tiles { display: flex; flex-wrap: wrap; gap: 8px; } .tile { min-width: 92px; min-height: 68px; font-size: 13px; padding: 8px 10px; }
  .login-card { padding: 40px; gap: 48px; }
}

/* Полный разбор из Telegram: переносы строк сохраняются, картинка идёт вместе со своим текстом */
.report summary { cursor: pointer; font-weight: 700; }
.report-part { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.report-text { white-space: pre-line; overflow-wrap: anywhere; }
.report-text blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid var(--line-strong); color: var(--ink-2); }
.report-text pre, .report-text code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }

/* «Сегодня» (макет 03): на телефоне порядок — готовность, последняя тренировка, прошлая ночь */
.cols.today .col-side { display: contents; }
.cols.today .o1 { order: 1; } .cols.today .col-main { order: 2; } .cols.today .o3 { order: 3; }
@media (min-width: 900px) {
  .cols.today .col-side { display: grid; gap: 20px; }
  .cols.today .o1, .cols.today .col-main, .cols.today .o3 { order: 0; }
}
.row-tag { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.copy-ok { color: var(--good-ink); font-weight: 700; }
