/*
  Сайт meddesk.kg — основа оформления всех страниц: главная с «живым»
  расписанием и анимациями (вариант А, тёмный) и документы (политика, удаление
  данных, 404). Сайт светлый: поверх этой таблицы на каждой странице —
  light.css (вариант Ж); эскизы в docs/site/variants тоже подключают эту.
  Цвета и шрифты — как в КП и презентации. Всё своё, со сторонних адресов
  ничего не грузится: так обещает политика (страж — tests/test_site.py).
  «Уменьшить движение» в системе выключает все анимации — см. конец файла.
*/
@font-face { font-family: "Unbounded"; src: url("/assets/fonts/Unbounded.woff2?v=2f7921a3") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-Regular.woff2?v=9e1daf82") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/assets/fonts/Inter-SemiBold.woff2?v=0274ea92") format("woff2"); font-weight: 600; font-display: swap; }

@view-transition { navigation: auto; }

:root {
  --gutter: clamp(16px, 5vw, 64px);
  --wide: 1240px;
  --measure: 68ch;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --display: "Unbounded", "Inter", system-ui, sans-serif;
}

/* Главная — тёмная. */
.home {
  --bg: #060A14;
  --bg-2: #0A1020;
  --panel: #0D1528;
  --panel-2: #121C34;
  --line: rgba(150, 172, 222, 0.14);
  --line-2: rgba(150, 172, 222, 0.28);
  --text: #EEF2FA;
  --muted: #9AABCB;
  --dim: #6A7C9E;
  --accent: #4C7DFF;
  --accent-2: #7FA2FF;
  --amber: #FFB347;
  --green: #3DDC97;
  --red: #FF6B6B;
  --link: #9DB8FF;
  color-scheme: dark;
}
/* Цвета документов (.doc-page) — в light.css, общие с главной. */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 "Inter", system-ui, sans-serif;
  font-feature-settings: "cv11", "ss03";
}
main { flex: 1; }
img, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.skip { position: absolute; left: -9999px; top: 12px; z-index: 100; padding: 8px 14px; border-radius: 8px; background: #FFFFFF; color: #0D1530; }
.skip:focus { left: 12px; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 20px; border-radius: 14px;
  font: 600 15px/1 "Inter", sans-serif; color: #FFFFFF; text-decoration: none; white-space: nowrap;
  background: linear-gradient(180deg, #5C8AFF, #3D6BF0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 12px 32px -12px rgba(76, 125, 255, 0.8);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background-color 0.2s;
}
.btn:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 16px 36px -12px rgba(76, 125, 255, 0.95); }
.btn svg { width: 18px; height: 18px; }
.btn-ghost { background: rgba(150, 172, 222, 0.08); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); }
.btn-ghost:hover { background: rgba(150, 172, 222, 0.14); box-shadow: inset 0 0 0 1px rgba(150, 172, 222, 0.45); }
.btn-sm { min-height: 38px; padding: 0 14px; border-radius: 11px; font-size: 14px; }
.btn-lg { min-height: 56px; padding: 0 24px; border-radius: 16px; font-size: 16px; }

/* ---------- шапка ---------- */
.bar {
  position: sticky; top: 0; z-index: 50;
  view-transition-name: bar;
  background: rgba(6, 10, 20, 0.5);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  backdrop-filter: saturate(150%) blur(16px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.3s, border-color 0.3s;
}
.bar.is-scrolled { background: rgba(6, 10, 20, 0.82); border-bottom-color: rgba(150, 172, 222, 0.14); }
.bar-in { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.mark {
  display: inline-flex; align-items: center; gap: 11px; flex: none;
  color: #EEF2FA; text-decoration: none;
  font: 600 20px/1 var(--display); letter-spacing: -0.01em;
}
.mark img { width: 32px; height: 32px; }
.nav { display: flex; gap: 2px; margin-left: auto; }
.nav a, .langs a {
  color: #9AABCB; text-decoration: none; font-size: 15px;
  padding: 8px 12px; border-radius: 999px; transition: color 0.2s, background-color 0.2s;
}
.nav a:hover, .langs a:hover { color: #EEF2FA; background: rgba(150, 172, 222, 0.1); }
.bar-end { display: flex; align-items: center; gap: 12px; }
.langs { display: flex; gap: 2px; }
.langs a { padding: 6px 10px; font-size: 14px; }
.langs a[aria-current="page"] { color: #EEF2FA; background: rgba(150, 172, 222, 0.14); }

/* ---------- первый экран ---------- */
.hero { position: relative; overflow: clip; text-align: center; }
.hero-bg { position: absolute; inset: -10% 0 0; pointer-events: none; }
.hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(150, 172, 222, 0.24) 1px, transparent 1.4px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(ellipse 60% 55% at 50% 30%, #000 10%, transparent 72%);
  mask-image: radial-gradient(ellipse 60% 55% at 50% 30%, #000 10%, transparent 72%);
}
.glow { position: absolute; border-radius: 50%; filter: blur(100px); }
.g1 { width: 560px; height: 560px; left: 50%; top: 18%; margin-left: -120px; background: #1E4FE6; opacity: 0.5; animation: drift 18s ease-in-out infinite alternate; }
.g2 { width: 440px; height: 440px; left: 50%; top: 32%; margin-left: -460px; background: #6A4DFF; opacity: 0.26; animation: drift 24s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { translate: 80px -40px; scale: 1.1; } }

.hero-in { position: relative; padding-top: clamp(40px, 6.5vw, 96px); }
.hero h1 {
  font: 600 clamp(40px, 6.6vw, 96px)/1.02 var(--display);
  letter-spacing: -0.035em;
}
.hero h1 .l { display: block; animation: kinetic 1.3s var(--ease) both; }
.hero h1 .l + .l { animation-delay: 0.12s; }
@keyframes kinetic {
  from { opacity: 0; translate: 0 0.35em; font-variation-settings: "wght" 250; letter-spacing: 0.02em; filter: blur(6px); }
  to { opacity: 1; translate: 0 0; font-variation-settings: "wght" 600; letter-spacing: -0.035em; filter: blur(0); }
}
.lead {
  margin: 28px auto 0; max-width: 40em;
  font-size: clamp(17px, 1.5vw, 20px); line-height: 1.55; color: var(--muted);
  animation: rise 0.9s 0.35s var(--ease) both;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero .cta-row { justify-content: center; animation: rise 0.9s 0.48s var(--ease) both; }
@keyframes rise { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }

/* ---------- живое расписание ---------- */
/* Контейнер — сцена, а не само окно: запрос @container не меняет элемент-контейнер. */
.mock-stage { margin-top: clamp(40px, 5.5vw, 72px); padding-bottom: clamp(56px, 8vw, 112px); perspective: 1600px; container-type: inline-size; }
.mock {
  position: relative; text-align: left;
  width: min(100%, 1080px); margin: 0 auto;
  display: grid; grid-template-columns: 188px minmax(0, 1fr);
  border-radius: 20px; overflow: hidden;
  background: linear-gradient(180deg, #0E172C, #0A1222);
  box-shadow: 0 0 0 1px rgba(150, 172, 222, 0.16), 0 50px 120px -30px rgba(2, 6, 18, 0.9), 0 0 120px -20px rgba(76, 125, 255, 0.35);
  font-size: 13px; line-height: 1.3;
  animation: mock-in 1.1s 0.25s var(--ease) both;
}
@keyframes mock-in { from { opacity: 0; translate: 0 40px; scale: 0.97; } to { opacity: 1; translate: 0 0; scale: 1; } }
@supports (animation-timeline: view()) {
  .mock-stage .mock {
    animation: mock-in 1.1s 0.25s var(--ease) both, tilt linear both;
    animation-timeline: auto, view();
    animation-range: normal, entry 0% cover 45%;
  }
}
@keyframes tilt { from { transform: rotateX(16deg) scale(0.94); } to { transform: none; } }

.m-side { padding: 18px 12px; border-right: 1px solid var(--line); background: rgba(6, 10, 20, 0.35); }
.m-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 18px; font-weight: 600; font-size: 14px; }
.m-brand img { width: 26px; height: 26px; }
.m-side ul { list-style: none; padding: 0; display: grid; gap: 2px; }
.m-side li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--muted); }
.m-side li svg { width: 16px; height: 16px; flex: none; }
.m-side li.on { color: var(--text); background: rgba(76, 125, 255, 0.16); box-shadow: inset 0 0 0 1px rgba(76, 125, 255, 0.28); }

.m-main { min-width: 0; padding: 16px 18px 18px; }
.m-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.m-head b { display: block; font-size: 17px; }
.m-head i { display: block; font-style: normal; color: var(--dim); font-size: 12px; }
.m-btn { padding: 8px 12px; border-radius: 9px; background: var(--accent); color: #FFFFFF; font-weight: 600; font-size: 12px; white-space: nowrap; }
.m-tools { display: flex; align-items: center; gap: 10px; margin: 14px 0 12px; }
.m-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(150, 172, 222, 0.08); }
.m-seg b, .m-seg i { padding: 5px 11px; border-radius: 8px; font-style: normal; color: var(--dim); font-weight: 400; }
.m-seg b { color: var(--text); background: rgba(150, 172, 222, 0.16); font-weight: 600; }
.m-date { padding: 5px 11px; border-radius: 9px; box-shadow: inset 0 0 0 1px var(--line-2); color: var(--muted); }

.m-grid {
  position: relative;
  display: grid;
  grid-template-columns: 48px repeat(4, minmax(0, 1fr));
  grid-template-rows: 46px repeat(8, 40px);
  border-radius: 12px; overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line);
  background:
    repeating-linear-gradient(to bottom, transparent 0 39px, rgba(150, 172, 222, 0.08) 39px 40px) 0 46px / 100% calc(100% - 46px) no-repeat;
}
.m-doc { display: flex; align-items: center; gap: 8px; padding: 0 8px; min-width: 0; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
.m-doc > span:last-child { min-width: 0; }
.m-doc b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-doc i { display: block; font-style: normal; color: var(--dim); font-size: 11px; }
.ava { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #FFFFFF; font-size: 10px; font-weight: 600; }
.a1 { background: #4C7DFF; } .a2 { background: #1FBF9F; } .a3 { background: #8B6CFF; } .a4 { background: #FF9A3D; }
.m-corner { border-bottom: 1px solid var(--line); }
.m-time { grid-column: 1; padding: 6px 0 0 8px; color: var(--dim); font-size: 11px; }
.r2 { grid-row: 2; } .r3 { grid-row: 3; } .r4 { grid-row: 4; } .r5 { grid-row: 5; } .r6 { grid-row: 6; } .r7 { grid-row: 7; } .r8 { grid-row: 8; } .r9 { grid-row: 9; }
.r8-9 { grid-row: 8 / 10; }
.c2 { grid-column: 2; } .c3 { grid-column: 3; } .c4 { grid-column: 4; } .c5 { grid-column: 5; }

.appt {
  position: relative; margin: 3px 4px; padding: 4px 8px; min-width: 0;
  border-radius: 7px; border-left: 3px solid var(--accent);
  background: rgba(76, 125, 255, 0.15); color: #D3E1FF;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  animation: drop 0.55s var(--ease) both;
}
.appt b { display: block; font-size: 11px; font-weight: 600; opacity: 0.85; }
.appt .tick { position: absolute; right: 7px; top: 50%; translate: 0 -50%; color: var(--green); font-weight: 600; }
.s-done { border-left-color: var(--green); background: rgba(61, 220, 151, 0.12); color: #C3F5DE; }
.s-miss { border-left-color: var(--red); background: rgba(255, 107, 107, 0.13); color: #FFD0D0; }
.s-new { border-left-color: var(--amber); background: rgba(255, 179, 71, 0.12); color: #FFE2B8; box-shadow: inset 0 0 0 1px rgba(255, 179, 71, 0.55); }
.break {
  margin: 3px 4px; border-radius: 7px; display: grid; place-items: center;
  color: var(--dim); font-size: 11px;
  background: repeating-linear-gradient(135deg, rgba(150, 172, 222, 0.07) 0 6px, transparent 6px 12px);
  box-shadow: inset 0 0 0 1px var(--line);
  animation: drop 0.55s 1.15s var(--ease) both;
}
.k1 { animation-delay: 0.55s; } .k2 { animation-delay: 0.62s; }
.k4 { animation-delay: 0.76s; } .k5 { animation-delay: 0.83s; } .k7 { animation-delay: 0.9s; }
.k8 { animation-delay: 0.97s; } .k9 { animation-delay: 1.04s; }
@keyframes drop { from { opacity: 0; translate: 0 -10px; scale: 0.96; } to { opacity: 1; translate: 0 0; scale: 1; } }

/*
  События дня играют, когда расписание на экране: класс .play ставит скрипт.
  До него новой записи ещё нет, а Жунусова только записана; без скрипта
  сразу видно, чем всё кончилось.
*/
.k6 { animation: none; }
.js .mock:not(.play) .k6 { opacity: 0; }
.js .mock:not(.play) .k3 { border-left-color: var(--accent); background-color: rgba(76, 125, 255, 0.15); color: #D3E1FF; }
.js .mock:not(.play) .k3 .tick, .js .mock:not(.play) .paid { opacity: 0; }
/* Новая запись с odoctor: появляется вместе с уведомлением и мигает рамкой. */
.mock.play .k6 { animation: drop 0.5s 0.8s var(--ease) both, ring 1.2s 0.9s ease-out 2; }
@keyframes ring { 0% { box-shadow: inset 0 0 0 1px rgba(255, 179, 71, 0.55), 0 0 0 0 rgba(255, 179, 71, 0.55); } 100% { box-shadow: inset 0 0 0 1px rgba(255, 179, 71, 0.55), 0 0 0 10px rgba(255, 179, 71, 0); } }
/* Жунусова пришла: из «Запланирован» в «Принят», потом «Оплачено». */
.k3 { animation-delay: 0.69s; }
.mock.play .k3 { animation: to-done 0.5s 2.1s var(--ease) both; }
@keyframes to-done {
  from { border-left-color: var(--accent); background-color: rgba(76, 125, 255, 0.15); color: #D3E1FF; }
  to { border-left-color: var(--green); background-color: rgba(61, 220, 151, 0.12); color: #C3F5DE; }
}
.mock.play .k3 .tick { animation: pop 0.4s 2.25s var(--ease) both; }
.paid {
  position: absolute; right: 22px; top: 50%; translate: 0 -50%;
  padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 600;
  color: #0A1020; background: var(--green);
}
.mock.play .paid { animation: pop 0.45s 3s var(--ease) both; }
@keyframes pop { from { opacity: 0; scale: 0.4; } to { opacity: 1; scale: 1; } }

.now { grid-column: 2 / -1; grid-row: 5; position: relative; pointer-events: none; animation: rise 0.6s 1.3s var(--ease) both; }
.now::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 2px; background: linear-gradient(90deg, var(--red), rgba(255, 107, 107, 0.15)); }
.now::after { content: ""; position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.6); animation: pulse 2s 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); } }

.m-toast {
  position: absolute; right: 18px; top: 64px; z-index: 2;
  display: flex; gap: 12px; align-items: flex-start; max-width: 300px;
  padding: 12px 14px; border-radius: 14px;
  background: rgba(18, 28, 52, 0.92); box-shadow: 0 0 0 1px rgba(255, 179, 71, 0.45), 0 20px 40px -10px rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; visibility: hidden;
}
.mock.play .m-toast { animation: toast 3.8s 0.6s var(--ease) both; }
.m-toast .dot { flex: none; width: 10px; height: 10px; margin-top: 4px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px var(--amber); }
.m-toast b { display: block; font-size: 13px; }
.m-toast i { display: block; font-style: normal; color: var(--muted); font-size: 12px; margin-top: 2px; }
@keyframes toast {
  0% { opacity: 0; visibility: visible; translate: 24px 0; }
  10%, 86% { opacity: 1; visibility: visible; translate: 0 0; }
  100% { opacity: 0; visibility: hidden; translate: 24px 0; }
}

@container (max-width: 820px) {
  .mock { grid-template-columns: minmax(0, 1fr); }
  .m-side { display: none; }
}
@container (max-width: 560px) {
  .m-doc i, .m-tools .m-date, .m-head i { display: none; }
  /* Узко: у врачей — только кружки с инициалами, «Оплачено» не влезает в запись. */
  .m-doc { justify-content: center; }
  .m-doc > span:last-child, .paid { display: none; }
  .m-grid { grid-template-columns: 40px repeat(3, minmax(0, 1fr)); }
  .c5 { display: none; }
  .m-toast { left: 12px; right: 12px; top: 56px; max-width: none; }
}

/* ---------- разделы главной: общее ---------- */
.section { padding-top: clamp(80px, 11vw, 160px); }
.section-title {
  font: 600 clamp(30px, 4.2vw, 58px)/1.08 var(--display);
  letter-spacing: -0.03em; max-width: 17em; text-wrap: balance;
}
.section-sub { margin-top: 20px; max-width: 40em; color: var(--muted); font-size: clamp(17px, 1.3vw, 19px); }

/* ---------- один день клиники ---------- */
.story-in { display: grid; grid-template-columns: minmax(0, 0.62fr) minmax(0, 1.38fr); gap: clamp(32px, 5vw, 80px); margin-top: clamp(32px, 5vw, 64px); }
.steps { list-style: none; padding: 0; }
.step { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; opacity: 0.3; transition: opacity 0.5s var(--ease); }
.step.is-active { opacity: 1; }
.step .time { font: 600 15px/1 var(--display); color: var(--accent-2); letter-spacing: 0.02em; }
.step h3 { margin-top: 14px; font: 600 clamp(26px, 2.6vw, 36px)/1.15 var(--display); letter-spacing: -0.02em; }
.step p:not(.time) { margin-top: 14px; color: var(--muted); font-size: 18px; max-width: 26em; }
.step-shot { display: none; }
/* Рамка шире колонки: заходит в правое поле — экраны программы крупнее. */
.frames { position: relative; margin-right: calc(-1 * var(--gutter) + 8px); }
.frame {
  position: sticky; top: max(92px, calc(50vh - 250px));
  aspect-ratio: 1600 / 956; border-radius: 18px; overflow: hidden;
  background: var(--panel);
  box-shadow: 0 0 0 1px rgba(150, 172, 222, 0.16), 0 40px 100px -30px rgba(2, 6, 18, 0.9), 0 0 100px -30px rgba(76, 125, 255, 0.4);
}
.frame img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: left top;
  opacity: 0; scale: 1.03; transition: opacity 0.6s var(--ease), scale 0.9s var(--ease);
}
.frame img.is-active { opacity: 1; scale: 1; }

/* ---------- возможности: плитки ---------- */
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: clamp(32px, 5vw, 64px); }
.tile {
  position: relative; overflow: hidden; isolation: isolate;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 300px; padding: 26px;
  border-radius: 22px; background: linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: inset 0 0 0 1px var(--line);
}
.tile::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity 0.3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(76, 125, 255, 0.16), transparent 45%);
}
.tile:hover::before { opacity: 1; }
.span2 { grid-column: span 2; }
.tile h3 { margin-top: auto; font-size: 20px; font-weight: 600; line-height: 1.3; }
.tile p { color: var(--muted); max-width: 30em; }
.viz { position: relative; flex: 1; min-height: 140px; display: flex; align-items: center; }

/* запись с odoctor: точка бежит от портала к расписанию */
.v-route { display: flex; align-items: center; width: 100%; }
.v-chip { flex: none; padding: 10px 14px; border-radius: 12px; background: rgba(150, 172, 222, 0.08); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 14px; }
.v-chip i { display: block; font-style: normal; color: var(--dim); font-size: 12px; }
.v-track { position: relative; flex: 1; height: 2px; margin: 0 12px; background: repeating-linear-gradient(90deg, rgba(150, 172, 222, 0.35) 0 6px, transparent 6px 12px); }
.v-dot { position: absolute; top: -5px; left: 0; width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 16px var(--amber); opacity: 0; }
.v-slot { flex: none; padding: 10px 14px; border-radius: 10px; border-left: 3px solid var(--amber); background: rgba(255, 179, 71, 0.12); color: #FFE2B8; font-size: 14px; }
.v-slot b { display: block; font-size: 12px; }
.in-view .v-dot { animation: travel 2.6s 0.3s ease-in-out infinite; }
.in-view .v-slot { animation: flash 2.6s 0.3s ease-in-out infinite; }
@keyframes travel { 0% { left: 0; opacity: 0; } 12% { opacity: 1; } 70% { left: calc(100% - 12px); opacity: 1; } 80%, 100% { left: calc(100% - 12px); opacity: 0; } }
@keyframes flash { 0%, 66% { box-shadow: 0 0 0 0 rgba(255, 179, 71, 0); } 76% { box-shadow: 0 0 0 6px rgba(255, 179, 71, 0.25); } 100% { box-shadow: 0 0 0 0 rgba(255, 179, 71, 0); } }

/* медкарты: строки протокола «пишутся» */
.v-doc { width: min(100%, 300px); padding: 16px; border-radius: 14px; background: rgba(150, 172, 222, 0.06); box-shadow: inset 0 0 0 1px var(--line); }
.v-doc b { display: block; font-size: 13px; margin-bottom: 4px; }
.v-line { display: block; height: 8px; border-radius: 4px; background: rgba(150, 172, 222, 0.22); margin-top: 9px; transform-origin: left; }
.v-l1 { width: 92%; } .v-l2 { width: 74%; } .v-l3 { width: 86%; } .v-l4 { width: 58%; background: rgba(76, 125, 255, 0.45); }
.in-view .v-line { animation: type 0.7s var(--ease) both; }
.in-view .v-l2 { animation-delay: 0.25s; } .in-view .v-l3 { animation-delay: 0.5s; } .in-view .v-l4 { animation-delay: 0.75s; }
@keyframes type { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* касса: квитанция и штамп «Оплачено» */
.v-receipt { position: relative; width: min(100%, 250px); margin-bottom: 18px; padding: 16px 18px; border-radius: 12px; background: #EEF2FA; color: #0D1530; font-size: 13px; }
.v-receipt p { display: flex; justify-content: space-between; gap: 12px; color: #0D1530; }
.v-receipt p + p { margin-top: 6px; }
.v-receipt .sum { margin-top: 10px; padding-top: 10px; border-top: 1px dashed #B9C3D8; font-weight: 600; font-size: 15px; }
.v-stamp { position: absolute; right: -14px; bottom: -22px; padding: 6px 12px; border: 2px solid var(--green); border-radius: 8px; color: var(--green); background: rgba(10, 16, 32, 0.92); font-weight: 600; font-size: 13px; rotate: -8deg; }
.in-view .v-stamp { animation: stamp 0.5s 0.5s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@keyframes stamp { from { opacity: 0; scale: 1.8; } to { opacity: 1; scale: 1; } }

/* отчёты: столбики растут */
.v-chart { position: relative; display: flex; align-items: flex-end; gap: clamp(6px, 1vw, 12px); width: 100%; height: 150px; padding-top: 30px; }
.v-bar { flex: 1; height: var(--h); border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #7FA2FF, #3D6BF0); transform-origin: bottom; }
.h46 { --h: 46%; } .h62 { --h: 62%; } .h41 { --h: 41%; } .h74 { --h: 74%; } .h58 { --h: 58%; } .h88 { --h: 88%; } .h66 { --h: 66%; }
.h96 { --h: 96%; background: linear-gradient(180deg, #FFD08A, #FF9A3D); }
.in-view .v-bar { animation: grow 0.8s var(--ease) both; }
.in-view .v-bar:nth-child(2) { animation-delay: 0.06s; } .in-view .v-bar:nth-child(3) { animation-delay: 0.12s; } .in-view .v-bar:nth-child(4) { animation-delay: 0.18s; }
.in-view .v-bar:nth-child(5) { animation-delay: 0.24s; } .in-view .v-bar:nth-child(6) { animation-delay: 0.3s; } .in-view .v-bar:nth-child(7) { animation-delay: 0.36s; } .in-view .v-bar:nth-child(8) { animation-delay: 0.42s; }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.v-total { position: absolute; right: 0; top: 0; font: 600 15px/1 var(--display); color: var(--text); }

/* склад: остаток тает с каждым приёмом */
.v-stock { width: min(100%, 320px); }
.v-stock p { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--text); }
.v-stock p i { font-style: normal; color: var(--muted); }
.v-gauge { height: 10px; margin-top: 10px; border-radius: 5px; background: rgba(150, 172, 222, 0.14); overflow: hidden; }
.v-gauge span { display: block; width: 62%; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--green), #8BEFC4); }
.in-view .v-gauge span { animation: deplete 1.6s 0.2s var(--ease) both; }
@keyframes deplete { from { width: 100%; } to { width: 62%; } }
.v-expiry { display: inline-block; margin-top: 14px; padding: 5px 10px; border-radius: 999px; font-size: 12px; color: #FFE2B8; background: rgba(255, 179, 71, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 179, 71, 0.4); }

/* роли и журнал */
.v-team { width: 100%; }
.v-roles { display: flex; flex-wrap: wrap; gap: 8px; }
.v-roles span { padding: 6px 12px; border-radius: 999px; font-size: 13px; background: rgba(150, 172, 222, 0.08); box-shadow: inset 0 0 0 1px var(--line-2); }
.v-log { list-style: none; padding: 0; margin-top: 18px; display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.v-log li { display: flex; gap: 12px; }
.v-log time { color: var(--dim); font-variant-numeric: tabular-nums; }
.in-view .v-log li { animation: rise 0.6s var(--ease) both; }
.in-view .v-log li:nth-child(2) { animation-delay: 0.2s; } .in-view .v-log li:nth-child(3) { animation-delay: 0.4s; }

/* чаты: пациент пишет в мессенджер, клиника отвечает из MedDesk */
.v-chat { width: 100%; display: grid; gap: 8px; }
.v-chat-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; font-size: 13px; color: var(--muted); }
.v-chat-head b { color: var(--text); font-weight: 600; }
.v-chan { display: inline-flex; gap: 6px; }
.v-chan span { padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.wa { color: #3DDC97; background: rgba(61, 220, 151, 0.12); box-shadow: inset 0 0 0 1px rgba(61, 220, 151, 0.35); }
.tg { color: #8CCBFF; background: rgba(76, 170, 255, 0.12); box-shadow: inset 0 0 0 1px rgba(76, 170, 255, 0.35); }
.bubble { max-width: 78%; padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.4; }
.bubble.in { justify-self: start; color: var(--text); background: rgba(150, 172, 222, 0.12); border-bottom-left-radius: 4px; }
.bubble.out { justify-self: end; background: linear-gradient(180deg, #5C8AFF, #3D6BF0); color: #FFFFFF; border-bottom-right-radius: 4px; }
.v-booked { justify-self: end; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #0A1020; background: var(--green); }
.in-view .bubble.in { animation: rise 0.5s 0.2s var(--ease) both; }
.in-view .bubble.out { animation: rise 0.5s 1.1s var(--ease) both; }
.in-view .v-booked { animation: pop 0.45s 1.9s var(--ease) both; }

/* доска обращений: карточка переезжает из «В работе» в «Записан» */
.v-board { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: auto; gap: 8px; align-items: start; }
.c1 { grid-column: 1; }
.v-colh { grid-row: 1; padding: 0 2px 2px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-card { padding: 8px 10px; border-radius: 10px; font-size: 13px; line-height: 1.3; background: rgba(150, 172, 222, 0.1); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-card i { display: block; font-style: normal; font-size: 11px; color: var(--dim); }
.v-move { background: rgba(61, 220, 151, 0.12); box-shadow: inset 0 0 0 1px rgba(61, 220, 151, 0.45); }
.in-view .v-move { animation: move-right 0.9s 0.7s var(--ease) both; }
@keyframes move-right {
  from { translate: calc(-100% - 8px) 0; background-color: rgba(150, 172, 222, 0.1); box-shadow: inset 0 0 0 1px rgba(150, 172, 222, 0.14); }
  to { translate: 0 0; }
}

/* В Unbounded нет ң, ө, ү: на кыргызской версии крупный текст набран Inter. */
:lang(ky) :is(.hero h1, .section-title, .step h3, .step .time, .plan .when, .doc h1, .v-total) {
  font-family: "Inter", system-ui, sans-serif; font-weight: 600; letter-spacing: -0.03em;
}

/* ---------- без интернета ---------- */
.offline-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.switch { display: inline-flex; align-items: center; gap: 14px; margin-top: 36px; cursor: pointer; font-weight: 600; font-size: 18px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.track { position: relative; width: 60px; height: 34px; border-radius: 999px; background: var(--accent); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); transition: background-color 0.3s; }
.thumb { position: absolute; top: 4px; left: 30px; width: 26px; height: 26px; border-radius: 50%; background: #FFFFFF; transition: left 0.3s var(--ease); }
.switch input:not(:checked) + .track { background: rgba(150, 172, 222, 0.25); }
.switch input:not(:checked) + .track .thumb { left: 4px; }
.switch input:focus-visible + .track { outline: 3px solid var(--accent); outline-offset: 3px; }
.state { margin-top: 18px; color: var(--muted); max-width: 30em; min-height: 3.2em; }
.offline:has(#net:not(:checked)) .state.on, .offline:has(#net:checked) .state.off,
.offline:has(#net:not(:checked)) .uplink-label .on, .offline:has(#net:checked) .uplink-label .off { display: none; }
.uplink-label .off { color: var(--red); }

.net { display: grid; justify-items: center; }
.cloud { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.node {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px;
  background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); font-size: 14px; white-space: nowrap;
  transition: opacity 0.4s, box-shadow 0.4s;
}
.uplink { position: relative; display: flex; gap: 120px; height: 76px; }
.wire { width: 2px; height: 100%; background: repeating-linear-gradient(to bottom, var(--accent-2) 0 6px, transparent 6px 14px); background-size: 2px 14px; animation: flow 0.8s linear infinite; }
.wire.up { animation-direction: reverse; }
@keyframes flow { to { background-position: 0 14px; } }
.uplink-label { position: absolute; left: 50%; top: 50%; translate: -50% -50%; font-size: 12px; color: var(--dim); }
.clinic { position: relative; display: grid; justify-items: center; width: 100%; padding: 34px 20px 24px; border-radius: 24px; box-shadow: inset 0 0 0 1px var(--line-2); background: rgba(13, 21, 40, 0.6); }
.clinic-label { position: absolute; top: 12px; left: 18px; font-size: 12px; color: var(--dim); }
.server { box-shadow: inset 0 0 0 1px rgba(76, 125, 255, 0.6), 0 0 40px -8px rgba(76, 125, 255, 0.6); }
.server img { width: 20px; height: 20px; }
.lan { display: flex; gap: 96px; height: 48px; }
.stations { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.offline:has(#net:not(:checked)) .uplink .wire { animation: none; background: repeating-linear-gradient(to bottom, rgba(150, 172, 222, 0.2) 0 6px, transparent 6px 14px); }
.offline:has(#net:not(:checked)) .cloud .node { opacity: 0.35; }

/* ---------- внедрение за день ---------- */
.plan { list-style: none; padding: 0; position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 4vw, 56px); margin-top: clamp(32px, 5vw, 64px); }
.plan::before { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px; background: linear-gradient(90deg, var(--accent), var(--amber)); transform-origin: left; transition: transform 1.4s var(--ease); }
.js .plan:not(.in-view)::before { transform: scaleX(0); }
.plan li { position: relative; padding-top: 34px; }
.plan li::before { content: ""; position: absolute; top: 0; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); box-shadow: inset 0 0 0 3px var(--accent-2); }
.plan .when { font: 600 15px/1 var(--display); color: var(--accent-2); }
.plan h3 { margin-top: 12px; font-size: 22px; font-weight: 600; line-height: 1.3; }
.plan p:not(.when) { margin-top: 8px; color: var(--muted); }

/* ---------- контакты ---------- */
.contact { padding-bottom: clamp(80px, 11vw, 160px); }
.contact-card {
  position: relative; overflow: hidden; isolation: isolate;
  padding: clamp(32px, 6vw, 80px); border-radius: 32px; text-align: center;
  background: radial-gradient(ellipse 80% 90% at 50% 0%, rgba(76, 125, 255, 0.35), transparent 70%), var(--panel);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.contact-card .cta-row { justify-content: center; }
.contact-card .section-title { margin: 0 auto; }
.contact-card .section-sub { margin-left: auto; margin-right: auto; }
.where { margin-top: 28px; color: var(--dim); font-size: 15px; }

/* ---------- подвал ---------- */
.foot { border-top: 1px solid rgba(150, 172, 222, 0.14); background: #060A14; color: #9AABCB; font-size: 15px; }
.foot-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; padding-top: 40px; padding-bottom: 40px; }
.foot .mark { font-size: 17px; }
.foot .mark img { width: 26px; height: 26px; }
.who { margin-top: 14px; color: #EEF2FA; }
.foot ul { list-style: none; padding: 0; display: grid; gap: 8px; justify-items: end; align-content: start; }
.foot a { color: #EEF2FA; }
.copy { grid-column: 1 / -1; color: #6A7C9E; font-size: 14px; }

/* ---------- документы ---------- */
.doc { padding-top: clamp(40px, 6vw, 80px); padding-bottom: clamp(56px, 8vw, 104px); }
.doc > * { max-width: var(--measure); }
.doc h1 { font: 600 clamp(28px, 3.6vw, 42px)/1.15 var(--display); letter-spacing: -0.015em; text-wrap: balance; }
.doc .revision { margin-top: 12px; color: var(--muted); font-size: 15px; }
.doc .intro { margin-top: 28px; font-size: 19px; line-height: 1.55; }
.doc h2 { margin-top: 48px; font-size: 21px; line-height: 1.3; font-weight: 600; }
.doc h2 + * { margin-top: 12px; }
.doc p + p, .doc p + ul, .doc ul + p { margin-top: 14px; }
.doc ul { padding-left: 1.3em; }
.doc li + li { margin-top: 8px; }
.doc li::marker { color: var(--muted); }

/* ---------- появление при прокрутке (только со скриптом) ---------- */
.js .reveal { opacity: 0; translate: 0 32px; transition: opacity 0.9s var(--ease), translate 0.9s var(--ease); }
.js .reveal.in-view { opacity: 1; translate: 0 0; }

/* ---------- узкие экраны ---------- */
@media (max-width: 980px) {
  .nav { display: none; }
  .bar-end { margin-left: auto; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .story-in { grid-template-columns: minmax(0, 1fr); }
  .frames { display: none; }
  .step { min-height: 0; opacity: 1; padding-bottom: 48px; }
  .step-shot { display: block; margin-top: 22px; border-radius: 14px; box-shadow: 0 0 0 1px rgba(150, 172, 222, 0.16), 0 24px 60px -24px rgba(2, 6, 18, 0.9); }
  .offline-in { grid-template-columns: minmax(0, 1fr); }
  .plan { grid-template-columns: minmax(0, 1fr); }
  .plan::before { left: 7px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; background: linear-gradient(180deg, var(--accent), var(--amber)); transform-origin: top; }
  .js .plan:not(.in-view)::before { transform: scaleY(0); }
  .plan li { padding: 0 0 0 40px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .bento { grid-template-columns: minmax(0, 1fr); }
  .span2 { grid-column: auto; }
  .v-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .v-board .c4 { display: none; }
  .tile { min-height: 0; }
  .bar .btn-sm { display: none; }
  .mark { font-size: 18px; }
  .uplink { gap: 70px; }
  .lan { gap: 56px; }
  .foot-in { grid-template-columns: minmax(0, 1fr); }
  .foot ul { justify-items: start; }
  .hero .cta-row .btn, .contact-card .cta-row .btn { flex: 1 1 auto; }
}

/* ---------- меньше движения ---------- */
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; translate: none; }
  .js .plan:not(.in-view)::before { transform: none; }
  .m-toast { display: none; }
}

@media print {
  .bar, .foot { background: none; color: #000; }
  .langs, .nav, .bar-end .btn { display: none; }
}
