/* Мягкое стекло: матовые карточки поверх цветных пятен. Макет — артефакт «Дашборд здоровья». */
:root {
  --ink: #1D2A27;
  --ink-2: #2F3B38;
  --muted: #5A6763;
  --line: rgba(29, 42, 39, .08);
  --teal: #17796A;
  --teal-dark: #0F5A4E;
  --teal-soft: rgba(23, 121, 106, .12);
  --bad: #C9482C;
  --bad-ink: #A3361F;
  --bad-soft: rgba(201, 72, 44, .12);
  --coral: #E08A68;
  --lilac: #B4ACE0;
  --vio-ink: #4C4195;
  --vio-soft: rgba(124, 110, 200, .14);
  --warn-ink: #7D5206;
  --warn-soft: rgba(196, 132, 22, .15);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden;
  font-family: 'Onest', system-ui, -apple-system, sans-serif; color: var(--ink);
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 600px at 6% 0%, #CDEBDF 0%, rgba(205,235,223,0) 62%),
    radial-gradient(820px 700px at 100% 25%, #F9D9C7 0%, rgba(249,217,199,0) 60%),
    radial-gradient(900px 700px at 45% 100%, #DEDAF1 0%, rgba(222,218,241,0) 62%),
    #EEF1EE;
  background-attachment: fixed;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--teal); }
a:hover { color: var(--teal-dark); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid rgba(23,121,106,.45); outline-offset: 2px; }

/* Размытые пятна цвета, а не шары: чёткий шар поверх заголовка и кнопок читался как случайный предмет. */
.orb { position: fixed; border-radius: 50%; pointer-events: none; z-index: 0; filter: blur(42px); }
.orb-mint { left: 28%; top: 38%; width: 220px; height: 220px; opacity: .7;
  background: radial-gradient(circle at 32% 28%, #fff 0%, #C9EDE0 22%, #6FC2AB 70%, #3E9C86 100%); }
.orb-peach { right: 6%; top: 4%; width: 130px; height: 130px; opacity: .7;
  background: radial-gradient(circle at 32% 28%, #fff 0%, #FBDCCB 25%, #F0A584 75%, #E0805D 100%); }
.orb-lilac { right: 26%; bottom: 4%; width: 160px; height: 160px; opacity: .55;
  background: radial-gradient(circle at 32% 28%, #fff 0%, #E3E0F6 25%, #B4ACE0 75%, #8F86CB 100%); }

.g {
  background: rgba(255,255,255,.56);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: inset 0 1px 0 #fff, inset 0 -14px 28px -20px rgba(255,255,255,.9),
    0 30px 60px -36px rgba(30,62,56,.38), 0 2px 8px rgba(30,62,56,.05);
}
.gi { background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.95);
  box-shadow: inset 0 1px 0 #fff, 0 8px 18px -12px rgba(30,62,56,.3); }
.num { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* --- каркас --- */
.shell { position: relative; z-index: 1; max-width: 1440px; margin: 0 auto; padding: 24px;
  display: flex; gap: 24px; align-items: flex-start; }
.side { flex: 0 0 248px; border-radius: 28px; padding: 20px 14px; display: flex; flex-direction: column;
  gap: 4px; position: sticky; top: 24px; }
main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 24px; outline: none; }
.logo { display: flex; align-items: center; gap: 12px; padding: 4px 10px 20px; font-weight: 700; font-size: 17px; }
.logo-mark { width: 40px; height: 40px; border-radius: 13px; display: flex; align-items: center; justify-content: center;
  color: #fff; background: linear-gradient(160deg, #3DB39C, #146E61);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 8px 16px -8px rgba(23,121,106,.7); }
.nav { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 14px; border-radius: 14px;
  color: #3D4A46; text-decoration: none; font-size: 15px; font-weight: 500; }
.nav:hover { background: rgba(255,255,255,.55); color: var(--ink); }
.nav.on { background: rgba(255,255,255,.92); color: var(--teal-dark);
  box-shadow: inset 0 1px 0 #fff, 0 8px 20px -10px rgba(23,121,106,.45); }
.nav .chip { margin-left: auto; height: 22px; padding: 0 8px; font-size: 12px; }
/* «на всех устройствах» под «Выйти»: кнопка формы, выровнена по тексту пункта, а не по иконке */
.nav-sub { width: 100%; height: 32px; margin-top: -6px; padding-left: 46px; border: 0; background: none;
  font: inherit; font-size: 13px; color: var(--muted); cursor: pointer; }
.side hr { border: 0; height: 1px; background: var(--line); margin: 14px 10px; width: auto; }

.tabbar { display: none; }

.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 8px 4px 0; }
.page-head > div { flex: 1 1 280px; }
.page-head h1 { font-size: 34px; font-weight: 600; letter-spacing: -.025em; }
.page-head p { font-size: 15px; margin-top: 6px; }
.readonly { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--ink-2); }

.card { border-radius: 28px; padding: 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card h2 { font-size: 18px; font-weight: 600; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-sm { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.row { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.row > .wide { flex: 2 1 520px; min-width: 0; }
.row > .narrow { flex: 1 1 300px; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 20px; }

.kpi { border-radius: 22px; padding: 16px 18px; }
.kpi .label { font-size: 13px; color: var(--muted); }
.kpi .value { font-size: 28px; font-weight: 600; margin-top: 4px; }
.kpi .value small { font-size: 14px; font-weight: 400; color: var(--muted); }
.kpi .sub { font-size: 13px; margin-top: 4px; }
.big { font-size: 44px; font-weight: 600; line-height: 1.05; }
.big small { font-size: 16px; font-weight: 500; color: var(--muted); }
.icon-tile { width: 36px; height: 36px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex: none; }
.t-teal { background: var(--teal-soft); color: var(--teal); }
.t-coral { background: rgba(217,111,77,.14); color: #B8502F; }
.t-vio { background: var(--vio-soft); color: #5B4FA8; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap; }
.ok { background: var(--teal-soft); color: var(--teal-dark); }
.bad { background: var(--bad-soft); color: var(--bad-ink); }
.warn { background: var(--warn-soft); color: var(--warn-ink); }
.vio { background: var(--vio-soft); color: var(--vio-ink); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--teal); }
.dot.bad { background: var(--bad); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 999px; font-weight: 600; font-size: 15px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn-p { color: #fff; border: 1px solid rgba(255,255,255,.35);
  background: linear-gradient(180deg, #2E9C88 0%, #17796A 55%, #126A5D 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), inset 0 -6px 12px -6px rgba(0,40,34,.35), 0 12px 24px -10px rgba(23,121,106,.6); }
.btn-p:hover { color: #fff; filter: brightness(1.06); }
.btn-p:disabled { opacity: .55; cursor: default; }
.btn-s { color: var(--ink); border: 1px solid rgba(255,255,255,.95); background: rgba(255,255,255,.55);
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(140,170,165,.25), 0 10px 22px -14px rgba(30,62,56,.45); }
.btn-s:hover { color: var(--ink); background: rgba(255,255,255,.85); }
.btn-ib { width: 44px; padding: 0; border-radius: 14px; }

.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; max-width: 100%; overflow-x: auto; }
.seg button { min-height: 38px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent;
  font-size: 14px; font-weight: 500; color: #3D4A46; cursor: pointer; white-space: nowrap; }
.seg button.on { background: #fff; color: var(--teal-dark); font-weight: 600;
  box-shadow: 0 6px 14px -8px rgba(30,62,56,.5), inset 0 1px 0 #fff; }

.field { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 16px; border-radius: 999px; }
.field:focus-within { box-shadow: inset 0 1px 0 #fff, 0 0 0 3px rgba(23,121,106,.25); }
.field input { border: 0; background: transparent; outline: none; font: 400 16px 'Onest', system-ui, sans-serif;
  color: var(--ink); width: 100%; min-width: 0; }
.field input::placeholder { color: #6B7773; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.list { display: flex; flex-direction: column; gap: 2px; border-radius: 24px; padding: 6px; }
.item { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 14px; border-radius: 18px;
  text-decoration: none; color: var(--ink); border: 0; background: transparent; width: 100%; text-align: left; cursor: pointer; }
a.item:hover, button.item:hover { background: rgba(255,255,255,.75); color: var(--ink); }
.item .grow { flex: 1; min-width: 0; }
.item .t { display: block; font-weight: 600; font-size: 15px; }
.item .s { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.item .v { font-weight: 600; font-size: 16px; text-align: right; }
.group-label { font-size: 13px; font-weight: 600; color: #4A5753; text-transform: uppercase; letter-spacing: .06em; padding: 4px 4px 0; }

.chart { display: block; width: 100%; height: auto; overflow: visible; }
.spark { flex: none; overflow: visible; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 10px; border-radius: 3px; display: inline-block; }

.dates { display: flex; gap: 4px; padding: 4px; border-radius: 16px; overflow-x: auto; }
.dates button { flex: 1 0 auto; min-height: 40px; padding: 0 10px; border: 0; border-radius: 12px; background: transparent;
  font-size: 13px; color: #4A5753; cursor: pointer; white-space: nowrap; }
.dates button.on { background: #fff; color: var(--teal-dark); font-weight: 700; box-shadow: 0 6px 14px -8px rgba(30,62,56,.5); }

.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.tbl th { font-size: 13px; font-weight: 500; color: var(--muted); text-align: right; padding: 8px 12px; white-space: nowrap; }
.tbl td { padding: 12px; text-align: right; border-top: 1px solid rgba(29,42,39,.07); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.good { color: var(--teal-dark); font-weight: 600; }

.bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; gap: 3px; }

.summary { font-size: 15px; line-height: 1.55; color: var(--ink-2); white-space: pre-line; }
.empty { padding: 24px; text-align: center; color: var(--muted); font-size: 15px; }
.loading { padding: 40px 8px; }

/* --- переключатели «поделиться» --- */
.switch-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 14px;
  border: 0; background: transparent; text-align: left; cursor: pointer; border-radius: 18px; }
.switch-row:hover { background: rgba(255,255,255,.5); }
.switch { flex: none; width: 52px; height: 32px; border-radius: 999px; border: 1px solid rgba(255,255,255,.95);
  background: rgba(29,42,39,.14); position: relative; box-shadow: inset 0 2px 4px rgba(30,62,56,.18); }
.switch i { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(30,62,56,.35); transition: left .2s; }
.switch-row[aria-checked="true"] .switch { background: linear-gradient(180deg, #34A58F, #17796A); }
.switch-row[aria-checked="true"] .switch i { left: 23px; }
.linkbox { border-radius: 16px; padding: 14px 16px; font-size: 15px; font-weight: 500; color: var(--teal-dark); word-break: break-all; }

.message { max-width: 460px; margin: 15vh auto 0; border-radius: 28px; padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.message h1 { font-size: 24px; }

/* --- телефон --- */
@media (max-width: 899px) {
  .shell { padding: 16px 16px 112px; gap: 16px; }
  .side { display: none; }
  main { gap: 16px; }
  .page-head h1 { font-size: 28px; }
  .card { border-radius: 24px; padding: 18px; }
  .grid, .row, .stack { gap: 14px; }
  .big { font-size: 40px; }
  .grid-sm { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; }
  .kpi { padding: 12px 14px; border-radius: 18px; }
  .kpi .value { font-size: 22px; }
  .tabbar { display: flex; position: fixed; z-index: 5; left: 12px; right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom)); border-radius: 28px; padding: 6px; gap: 2px; }
  .tab { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 54px; border-radius: 20px; font-size: 11px; font-weight: 500; color: #4A5753; text-decoration: none; }
  .tab.on { color: var(--teal-dark); font-weight: 600; background: rgba(255,255,255,.92);
    box-shadow: inset 0 1px 0 #fff, 0 8px 18px -10px rgba(23,121,106,.5); }
  .orb-mint { left: -60px; top: 50%; }
  .orb-peach, .orb-lilac { opacity: .45; }
  .hide-phone { display: none !important; }
}
@media (min-width: 900px) { .hide-desktop { display: none !important; } }

/* --- вход --- */
.login { gap: 12px; }
.login label { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-top: 4px; }
.input { min-height: 48px; padding: 0 16px; border-radius: 16px; font: 400 16px 'Onest', system-ui, sans-serif; color: var(--ink); outline: none; }
.input:focus { box-shadow: inset 0 1px 0 #fff, 0 0 0 3px rgba(23,121,106,.25); }
.login .btn { margin-top: 8px; }
.error { background: var(--bad-soft); color: var(--bad-ink); border-radius: 14px; padding: 10px 14px; font-size: 14px; font-weight: 500; }
@media (max-width: 899px) { .message { margin: 10vh 16px 0; } }

/* Полоса дат сдачи: затухание у края, за которым есть ещё даты (иначе не видно, что она прокручивается). */
.dates { position: relative; }
.dates.more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.dates.more-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
.dates.more-l.more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
/* <main> получает фокус программно после перехода — рамка вокруг всей страницы не нужна. */
main:focus, main:focus-visible { outline: none; }
/* График с выбором точки: вертикальная прокрутка — странице, горизонтальное ведение пальцем — графику. */
svg[data-act="chart-pick"] { touch-action: pan-y; -webkit-user-select: none; user-select: none; }
/* Таблица обхватов на телефоне: четыре колонки с датами должны помещаться без прокрутки вбок. */
@media (max-width: 599px) {
  .tbl { font-size: 14px; }
  .tbl th, .tbl td { padding: 10px 6px; }
}

/* --- цикл: две даты внизу плитки --- */
.cycle-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cycle-dates > div { border-radius: 16px; padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cycle-dates b { font-size: 17px; font-weight: 600; }
