/*
 * Стили экрана киоска (вариант C, «бенто»).
 * Единица измерения: 1rem = 100 px макета. Размер шрифта корня подбирается так,
 * чтобы макет 1920×1080 (или 1080×1920 в вертикали) целиком помещался в экран.
 */

:root {
  --accent: #0082c8;
  --ink: #1d2b3a;
  --muted: #4d5766;
  --muted-2: #5f6877;
  --ground: #e9f0f5;
  --card: #ffffff;
  --line: #dbe5ee;
  --night: #14324a;
  --light-tile: #d4e8f6;
  --light-ic: #005a8c;
}

html { font-size: min(5.2083vw, 9.2593vh); }
@media (orientation: portrait) {
  html { font-size: min(9.2593vw, 5.2083vh); }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: 'PT Sans', Arial, sans-serif;
  font-size: .24rem;
  line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
h1, h2, .mont { font-family: Montserrat, Arial, sans-serif; }
[hidden] { display: none !important; }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .12rem;
  height: .72rem; padding: 0 .36rem;
  border: none; border-radius: .18rem;
  background: var(--accent); color: #fff; text-decoration: none;
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .24rem;
}
.btn-block { width: 100%; }
.btn-primary:active, .tile:active, .review-btn:active, .wifi:active, .wp-item:active, .btn-back:active, .picker-card:active {
  transform: scale(.97);
}

.card { background: var(--card); border-radius: .32rem; }

/* ================= Главный экран ================= */

.home {
  height: 100vh;
  height: 100dvh;
  padding: .4rem .48rem;
  display: grid;
  gap: .2rem;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) 4rem;
  grid-template-rows: .8rem 2.36rem minmax(0, 1fr);
  grid-template-areas:
    "head head head"
    "welc clock side"
    "tiles tiles side";
  overflow: hidden;
}
.no-side .home {
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  grid-template-areas: "head head" "welc clock" "tiles tiles";
}

.home-head { grid-area: head; display: flex; align-items: center; gap: .18rem; min-width: 0; }
.home-titles { display: flex; align-items: baseline; gap: .16rem; min-width: 0; }
.home-name { font-family: Montserrat, Arial, sans-serif; font-weight: 800; font-size: .36rem; white-space: nowrap; }
.home-addr { font-size: .22rem; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-addr-label { color: var(--ink); font-weight: 700; }
.home-addr-sep { margin: 0 .1rem; }

.logo-wrap { flex-shrink: 0; display: flex; }
.logo { height: .72rem; }
.logo-mark {
  width: .72rem; border-radius: .22rem; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.logo-mark svg { width: .42rem; height: .42rem; }
.logo-img { width: auto; max-width: 3.2rem; object-fit: contain; }

.welcome {
  grid-area: welc;
  padding: .32rem .4rem;
  display: flex; flex-direction: column; justify-content: center; gap: .12rem;
  overflow: hidden;
}
.welcome h1 { margin: 0; font-weight: 700; font-size: .46rem; line-height: 1.15; }
.welcome p {
  margin: 0; font-size: .24rem; line-height: 1.4; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.clock-card {
  grid-area: clock;
  background: var(--night); color: #fff;
  padding: .32rem .4rem;
  display: flex; flex-direction: column; justify-content: center; gap: .1rem;
}
.clock-time {
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; line-height: 1;
  font-size: .82rem; letter-spacing: -.01rem; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.clock-date { font-size: .28rem; opacity: .9; white-space: nowrap; }

/* ---- Отзыв и Wi-Fi ---- */
.side { grid-area: side; display: flex; flex-direction: column; gap: .2rem; min-height: 0; }

.review {
  flex: 1 1 auto; min-height: 0;
  padding: .32rem;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .16rem;
  text-align: center;
}
.review-title { font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .3rem; }
.review-stars { display: flex; gap: .06rem; color: #f2b705; }
.review-stars svg { width: .34rem; height: .34rem; }
.review-qr { width: 2.4rem; height: 2.4rem; padding: .14rem; border: 2px solid var(--line); border-radius: .22rem; flex-shrink: 0; }
.review-cap { font-size: .21rem; color: var(--muted); }
.review-or { display: flex; align-items: center; gap: .12rem; width: 100%; color: #8b96a5; font-size: .19rem; }
.review-or span { flex: 1; height: 1px; background: var(--line); }
.review-btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: .72rem; border-radius: .18rem;
  background: var(--accent); color: #fff; text-decoration: none;
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .23rem;
}
.portrait-only { display: none; }

.wifi {
  flex-shrink: 0;
  border: 2px solid #b9d7ec; background: #f7fbfe; color: var(--ink);
  padding: .22rem .26rem;
  display: flex; align-items: center; gap: .18rem; text-align: left;
}
.wifi-ic { color: var(--accent); display: flex; }
.wifi-ic svg { width: .48rem; height: .48rem; }
.wifi-text { display: flex; flex-direction: column; gap: .02rem; min-width: 0; }
.wifi-title { font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .24rem; }
.wifi-ssid { font-size: .2rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wifi-hint { font-size: .2rem; color: #0072b0; font-weight: 700; }

/* ---- Плитки ---- */
.tiles { grid-area: tiles; display: flex; flex-direction: column; gap: .16rem; min-height: 0; }
.tiles-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 .08rem; }
.tiles-head h2 { margin: 0; font-weight: 700; font-size: .32rem; }
.tiles-count { font-size: .22rem; color: var(--muted-2); }
.tiles-count b { color: var(--ink); }

.tiles-viewport { flex: 1 1 auto; min-height: 0; overflow: hidden; margin: 0 -.1rem; touch-action: pan-y; }
.tiles-track { display: flex; height: 100%; transition: transform .45s ease; will-change: transform; }
.tiles-track.dragging { transition: none; }
.tiles-page {
  flex: 0 0 100%; height: 100%; padding: 0 .1rem;
  display: grid; gap: .2rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}
.no-side .tiles-page { grid-template-columns: repeat(5, minmax(0, 1fr)); }

.tile {
  border-radius: .32rem; padding: .28rem .3rem;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  text-decoration: none; overflow: hidden; min-height: 0;
  background: var(--card); color: var(--ink);
  transition: transform .12s ease;
}
.tile-ic { width: .58rem; height: .58rem; flex-shrink: 0; color: var(--accent); }
.tile-text { display: flex; flex-direction: column; gap: .06rem; min-width: 0; }
.tile-title {
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .28rem; line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.tile-sub { font-size: .2rem; color: var(--muted-2); }
.tile-light { background: var(--light-tile); }
.tile-light .tile-ic { color: var(--light-ic); }
.tile-light .tile-sub { color: #3d4856; }
.tile-accent { background: var(--accent); color: #fff; }
.tile-accent .tile-ic { color: #fff; }
.tile-accent .tile-sub { color: rgba(255, 255, 255, .92); }
.tile-custom { background: var(--tile-bg); }
.tile-on-dark { color: #fff; }
.tile-on-dark .tile-ic { color: #fff; }
.tile-on-dark .tile-sub { color: rgba(255, 255, 255, .9); }
.tile-on-light .tile-ic { color: var(--ink); }
.tile-on-light .tile-sub { color: #3d4856; }

.tiles-empty {
  flex: 1; display: flex; align-items: center; justify-content: center;
  border: 2px dashed #b4c3d0; border-radius: .32rem; color: var(--muted-2); font-size: .26rem;
}

.pager { height: .76rem; flex-shrink: 0; display: flex; align-items: center; gap: .2rem; }
.pager-prev {
  width: .76rem; height: .76rem; flex-shrink: 0; border-radius: 50%; border: none;
  background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center;
}
.pager-prev:disabled { opacity: .35; }
.pager-prev svg, .pager-next svg { width: .36rem; height: .36rem; }
.pager-dots { display: flex; align-items: center; gap: .04rem; }
.pager-dots button { border: none; background: transparent; height: .48rem; padding: 0 .06rem; display: flex; align-items: center; }
.pager-dots span { display: block; height: .14rem; width: .14rem; border-radius: .07rem; background: #b4c3d0; transition: width .3s ease; }
.pager-dots .on span { width: .48rem; background: var(--accent); }
.pager-hint { flex: 1; font-size: .22rem; color: var(--muted); line-height: 1.3; }
.pager-next {
  height: .76rem; flex-shrink: 0; border-radius: .38rem; border: none;
  background: var(--accent); color: #fff; padding: 0 .2rem 0 .32rem;
  display: flex; align-items: center; gap: .12rem;
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .24rem;
}
.pager-next.last { background: #fff; color: var(--ink); }

/* ---- Вертикальная ориентация ---- */
@media (orientation: portrait) {
  .home {
    padding: .44rem .48rem;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: .96rem auto 3.2rem minmax(0, 1fr);
    grid-template-areas: "head clock" "welc welc" "side side" "tiles tiles";
  }
  .no-side .home {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: .96rem auto minmax(0, 1fr);
    grid-template-areas: "head clock" "welc welc" "tiles tiles";
  }
  .home-titles { flex-direction: column; align-items: flex-start; gap: .02rem; }
  .home-name { font-size: .34rem; }
  .home-addr { font-size: .2rem; }
  .logo { height: .76rem; }
  .logo-mark { width: .76rem; }

  .clock-card { border-radius: .28rem; padding: .14rem .28rem; align-items: flex-end; gap: .02rem; }
  .clock-card .clock-time { font-size: .44rem; }
  .clock-card .clock-date { font-size: .2rem; }

  .welcome h1 { font-size: .5rem; }
  .welcome p { font-size: .26rem; }

  .side { flex-direction: row; }
  .review {
    flex: 2 1 0; padding: .28rem;
    display: grid; grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "qr title" "qr stars" "qr cap" "qr btn";
    column-gap: .28rem; row-gap: .12rem; align-content: center; justify-items: start; text-align: left;
  }
  .review-qr { grid-area: qr; width: 2.4rem; height: 2.4rem; padding: .12rem; align-self: center; }
  .review-title { grid-area: title; }
  .review-stars { grid-area: stars; }
  .review-stars svg { width: .3rem; height: .3rem; }
  .review-cap { grid-area: cap; line-height: 1.35; }
  .review-btn { grid-area: btn; height: .64rem; font-size: .22rem; }
  .review-or { display: none; }
  .portrait-only { display: inline; }

  .wifi { flex: 1 1 0; padding: .28rem; flex-direction: column; justify-content: space-between; align-items: flex-start; }
  .wifi-ic svg { width: .58rem; height: .58rem; }
  .wifi-text { gap: .06rem; }
  .wifi-title { font-size: .26rem; }

  .tiles-page, .no-side .tiles-page {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(3, minmax(0, 1fr));
  }
  .tile { padding: .28rem; }
  .tile-title { font-size: .26rem; }
  .tile-sub { font-size: .19rem; }
  .pager { height: .8rem; gap: .16rem; }
  .pager-prev { width: .8rem; height: .8rem; }
  .pager-next { height: .8rem; font-size: .23rem; padding: 0 .2rem 0 .3rem; }
  .pager-hint { font-size: .2rem; }
}

/* ================= Модальные окна ================= */

.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(16, 32, 48, .6);
  display: flex; align-items: center; justify-content: center;
  animation: fade .2s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal-box {
  background: #fff; border-radius: .36rem; padding: .48rem .56rem;
  display: flex; flex-direction: column; align-items: center; gap: .2rem;
  width: 5.6rem; max-width: 92vw; text-align: center;
}
.modal-title { font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .36rem; }
.wifi-qr { width: 3.4rem; height: 3.4rem; }
.wifi-data { font-size: .24rem; line-height: 1.5; word-break: break-word; }
.wifi-help { margin: 0; font-size: .2rem; color: var(--muted); }
.wifi-box .btn-primary { height: .68rem; font-size: .26rem; }
@media (orientation: portrait) {
  .modal-box { width: 6.2rem; }
  .wifi-qr { width: 4rem; height: 4rem; }
  .modal-title { font-size: .38rem; }
  .wifi-data { font-size: .26rem; }
}
.qr svg { display: block; width: 100%; height: 100%; }

.lightbox { background: rgba(10, 20, 30, .88); }
.lightbox-box { position: relative; max-width: 94vw; max-height: 90vh; display: flex; }
.lightbox-box img { max-width: 94vw; max-height: 90vh; object-fit: contain; border-radius: .12rem; background: #fff; }
.lightbox-close {
  position: fixed; top: .3rem; right: .3rem;
  width: .9rem; height: .9rem; border-radius: 50%; border: none;
  background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center;
}
.lightbox-close svg { width: .4rem; height: .4rem; }

/* ================= Внутренние страницы ================= */

.inner-page { min-height: 100vh; }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: .28rem;
  padding: .28rem .48rem;
  background: var(--ground);
}
.btn-back {
  flex-shrink: 0; display: flex; align-items: center; gap: .08rem;
  height: .84rem; padding: 0 .34rem 0 .2rem; border-radius: .42rem;
  background: #fff; color: var(--ink); text-decoration: none;
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .26rem;
}
.btn-back svg { width: .4rem; height: .4rem; }
.topbar-title { flex: 1; min-width: 0; }
.topbar-clinic { font-size: .2rem; color: var(--muted-2); }
.topbar h1 { margin: 0; font-size: .4rem; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clock-compact {
  flex-shrink: 0; background: var(--night); color: #fff; border-radius: .24rem;
  padding: .12rem .26rem; display: flex; flex-direction: column; align-items: flex-end; gap: .02rem;
}
.clock-compact .clock-time { font-size: .4rem; }
.clock-compact .clock-date { font-size: .18rem; }

.empty-note { padding: .8rem; text-align: center; color: var(--muted-2); font-size: .28rem; }

/* ---- Веб-страница плитки ---- */
.webpage { padding: 0 .48rem .56rem; display: flex; flex-direction: column; gap: .24rem; }
.wp-section {
  background-color: var(--sec-bg); color: var(--sec-fg);
  background-size: cover; background-position: center;
  border-radius: .32rem; padding: .4rem .48rem;
}
.wp-section h2 { margin: 0 0 .16rem; font-weight: 700; font-size: .4rem; line-height: 1.2; }
.wp-text { margin: 0 0 .24rem; font-size: .25rem; line-height: 1.45; max-width: 12rem; }
.wp-section > :last-child { margin-bottom: 0; }
.wp-items { display: flex; flex-wrap: wrap; gap: .2rem; }
.wp-item { display: inline-flex; align-items: center; gap: .14rem; text-decoration: none; }
.wp-button {
  min-height: .88rem; padding: .16rem .36rem .16rem .28rem; border-radius: .2rem;
  background: var(--accent); color: #fff;
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .24rem;
}
.wp-link {
  min-height: .64rem; padding: 0 .06rem; color: inherit;
  font-size: .26rem; text-decoration: underline; text-underline-offset: .05rem;
}
.wp-ic { width: .3rem; height: .3rem; flex-shrink: 0; }

/* ---- Просмотр PDF ---- */
.pdf-view { padding: 0 .48rem 1.6rem; display: flex; flex-direction: column; align-items: center; gap: .2rem; overflow-x: auto; }
.pdf-view canvas { display: block; background: #fff; border-radius: .06rem; box-shadow: 0 .04rem .2rem rgba(20, 50, 74, .15); }
.pdf-page-slot { background: #fff; border-radius: .06rem; flex-shrink: 0; }
.pdf-status { padding: 1rem; font-size: .28rem; color: var(--muted-2); text-align: center; }
.pdf-zoom { position: fixed; right: .4rem; bottom: .4rem; z-index: 20; display: flex; gap: .16rem; }
.pdf-zoom button {
  width: .9rem; height: .9rem; border-radius: 50%; border: none;
  background: #fff; color: var(--ink); box-shadow: 0 .04rem .2rem rgba(20, 50, 74, .2);
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .44rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.pdf-zoom svg { width: .4rem; height: .4rem; }

/* ---- Заглушка модуля ---- */
.module-page { padding: 0 .48rem .48rem; }
.module-stub {
  background: #fff; border-radius: .32rem; padding: .8rem .6rem;
  display: flex; flex-direction: column; align-items: center; gap: .24rem; text-align: center;
}
.module-stub-ic { width: 1.6rem; height: 1.6rem; border-radius: .4rem; background: var(--light-tile); color: var(--light-ic); display: flex; align-items: center; justify-content: center; }
.module-stub-ic svg { width: .96rem; height: .96rem; }
.module-stub h2 { margin: 0; font-size: .48rem; }
.module-stub p { margin: 0; font-size: .28rem; color: var(--muted); }

/* ================= Выбор клиники ================= */

.picker { min-height: 100vh; padding: .64rem .64rem .8rem; display: flex; flex-direction: column; gap: .48rem; }
.picker-head h1 { margin: 0 0 .12rem; font-size: .6rem; }
.picker-head p { margin: 0; font-size: .26rem; color: var(--muted); max-width: 12rem; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.2rem, 1fr)); gap: .28rem; }
.picker-card {
  border: none; background: #fff; border-radius: .32rem; padding: .4rem;
  display: flex; flex-direction: column; align-items: flex-start; gap: .14rem; text-align: left;
  min-height: 2.6rem;
}
.picker-logo { height: .96rem; }
.picker-logo.logo-mark { width: .96rem; border-radius: .26rem; }
.picker-logo.logo-mark svg { width: .56rem; height: .56rem; }
.picker-name { font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .32rem; line-height: 1.2; margin-top: auto; }
.picker-addr { font-size: .22rem; color: var(--muted-2); }
.picker-empty { display: flex; flex-direction: column; align-items: flex-start; gap: .24rem; font-size: .28rem; }

/* ---- Текстовый блок раздела (HTML) ---- */
.wp-html { flex: 1 0 100%; font-size: .26rem; line-height: 1.5; -webkit-user-select: text; user-select: text; }
.wp-html > :first-child { margin-top: 0; }
.wp-html > :last-child { margin-bottom: 0; }
.wp-html p { margin: 0 0 .16rem; }
.wp-html h1, .wp-html h2, .wp-html h3, .wp-html h4, .wp-html h5 { font-family: Montserrat, Arial, sans-serif; font-weight: 700; line-height: 1.25; margin: .28rem 0 .12rem; }
.wp-html h1 { font-size: .44rem; font-weight: 800; }
.wp-html h2 { font-size: .36rem; }
.wp-html h3 { font-size: .3rem; }
.wp-html h4 { font-size: .26rem; }
.wp-html h5 { font-size: .22rem; text-transform: uppercase; letter-spacing: .04em; opacity: .8; }
.wp-html::after { content: ""; display: table; clear: both; }
.wp-html ul, .wp-html ol { margin: 0 0 .16rem; padding-left: .4rem; }
.wp-html li { margin-bottom: .06rem; }
.wp-html blockquote { margin: 0 0 .16rem; padding: .12rem .24rem; border-left: .06rem solid var(--accent); background: rgba(0, 130, 200, .07); border-radius: .08rem; }
.wp-html hr { border: none; border-top: 2px solid rgba(0, 0, 0, .12); margin: .24rem 0; }
.wp-html a { color: inherit; text-decoration: underline; }
.wp-html table { border-collapse: collapse; width: 100%; margin: 0 0 .16rem; font-size: .24rem; }
.wp-html th, .wp-html td { border: 1px solid rgba(0, 0, 0, .15); padding: .1rem .16rem; text-align: left; vertical-align: top; }
.wp-html th { background: rgba(0, 0, 0, .05); font-weight: 700; }

/* ---- Картинки в тексте, кнопка с новой строки ---- */
.wp-html img { max-width: 100%; height: auto; border-radius: .12rem; vertical-align: middle; }
.wp-html img[style*="float:left"] { margin: .04rem .28rem .16rem 0; }
.wp-html img[style*="float:right"] { margin: .04rem 0 .16rem .28rem; }
.wp-html img[style*="display:block"] { margin-top: .08rem; margin-bottom: .16rem; }
/* ---- Видео, карты и страницы (iframe) в тексте ---- */
.wp-html iframe { display: block; width: 100%; max-width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: .12rem; background: rgba(0, 0, 0, .06); margin: .08rem 0 .16rem; }
.wp-html iframe[style*="float:left"] { margin: .04rem .28rem .16rem 0; }
.wp-html iframe[style*="float:right"] { margin: .04rem 0 .16rem .28rem; }
.wp-html iframe[style*="margin-left:auto"] { margin-left: auto; margin-right: auto; }
.wp-break { flex-basis: 100%; height: 0; margin-bottom: -.2rem; } /* без двойного отступа */

/* ================= Модуль «Календарь» ================= */
.cal { display: flex; flex-direction: column; gap: .2rem; }
.cal-bar { display: flex; align-items: center; gap: .2rem; }
.cal-nav {
  width: .84rem; height: .84rem; flex-shrink: 0; border-radius: 50%; border: none;
  background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
}
.cal-nav svg { width: .4rem; height: .4rem; }
.cal-nav:active, .cal-today:active { transform: scale(.95); }
.cal-range { font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .36rem; min-width: 6rem; text-align: center; }
.cal-today {
  margin-left: auto; height: .72rem; padding: 0 .32rem; border-radius: .36rem; border: 2px solid var(--accent);
  background: #fff; color: var(--accent); font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .24rem;
}
.cal-months { display: grid; grid-template-columns: 1fr 1fr; gap: .24rem; touch-action: pan-y; }
.cal-month { background: #fff; border-radius: .32rem; padding: .24rem .32rem .28rem; }
.cal-month h2 { margin: 0 0 .1rem; font-size: .34rem; }
.cal-month h2 span { color: var(--muted-2); font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .06rem .08rem; }
.cal-wd { text-align: center; font-weight: 700; font-size: .2rem; color: var(--muted-2); padding: .04rem 0 .08rem; }
.cal-wd.is-weekend { color: #c0392b; }
.cal-day {
  position: relative; height: .6rem; border-radius: .14rem;
  display: flex; align-items: center; justify-content: center;
  font-family: Montserrat, Arial, sans-serif; font-weight: 600; font-size: .28rem;
  background: #f3f7fa; color: var(--ink);
}
.cal-day.is-empty { background: none; }
.cal-day.is-weekend { background: #fdecec; color: #b03a2e; }
.cal-day.is-holiday { background: #d64545; color: #fff; }
.cal-day.is-work { background: #f3f7fa; color: var(--ink); box-shadow: inset 0 0 0 2px #9fb3c4; }
.cal-day.is-short::after {
  content: ''; position: absolute; top: .08rem; right: .1rem;
  width: .12rem; height: .12rem; border-radius: 50%; background: #e59400;
}
.cal-day.is-today { outline: .05rem solid var(--accent); outline-offset: .02rem; }
.cal-notes { list-style: none; margin: .14rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .06rem; font-size: .21rem; color: var(--muted); }
.cal-notes li { padding-left: .26rem; position: relative; }
.cal-notes li::before { content: ''; position: absolute; left: 0; top: .08rem; width: .14rem; height: .14rem; border-radius: .04rem; }
.cal-notes .n-holiday::before { background: #d64545; }
.cal-notes .n-short::before { background: #e59400; border-radius: 50%; }
.cal-notes .n-work::before { background: #f3f7fa; box-shadow: inset 0 0 0 2px #9fb3c4; }
.cal-notes b { color: var(--ink); }
.cal-legend { display: flex; flex-wrap: wrap; gap: .12rem .32rem; font-size: .2rem; color: var(--muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: .1rem; }
.lg { display: inline-block; width: .26rem; height: .26rem; border-radius: .06rem; position: relative; }
.lg-weekend { background: #fdecec; box-shadow: inset 0 0 0 1px #f2c4c0; }
.lg-holiday { background: #d64545; }
.lg-short { background: #f3f7fa; }
.lg-short::after { content: ''; position: absolute; top: .03rem; right: .03rem; width: .09rem; height: .09rem; border-radius: 50%; background: #e59400; }
.lg-work { background: #f3f7fa; box-shadow: inset 0 0 0 2px #9fb3c4; }
.lg-today { background: #fff; box-shadow: inset 0 0 0 .04rem var(--accent); }
.cal-source { font-size: .18rem; color: #8b96a5; }
@media (orientation: portrait) {
  .cal-months { grid-template-columns: 1fr; }
  .cal-day { height: .74rem; font-size: .32rem; }
  .cal-range { flex: 1; min-width: 0; }
}

/* Календарь в горизонтальной ориентации: занимает всю высоту экрана под верхней панелью. */
@media (orientation: landscape) {
  body.module-calendar { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  .module-calendar .topbar { flex-shrink: 0; }
  .module-calendar .module-page { flex: 1 1 auto; min-height: 0; padding-bottom: .32rem; }
  .module-calendar .cal { height: 100%; gap: .18rem; }
  .module-calendar .cal-bar { flex-shrink: 0; }
  .module-calendar .cal-months { flex: 1 1 auto; min-height: 0; }
  .module-calendar .cal-month { display: flex; flex-direction: column; min-height: 0; padding: .24rem .32rem .26rem; }
  .module-calendar .cal-month h2 { font-size: .4rem; margin-bottom: .08rem; }
  .module-calendar .cal-grid {
    flex: 1 1 auto; min-height: 0;
    grid-template-rows: auto repeat(var(--weeks, 6), minmax(0, 1fr)); /* недели растягиваются на всю высоту */
    gap: .08rem;
  }
  .module-calendar .cal-wd { font-size: .24rem; padding: 0 0 .04rem; }
  .module-calendar .cal-day { height: auto; min-height: 0; font-size: .38rem; border-radius: .18rem; }
  .module-calendar .cal-day.is-short::after { width: .14rem; height: .14rem; top: .1rem; right: .12rem; }
  .module-calendar .cal-notes { flex-shrink: 0; font-size: .22rem; margin-top: .14rem; min-height: 1.04rem; } /* место под 3 строки: сетки обоих месяцев одной высоты */
  .module-calendar .cal-legend, .module-calendar .cal-source { flex-shrink: 0; }
  .module-calendar .cal-legend { font-size: .22rem; }
}

/* ================= Модуль «Оставить отзыв» ================= */

.rv { display: grid; grid-template-columns: 2fr 1fr; gap: .32rem; align-items: stretch; }
.rv.rv-no-qr { grid-template-columns: 1fr; }
.rv-form { display: flex; flex-direction: column; gap: .26rem; padding: .4rem .48rem; min-width: 0; }
.rv-head h2 { margin: 0 0 .06rem; font-size: .44rem; line-height: 1.15; }
.rv-head p { margin: 0; font-size: .24rem; color: var(--muted); }
.rv-field { display: flex; flex-direction: column; gap: .1rem; margin: 0; padding: 0; border: none; min-width: 0; }
.rv-label { padding: 0; font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .26rem; }
.rv-label small { font-family: 'PT Sans', Arial, sans-serif; font-weight: 400; font-size: .2rem; color: var(--muted-2); margin-left: .08rem; }
.rv-count { float: right; }
.rv-field input[type="text"], .rv-field textarea {
  width: 100%; border: 2px solid var(--line); border-radius: .18rem; background: #f7fbfe;
  font: inherit; font-size: .28rem; color: var(--ink); padding: .18rem .24rem;
  -webkit-user-select: text; user-select: text; outline: none;
  transition: border-color .15s, background .15s;
}
.rv-field input[type="text"] { height: .88rem; }
.rv-field textarea { flex: 1 1 auto; min-height: 2rem; resize: none; line-height: 1.4; }
.rv-field input[type="text"]:focus, .rv-field textarea:focus { border-color: var(--accent); background: #fff; }
.rv-field input::placeholder, .rv-field textarea::placeholder { color: #9aa6b4; }
.rv-grow { flex: 1 1 auto; min-height: 0; }
.rv-err { min-height: 0; font-size: .2rem; color: #c62828; }
.rv-err:empty { display: none; }
.has-error input[type="text"], .has-error textarea { border-color: #d64545; background: #fff6f6; }

.rv-stars { display: flex; align-items: center; gap: .14rem; }
.rv-star { position: relative; width: 1rem; height: 1rem; cursor: pointer; color: #d5dee7; transition: transform .1s, color .15s; }
.rv-star input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.rv-star svg { width: 100%; height: 100%; fill: currentColor; display: block; }
.rv-star.on { color: #f2b705; }
.rv-star:active { transform: scale(.9); }
.rv-star input:focus-visible + svg { outline: .03rem solid var(--accent); outline-offset: .04rem; border-radius: .1rem; }
.rv-rating-word { margin-left: .16rem; font-size: .28rem; color: var(--muted-2); }
.rv-rating-word.chosen { font-family: Montserrat, Arial, sans-serif; font-weight: 700; color: var(--ink); }
.rv-rating.has-error .rv-star { color: #f0c4c4; }

.rv-trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.rv-bottom { display: flex; align-items: center; gap: .3rem; }
.rv-msg { flex: 1; min-width: 0; font-size: .23rem; line-height: 1.3; }
.rv-msg.is-error { color: #c62828; }
.rv-submit { height: .9rem; min-width: 3.2rem; font-size: .3rem; border-radius: .22rem; }
.rv-submit:active { transform: scale(.97); }
.rv-submit:disabled { opacity: .6; }

.rv-side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; padding: .4rem; text-align: center; }
.rv-side-title { font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .36rem; }
.rv-qr { width: 3.6rem; max-width: 100%; aspect-ratio: 1; padding: .2rem; border: 2px solid var(--line); border-radius: .26rem; background: #fff; }
.rv-qr svg { width: 100%; height: 100%; display: block; }
.rv-side-text { margin: 0; font-size: .24rem; color: var(--muted); max-width: 4.4rem; }

.rv-done { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .22rem; padding: .8rem; text-align: center; }
.rv-done-ic { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: #e3f4e8; color: #1f9d55; display: flex; align-items: center; justify-content: center; }
.rv-done-ic svg { width: .9rem; height: .9rem; }
.rv-done h2 { margin: 0; font-size: .56rem; }
.rv-done p { margin: 0 0 .2rem; font-size: .3rem; color: var(--muted); }
.rv.is-done .rv-form, .rv.is-done .rv-side { display: none; }

/* Горизонтально: форма и QR на всю высоту экрана под верхней панелью. */
@media (orientation: landscape) {
  body.module-review { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
  .module-review .module-page { flex: 1 1 auto; display: flex; flex-direction: column; padding-bottom: .4rem; }
  .module-review .rv { flex: 1 1 auto; }
}
/* Вертикально: форма сверху, под ней карточка QR в строку. */
@media (orientation: portrait) {
  body.module-review { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
  .module-review .module-page { flex: 1 1 auto; display: flex; flex-direction: column; }
  .rv { grid-template-columns: 1fr; grid-template-rows: 1fr auto; flex: 1 1 auto; }
  .rv-form { padding: .44rem .44rem .4rem; }
  .rv-star { width: 1.06rem; height: 1.06rem; }
  .rv-side {
    display: grid; grid-template-columns: auto 1fr; grid-template-rows: 1fr 1fr;
    column-gap: .4rem; row-gap: .12rem; padding: .32rem .4rem; text-align: left; justify-items: start;
  }
  .rv-side .rv-qr { grid-row: 1 / 3; grid-column: 1; width: 2.6rem; padding: .14rem; }
  .rv-side-title { grid-column: 2; align-self: end; font-size: .34rem; }
  .rv-side-text { grid-column: 2; align-self: start; max-width: none; font-size: .26rem; }
}

/* ================= Модуль «О клиниках» ================= */

/* ---- Список клиник ---- */
.net-lead { margin: 0 0 .24rem; font-size: .24rem; color: var(--muted); }
.net-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .28rem; }
.net-tile {
  display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: var(--ink);
  box-shadow: 0 .04rem .16rem rgba(20, 50, 74, .08); transition: transform .12s, box-shadow .12s;
  border: .03rem solid transparent;
}
.net-tile:active { transform: scale(.97); box-shadow: 0 .02rem .06rem rgba(20, 50, 74, .08); }
.net-tile.is-here { border-color: var(--accent); }
.net-tile-photo {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 2.2rem; background: var(--light-tile) center / cover no-repeat; color: var(--light-ic);
}
.net-tile-ph svg { width: .9rem; height: .9rem; opacity: .7; }
.net-chip {
  display: inline-flex; align-items: center; gap: .06rem;
  height: .5rem; padding: 0 .18rem 0 .12rem; border-radius: .25rem;
  background: #fff; color: var(--ink); font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .22rem;
  box-shadow: 0 .02rem .1rem rgba(20, 50, 74, .18);
}
.net-chip svg { width: .28rem; height: .28rem; color: var(--accent); }
.net-tile-photo .net-chip { position: absolute; top: .18rem; left: .18rem; }
.net-chip-here { background: var(--accent); color: #fff; }
.net-chip-here svg { color: #fff; }
.net-tile-body { flex: 1; display: flex; flex-direction: column; gap: .08rem; padding: .24rem .28rem .22rem; }
.net-tile-name { font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .3rem; line-height: 1.2; }
.net-tile-addr { font-size: .22rem; color: var(--muted); line-height: 1.3; }
.net-tile-foot { margin-top: auto; padding-top: .16rem; display: flex; align-items: center; justify-content: space-between; gap: .12rem; }
.net-tile-hours { display: inline-flex; align-items: center; gap: .08rem; font-size: .2rem; color: var(--muted-2); }
.net-tile-hours svg { width: .26rem; height: .26rem; flex-shrink: 0; }
.net-tile-more {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: .02rem;
  height: .56rem; padding: 0 .12rem 0 .22rem; border-radius: .28rem;
  background: var(--light-tile); color: var(--light-ic);
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .2rem;
}
.net-tile-more svg { width: .3rem; height: .3rem; }
.net-tile.is-here .net-tile-more { background: var(--accent); color: #fff; }

/* ---- Страница клиники ---- */
.netd { display: flex; flex-direction: column; gap: .28rem; }
.netd-head { display: grid; grid-template-columns: minmax(0, 1fr) 6rem; gap: .4rem; padding: .4rem .44rem; align-items: start; }
.netd-head.no-photo { grid-template-columns: 1fr; }
.netd-title { display: flex; align-items: center; gap: .2rem; flex-wrap: wrap; }
.netd-title h2 { margin: 0; font-size: .5rem; line-height: 1.1; }
.netd-open {
  display: inline-flex; align-items: center; gap: .14rem; margin-top: .16rem;
  font-size: .26rem; font-weight: 700; color: #b23a3a;
}
.netd-open::before { content: ''; flex-shrink: 0; width: .18rem; height: .18rem; border-radius: 50%; background: currentColor; }
.netd-open.is-open { color: #1f8a4c; }
/* «Открыто»: маркер плавно мигает зелёным. */
.netd-open.is-open::before { background: #22b35e; animation: netd-pulse 1.8s ease-in-out infinite; }
@keyframes netd-pulse {
  0%   { opacity: 1;   box-shadow: 0 0 0 0 rgba(34, 179, 94, .55); }
  50%  { opacity: .35; box-shadow: 0 0 0 .12rem rgba(34, 179, 94, 0); }
  100% { opacity: 1;   box-shadow: 0 0 0 0 rgba(34, 179, 94, 0); }
}
.netd-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: .36rem; margin-top: .28rem; }
.netd-facts { margin: 0; display: flex; flex-direction: column; gap: .22rem; }
.netd-facts dt, .netd-hours-title {
  display: flex; align-items: center; gap: .1rem; margin-bottom: .06rem;
  font-size: .22rem; color: var(--muted-2); text-transform: uppercase; letter-spacing: .01rem;
}
.netd-facts dt svg, .netd-hours-title svg { width: .3rem; height: .3rem; color: var(--accent); }
/* Все значения блока — адрес, расстояние, GPS, часы — одним размером .26rem. */
.netd-facts dd { margin: 0 0 0 .4rem; font-size: .26rem; line-height: 1.35; }
.netd-facts dd span { color: var(--muted); }
.netd-gps { font-variant-numeric: tabular-nums; }
.netd-hours ul { list-style: none; margin: .06rem 0 0; padding: 0; }
.netd-hours ul { margin-left: .26rem; }
.netd-hours li { display: flex; justify-content: space-between; gap: .2rem; padding: .06rem .14rem; border-radius: .12rem; font-size: .26rem; line-height: 1.35; }
.netd-hours li b { font-weight: 400; font-variant-numeric: tabular-nums; }
.netd-hours li.is-today b { font-weight: 700; }
.netd-hours li.is-today { background: var(--light-tile); color: var(--light-ic); font-weight: 700; }
.netd-photo {
  position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: none;
  border-radius: .26rem; overflow: hidden; background: var(--light-tile);
}
.netd-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.netd-zoom {
  position: absolute; right: .16rem; bottom: .16rem; width: .72rem; height: .72rem; border-radius: 50%;
  background: rgba(255, 255, 255, .92); color: var(--ink); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 .02rem .1rem rgba(0, 0, 0, .2);
}
.netd-zoom svg { width: .38rem; height: .38rem; }
.netd-photo:active, .netd-gal button:active { transform: scale(.98); }

.netd-text { padding: .34rem .44rem; font-size: .26rem; line-height: 1.5; }
.netd-text p { margin: 0 0 .14rem; }
.netd-text p:last-child { margin-bottom: 0; }
.netd-block { padding: .34rem .44rem .4rem; }
.netd-block h3 { margin: 0 0 .24rem; font-family: Montserrat, Arial, sans-serif; font-size: .34rem; }
/* «Как добраться»: Яндекс карта (ширина и высота — из настроек) и текст под ней */
.netd-map { position: relative; max-width: 100%; margin: 0 auto; border-radius: .16rem; overflow: hidden; background: var(--ground); }
.netd-map iframe { display: block; width: 100%; height: 100%; border: 0; }
.netd-map-cover { position: absolute; inset: 0; } /* карта только для просмотра: нажатия не доходят до карты и её ссылок */
.netd-route-text { margin-top: .24rem; font-size: .26rem; line-height: 1.5; }
.netd-route-text p { margin: 0 0 .14rem; }
.netd-route-text p:last-child { margin-bottom: 0; }
.netd-map + .netd-route-text { margin-top: .28rem; }
.netd-count { font-family: 'PT Sans', Arial, sans-serif; font-weight: 400; font-size: .22rem; color: var(--muted-2); margin-left: .1rem; }
.netd-amen { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .18rem .4rem; }
.netd-amen li { display: flex; align-items: center; gap: .2rem; font-size: .26rem; line-height: 1.3; }
.netd-amen-ic {
  flex-shrink: 0; width: .7rem; height: .7rem; border-radius: .2rem; background: var(--light-tile); color: var(--light-ic);
  display: flex; align-items: center; justify-content: center;
}
.netd-amen-ic svg { width: .4rem; height: .4rem; }
.netd-gal { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .16rem; }
.netd-gal button { padding: 0; border: none; border-radius: .18rem; overflow: hidden; aspect-ratio: 4 / 3; background: var(--light-tile); }
.netd-gal img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Галерея в модальном окне ---- */
.gal-modal { background: rgba(10, 20, 30, .92); }
.gal-stage { display: flex; align-items: center; justify-content: center; max-width: 84vw; max-height: 80vh; touch-action: pan-y; }
.gal-stage img { max-width: 84vw; max-height: 80vh; object-fit: contain; border-radius: .12rem; -webkit-user-drag: none; }
.gal-btn {
  position: fixed; top: 50%; transform: translateY(-50%);
  width: 1rem; height: 1rem; border-radius: 50%; border: none;
  background: rgba(255, 255, 255, .92); color: var(--ink); display: flex; align-items: center; justify-content: center;
}
.gal-btn svg { width: .5rem; height: .5rem; }
.gal-btn:active { transform: translateY(-50%) scale(.92); }
.gal-prev { left: .3rem; }
.gal-next { right: .3rem; }
.gal-counter {
  position: fixed; bottom: .3rem; left: 50%; transform: translateX(-50%);
  padding: .08rem .26rem; border-radius: .3rem; background: rgba(255, 255, 255, .92);
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .24rem;
}

@media (orientation: portrait) {
  .net-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .netd-head { grid-template-columns: minmax(0, 1fr) 3.8rem; gap: .3rem; }
  .netd-cols { grid-template-columns: 1fr; gap: .28rem; }
  .netd-photo { aspect-ratio: 1; }
  .netd-gal { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gal-stage, .gal-stage img { max-width: 94vw; }
  .gal-btn { top: auto; bottom: .3rem; transform: none; }
  .gal-btn:active { transform: scale(.92); }
}

/* ================= Главный экран: карточка приложения рядом с отзывом ================= */

.app-card {
  flex: 1 1 0; min-height: 0; padding: .22rem .26rem;
  display: flex; flex-direction: column; gap: .12rem;
  background: var(--accent); color: #fff;
}
.app-head { display: flex; align-items: center; gap: .14rem; min-width: 0; }
.app-ic { width: .56rem; height: .56rem; flex-shrink: 0; border-radius: .16rem; background: #fff; color: var(--accent); display: flex; align-items: center; justify-content: center; }
.app-ic svg { width: .34rem; height: .34rem; }
.app-titles { display: flex; flex-direction: column; gap: .02rem; min-width: 0; }
.app-title { font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .24rem; line-height: 1.15; }
.app-text { font-size: .19rem; line-height: 1.3; color: rgba(255, 255, 255, .88); }
.app-row { flex: 1; min-height: 0; display: flex; align-items: center; gap: .16rem; }
.app-qr { width: 1.5rem; height: 1.5rem; flex-shrink: 0; padding: .1rem; border-radius: .2rem; background: #fff; }
.app-side { display: flex; flex-direction: column; align-items: flex-start; gap: .14rem; min-width: 0; }
.app-cap { font-size: .19rem; line-height: 1.3; color: rgba(255, 255, 255, .88); }
.app-more {
  display: inline-flex; align-items: center; gap: .04rem; height: .52rem; padding: 0 .1rem 0 .18rem; border-radius: .26rem;
  background: #fff; color: var(--accent); text-decoration: none;
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .19rem;
}
.app-more svg { width: .26rem; height: .26rem; }
.app-more:active { transform: scale(.96); }

/* Отзыв становится компактнее, когда под ним карточка приложения. */
.has-app .review { flex: 1.1 1 0; gap: .1rem; padding: .22rem .28rem; }
.has-app .review-title { font-size: .26rem; }
.has-app .review-stars svg { width: .28rem; height: .28rem; }
.has-app .review-qr { width: 1.75rem; height: 1.75rem; padding: .1rem; }
.has-app .review-cap { font-size: .19rem; }
.has-app .review-or { display: none; }
.has-app .review-btn { height: .58rem; flex-shrink: 0; font-size: .21rem; }

@media (orientation: portrait) {
  /* Вертикально: отзыв | приложение | компактный Wi-Fi в одну строку. */
  .has-app .review, .has-app .app-card {
    flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: .1rem; padding: .2rem .24rem;
  }
  .has-app .review-stars, .has-app .review-cap, .has-app .app-ic, .has-app .app-text, .has-app .app-cap { display: none; }
  .has-app .review-qr, .has-app .app-qr { width: 1.62rem; height: 1.62rem; padding: .08rem; }
  .has-app .review-title, .has-app .app-title { font-size: .24rem; }
  .has-app .review-btn { width: 100%; height: .56rem; font-size: .19rem; }
  .has-app .app-row { flex: 0 0 auto; flex-direction: column; gap: .1rem; width: 100%; }
  .has-app .app-side { width: 100%; align-items: stretch; }
  .has-app .app-more { justify-content: center; height: .56rem; }
  .has-app .wifi {
    flex: 0 0 1.7rem; padding: .22rem .16rem;
    flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .12rem;
  }
  .has-app .wifi-text { align-items: center; }
  .has-app .wifi-ssid { display: none; }
  .has-app .wifi-title { font-size: .22rem; }
  .has-app .wifi-hint { font-size: .18rem; }
}

/* ---- Карточка отзыва на жёлтом фоне ---- */
.review { background: #ffd23f; color: var(--ink); }
.review-stars { color: var(--night); }
.review-qr { background: #fff; border-color: #fff; }
.review-cap { color: #4a3d00; }
.review-or { color: #6b5a00; }
.review-or span { background: rgba(29, 43, 58, .25); }
.review-btn { background: var(--night); }
.app-scan { display: none; }

/* ================= Крупный интерфейс (120%) для планшетов 10–11" =================
 * Включается в карточке клиники («Размер интерфейса»). Всё увеличивается на 20 %,
 * на главном экране 6 плиток на странице, приветствие в 2 строки, правая колонка компактнее.
 */
html.ui-120 { font-size: calc(min(5.2083vw, 9.2593vh) * 1.2); }
@media (orientation: portrait) {
  html.ui-120 { font-size: calc(min(9.2593vw, 5.2083vh) * 1.2); }
}
@media (orientation: landscape) {
  .ui-120 .home {
    padding: .3rem .36rem; gap: .18rem;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) 3.7rem;
    grid-template-rows: .72rem 1.7rem minmax(0, 1fr);
  }
  .ui-120 .no-side .home { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .ui-120 .welcome { padding: .22rem .32rem; gap: .06rem; }
  .ui-120 .welcome h1 { font-size: .4rem; }
  .ui-120 .welcome p { font-size: .22rem; -webkit-line-clamp: 2; }
  .ui-120 .clock-card { padding: .2rem .32rem; }
  .ui-120 .clock-card .clock-time { font-size: .66rem; }
  .ui-120 .clock-card .clock-date { font-size: .24rem; }
  .ui-120 .tiles-head h2 { font-size: .28rem; }
  .ui-120 .tiles-page { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ui-120 .no-side .tiles-page { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ui-120 .tile { padding: .22rem .24rem; }
  .ui-120 .tile-ic { width: .5rem; height: .5rem; }
  .ui-120 .tile-title { font-size: .27rem; -webkit-line-clamp: 2; }
  .ui-120 .tile-sub { font-size: .19rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .ui-120 .pager { height: .66rem; }
  .ui-120 .pager-prev { width: .66rem; height: .66rem; }
  .ui-120 .pager-next { height: .66rem; margin-left: auto; }
  .ui-120 .pager-hint { display: none; }

  .ui-120 .has-app .review { gap: .1rem; padding: .18rem .22rem; }
  .ui-120 .has-app .review-stars, .ui-120 .has-app .review-cap { display: none; }
  .ui-120 .has-app .review-qr { width: 1.5rem; height: 1.5rem; padding: .08rem; }
  .ui-120 .has-app .review-title { font-size: .24rem; }
  .ui-120 .has-app .review-btn { height: .54rem; font-size: .2rem; }
  .ui-120 .app-card { padding: .18rem .22rem; gap: .08rem; }
  .ui-120 .app-title { font-size: .22rem; }
  .ui-120 .app-text, .ui-120 .app-cap { display: none; }
  .ui-120 .app-qr { width: 1.3rem; height: 1.3rem; }
  .ui-120 .app-side { gap: .1rem; }
  .ui-120 .app-scan { display: flex; align-items: center; gap: .06rem; font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .22rem; white-space: nowrap; }
  .ui-120 .app-scan svg { width: .28rem; height: .28rem; flex-shrink: 0; }
  .ui-120 .wifi { padding: .16rem .2rem; }
  .ui-120 .wifi-ssid { display: none; }
}

/* ================= Модуль «Email»: адрес почты со своей клавиатурой ================= */

.module-page .em { padding: 0 .48rem .4rem; }
.em { display: flex; flex-direction: column; gap: .2rem; }
.em-card { position: relative; padding: .3rem .44rem; display: flex; flex-direction: column; gap: .16rem; }
.em-head h2 { margin: 0; font-size: .4rem; line-height: 1.15; padding-right: .9rem; }
.em-head p { margin: .06rem 0 0; font-size: .23rem; color: var(--muted); }
.em-close {
  position: absolute; top: .22rem; right: .26rem;
  width: .76rem; height: .76rem; border-radius: 50%; border: none;
  background: var(--ground); color: var(--ink); font-size: .32rem; line-height: 1;
}
.em-row { display: flex; gap: .2rem; align-items: stretch; }
.em-input {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: .14rem;
  height: .96rem; padding: 0 .26rem;
  border: 3px solid var(--accent); border-radius: .2rem; background: #fff;
  font-size: .36rem; font-family: 'PT Sans', Arial, sans-serif;
}
.em-input > svg { width: .4rem; height: .4rem; color: var(--accent); flex-shrink: 0; }
.em-value { flex: 1; min-width: 0; display: flex; align-items: center; overflow: hidden; white-space: nowrap; direction: ltr; }
.em-text { overflow: hidden; text-overflow: clip; }
.em-caret { flex-shrink: 0; width: 2px; height: .44rem; margin-left: 2px; background: var(--ink); animation: em-blink 1s steps(1) infinite; }
@keyframes em-blink { 50% { opacity: 0; } }
.em-ph { color: #9aa6b2; }
.em-ok { margin-left: auto; flex-shrink: 0; display: flex; align-items: center; gap: .06rem; color: #2e9d5b; font-size: .22rem; font-weight: 700; white-space: nowrap; }
.em-ok svg { width: .3rem; height: .3rem; }
.em-input.is-ok { border-color: #2e9d5b; }
.em-input.is-ok > svg { color: #2e9d5b; }
.em-input.is-error { border-color: #d64545; }
.em-send {
  flex-shrink: 0; height: .96rem; min-width: 2.9rem; padding: 0 .3rem;
  border: none; border-radius: .2rem; background: var(--accent); color: #fff;
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .3rem;
}
.em-send:disabled { background: #b9cfdf; }
.em-send:active, .em-key:active, .em-close:active { transform: scale(.96); }
.em-consent:active .em-box { transform: scale(.92); }
.em-hint { min-height: .3rem; font-size: .22rem; line-height: 1.3; }
.em-hint:empty { display: none; }
.em-hint.is-error { color: #c03030; font-weight: 700; }
.em-hint.is-warn { color: #a15c00; }
.em-hint button {
  margin: 0 .04rem; padding: .04rem .14rem; border: none; border-radius: .12rem;
  background: #fff1d6; color: #7a4600; font-weight: 700; text-decoration: underline;
}
.em-consent {
  display: flex; align-items: center; gap: .16rem; padding: .06rem 0;
  border: none; background: none; text-align: left;
  font-size: .21rem; line-height: 1.3; color: var(--muted);
}
.em-box {
  width: .46rem; height: .46rem; flex-shrink: 0; border-radius: .1rem;
  border: 3px solid #9fb3c4; background: #fff; color: transparent;
  display: flex; align-items: center; justify-content: center;
}
.em-box svg { width: .3rem; height: .3rem; }
.em-consent.on .em-box { background: var(--accent); border-color: var(--accent); color: #fff; }

.em-kb { padding: .18rem; display: flex; flex-direction: column; gap: .1rem; background: #dfe7ee; }
.em-kb-row { display: flex; gap: .1rem; justify-content: center; }
.em-key {
  flex: 1; max-width: 1.1rem; height: .7rem; padding: 0;
  border: none; border-radius: .14rem; background: #fff; color: var(--ink);
  box-shadow: 0 2px 0 #c4d0db;
  display: flex; align-items: center; justify-content: center;
  font-family: 'PT Sans', Arial, sans-serif; font-size: .32rem;
}
.em-key svg { width: .38rem; height: .38rem; }
.em-key-fn { background: #c9d6e2; }
.em-key-wide {
  max-width: none; flex: 1 1 1.4rem; padding: 0 .1rem; white-space: nowrap;
  background: var(--light-tile); color: var(--light-ic);
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .22rem;
}
.em-key-wide.em-key-fn { background: #c9d6e2; color: var(--ink); }

.em-done { padding: .6rem; display: flex; flex-direction: column; align-items: center; gap: .22rem; text-align: center; }
.em-done-ic {
  width: 1.4rem; height: 1.4rem; border-radius: 50%;
  background: #e3f4ea; color: #2e9d5b; display: flex; align-items: center; justify-content: center;
}
.em-done-ic svg { width: .8rem; height: .8rem; }
.em-done h2 { margin: 0; font-size: .44rem; line-height: 1.2; }
.em-done p { margin: 0; max-width: 9rem; font-size: .26rem; color: var(--muted); word-break: break-word; }
.em-done p b { color: var(--ink); }
.em-done .em-done-btn { margin-top: .16rem; background: #fff; color: var(--ink); border: 2px solid var(--line); }

.em-off { padding: .8rem; text-align: center; }
.em-off h2 { margin: 0 0 .14rem; font-size: .4rem; }
.em-off p { margin: 0; font-size: .26rem; color: var(--muted); }

/* Окно запроса от администратора: поверх любой страницы. */
.em-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: stretch; justify-content: center;
  background: rgba(16, 32, 48, .72); animation: fade .2s ease;
}
.em-overlay-box { width: 100%; max-width: 15rem; padding: .3rem .4rem; display: flex; flex-direction: column; gap: .16rem; overflow-y: auto; }
.em-overlay-title {
  align-self: flex-start; display: flex; align-items: center; gap: .14rem;
  padding: .14rem .3rem; border-radius: .3rem; background: #fff3c4; color: #5c4300;
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .26rem;
}
.em-overlay-title svg { width: .34rem; height: .34rem; }
.em-overlay .em { padding: 0; }

@media (orientation: portrait) {
  .em-row { flex-direction: column; }
  .em-input { flex: none; }
  .em-send { width: 100%; }
  .em-key { height: 1rem; font-size: .38rem; }
  .em-key-wide { flex-basis: 2rem; height: .86rem; font-size: .25rem; }
  .em-kb-row:last-child { flex-wrap: wrap; }
  .em-overlay-box { padding-top: .6rem; }
}

/* Привязка планшета к инфокиоску */
.bind { display: flex; flex-direction: column; align-items: center; gap: .24rem; padding: .2rem .48rem .3rem; text-align: center; }
.bind-card { width: 100%; max-width: 7.4rem; padding: .3rem .44rem; display: flex; flex-direction: column; align-items: center; gap: .14rem; }
.bind-card h2 { margin: 0; font-size: .34rem; }
.bind-card p { margin: 0; font-size: .23rem; color: var(--muted); }
.bind-code { display: flex; gap: .14rem; }
.bind-code span {
  width: .84rem; height: 1rem; border-radius: .16rem; border: 3px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: Montserrat, Arial, sans-serif; font-weight: 800; font-size: .5rem;
}
.bind-code span.on { border-color: var(--accent); }
.bind-pad { display: grid; grid-template-columns: repeat(3, 1.6rem); gap: .14rem; }
.bind-pad button {
  height: .8rem; border: none; border-radius: .16rem; background: var(--ground);
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .4rem;
}
.bind-pad button:active { transform: scale(.95); }
.bind-pad .bind-fn { font-size: .22rem; }
.bind-msg { min-height: .32rem; font-size: .24rem; font-weight: 700; }
.bind-msg.is-error { color: #c03030; }
.bind-msg.is-ok { color: #2e9d5b; }
.bind-current { font-size: .24rem; }
.bind-card .bind-uid { font-size: .21rem; color: var(--muted-2); }
.bind-uid b { font-family: Montserrat, Arial, sans-serif; color: var(--ink); letter-spacing: .03em; }
.picker-bind { margin-top: .3rem; font-size: .22rem; color: var(--muted-2); }

/* ---- Видеозаставка (по бездействию, поверх всего, кроме запроса администратора) ---- */
.saver { position: fixed; inset: 0; z-index: 150; background: #000; opacity: 0; transition: opacity .6s ease; cursor: none; touch-action: none; }
.saver.on { opacity: 1; }
.saver-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.saver-hint {
  position: absolute; left: 50%; bottom: .4rem; transform: translateX(-50%);
  padding: .14rem .36rem; border-radius: 1rem; background: rgba(0, 0, 0, .45); color: rgba(255, 255, 255, .92);
  font: 600 .22rem/1.2 Montserrat, Arial, sans-serif; letter-spacing: .01em; white-space: nowrap;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: saver-hint 4s ease-in-out infinite;
}
@keyframes saver-hint { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
/* Заставка-смайлик (saver-face.js) */
.saver-face-light { background: #fff7fb; }
.face-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.face-bubble {
  position: absolute; left: 50%; bottom: 6vh; transform: translate(-50%, 14px) scale(.9);
  font: 800 clamp(20px, 3.8vmin, 40px)/1.15 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #2a2140; background: #fff; border: 4px solid #2a2140; border-radius: 999px; padding: .45em 1.1em;
  white-space: nowrap; opacity: 0; pointer-events: none; box-shadow: 0 8px 0 rgba(42,33,64,.12);
  transition: opacity .35s, transform .35s cubic-bezier(.3,1.6,.5,1);
}
.face-bubble.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.saver-heart { background: #03050b; touch-action: none; }
.heart-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.heart-msg {
  position: absolute; left: 4vw; right: 4vw; bottom: 8vh; text-align: center; pointer-events: none;
  font: 700 clamp(22px, 4.2vmin, 46px)/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #fff; text-shadow: 0 0 14px rgba(255,120,170,.9), 0 0 36px rgba(255,80,140,.6);
  opacity: 0; transform: translateY(16px); transition: opacity .7s, transform .7s;
}
.heart-msg small { display: block; margin-top: .5em; font-weight: 400; font-size: .62em; color: rgba(255,220,235,.9); text-shadow: none; }
.heart-msg.on { opacity: 1; transform: none; }
.heart-hint {
  position: absolute; left: 50%; bottom: 4vh; transform: translateX(-50%); white-space: nowrap; pointer-events: none;
  font: 400 clamp(14px, 2.2vmin, 22px) system-ui, sans-serif; color: rgba(255,210,230,.55); transition: opacity .6s;
}
.saver-tooth .heart-msg { text-shadow: 0 0 14px rgba(120,190,255,.9), 0 0 36px rgba(60,150,255,.6); }
.saver-tooth .heart-msg small { color: rgba(215,235,255,.9); }
.saver-tooth .heart-hint { color: rgba(190,225,255,.55); }
.saver-face-dark .face-bubble {
  color: #fff; background: #0b0a14; border-color: #f3ecff;
  box-shadow: 0 0 18px rgba(150,190,255,.45), inset 0 0 12px rgba(150,190,255,.2);
}

/* ================= Анкеты ================= */

.sv { display: flex; flex-direction: column; gap: .2rem; padding-bottom: .2rem; }
.sv-head { position: relative; padding: .28rem .44rem; display: flex; flex-direction: column; gap: .12rem; }
.sv-head h2 { margin: 0; font-size: .4rem; line-height: 1.15; padding-right: .9rem; }
.sv-patient { font-size: .24rem; color: var(--muted); }
.sv-patient b { color: var(--ink); }
.sv-steps { display: flex; flex-direction: column; gap: .12rem; margin-top: .04rem; }
.sv-progress { height: .08rem; border-radius: .04rem; background: var(--ground); overflow: hidden; }
.sv-progress i { display: block; height: 100%; background: var(--accent); border-radius: .04rem; transition: width .25s; }
.sv-chips { display: flex; gap: .1rem; overflow-x: auto; scrollbar-width: none; }
.sv-chips::-webkit-scrollbar { display: none; }
.sv-chip {
  flex-shrink: 0; display: flex; align-items: center; gap: .1rem; height: .62rem; max-width: 4rem; padding: 0 .22rem 0 .1rem;
  border: 2px solid var(--line); border-radius: .31rem; background: #fff; color: var(--muted);
  font-size: .21rem; white-space: nowrap;
}
.sv-chip span { overflow: hidden; text-overflow: ellipsis; }
.sv-chip b {
  width: .42rem; height: .42rem; flex-shrink: 0; border-radius: 50%; background: var(--ground); color: var(--ink);
  display: flex; align-items: center; justify-content: center; font-family: Montserrat, Arial, sans-serif; font-size: .2rem;
}
.sv-chip.seen { color: var(--ink); }
.sv-chip.on { border-color: var(--accent); color: var(--ink); font-weight: 700; }
.sv-chip.on b { background: var(--accent); color: #fff; }
.sv-chip.bad b { background: #d64545; color: #fff; }
.sv-chip:disabled { opacity: .5; }

.sv-page { padding: .32rem .44rem .4rem; display: flex; flex-direction: column; gap: .3rem; }
.sv-page-title { margin: 0; font-size: .34rem; line-height: 1.2; }
.sv-text { font-size: .25rem; line-height: 1.45; color: var(--ink); }
.sv-text > :first-child { margin-top: 0; }
.sv-text > :last-child { margin-bottom: 0; }
.sv-text h3 { font-size: .3rem; margin: .16rem 0 .08rem; }
.sv-text img { max-width: 100%; height: auto; }
.sv-text table { border-collapse: collapse; }
.sv-text td, .sv-text th { border: 1px solid var(--line); padding: .06rem .12rem; }

.sv-q { display: flex; flex-direction: column; gap: .14rem; padding: .04rem 0 0; scroll-margin-top: .3rem; }
.sv-q h3 { margin: 0; font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .29rem; line-height: 1.25; }
.sv-q h3 i { color: #d64545; font-style: normal; margin-left: .06rem; }
.sv-num { color: var(--accent); }
.sv-hint { margin: -.06rem 0 0; font-size: .21rem; color: var(--muted-2); }
.sv-opts { display: flex; flex-wrap: wrap; gap: .14rem; }
.sv-opt {
  display: flex; align-items: center; gap: .16rem; min-height: .84rem; min-width: 2.4rem; max-width: 100%; padding: .12rem .3rem .12rem .2rem;
  border: 3px solid var(--line); border-radius: .2rem; background: #fff; color: var(--ink);
  font-size: .26rem; line-height: 1.25; text-align: left;
}
.sv-opt:active, .sv-btn:active, .sv-key:active, .sv-chip:active { transform: scale(.97); }
.sv-opt.on { border-color: var(--accent); background: #eef6fc; font-weight: 700; }
.sv-mark {
  width: .44rem; height: .44rem; flex-shrink: 0; border: 3px solid #9fb3c4; background: #fff; color: transparent;
  display: flex; align-items: center; justify-content: center;
}
.sv-mark.rd { border-radius: 50%; }
.sv-mark.sq { border-radius: .1rem; }
.sv-mark svg { width: .28rem; height: .28rem; }
.sv-opt.on .sv-mark { background: var(--accent); border-color: var(--accent); color: #fff; }
.sv-other { padding-left: .2rem; border-left: 4px solid var(--accent); }

.sv-field {
  display: flex; align-items: center; gap: .14rem; min-height: .9rem; padding: .14rem .26rem;
  border: 3px solid #b9cbd9; border-radius: .2rem; background: #fff; font-size: .3rem; line-height: 1.3; cursor: text;
}
.sv-field svg { width: .38rem; height: .38rem; color: var(--accent); flex-shrink: 0; }
.sv-field-area { align-items: flex-start; min-height: 1.8rem; white-space: pre-wrap; }
.sv-field-text { flex: 1; min-width: 0; word-break: break-word; }
.sv-field.is-empty .sv-field-text { color: #9aa6b2; font-size: .25rem; }
.sv-field.is-active { border-color: var(--accent); box-shadow: 0 0 0 .05rem rgba(0, 130, 200, .2); }
.sv-q.is-error .sv-field, .sv-q.is-error .sv-opt:not(.on), .sv-q.is-error .sv-sign { border-color: #e08a8a; }
.sv-err { font-size: .22rem; font-weight: 700; color: #c03030; }

.sv-sign {
  position: relative; height: min(4.6rem, 44vh); width: 100%; border: 3px dashed #9fb3c4; border-radius: .2rem; background: #fbfdff;
  touch-action: none; overflow: hidden;
}
.sv-sign-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
.sv-sign-ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .14rem;
  color: #9aa6b2; font-size: .26rem; pointer-events: none;
}
.sv-sign-ph svg { width: .5rem; height: .5rem; }
.sv-sign-ph span { font-size: .3rem; }
@media (orientation: portrait) { .sv-sign { height: min(6rem, 40vh); } }
.sv-sign-line { position: absolute; left: .5rem; right: .5rem; bottom: 1rem; border-bottom: 2px solid #d3dee7; pointer-events: none; }
.sv-sign-clear {
  position: absolute; top: .12rem; right: .12rem; z-index: 2; height: .56rem; padding: 0 .24rem;
  border: none; border-radius: .28rem; background: var(--ground); font-size: .21rem; font-weight: 700;
}

.sv-nav {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; gap: .2rem;
  padding: .16rem 0; background: var(--ground);
}
.em-overlay .sv-nav { background: #2b4054; border-radius: .24rem; padding: .14rem; box-shadow: 0 -.04rem .2rem rgba(0, 0, 0, .25); }
.sv-nav-msg { flex: 1; text-align: center; font-size: .23rem; color: var(--muted); }
.em-overlay .sv-nav-msg { color: #fff; }
.sv-nav-msg.is-error { color: #c03030; font-weight: 700; }
.em-overlay .sv-nav-msg.is-error { color: #ffd2d2; }
.sv-btn {
  height: .9rem; min-width: 2.6rem; padding: 0 .36rem; border: none; border-radius: .2rem;
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .28rem;
}
.sv-btn-back { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.sv-btn-next { background: var(--accent); color: #fff; }
.sv-btn-next.is-send { background: #2e9d5b; }
.sv-btn:disabled { opacity: .6; }
.sv-btn-danger { background: #d64545; color: #fff; }
.sv-loading { padding: .6rem; text-align: center; font-size: .28rem; color: var(--muted); }

.sv-confirm { position: fixed; inset: 0; z-index: 300; background: rgba(16, 32, 48, .6); display: flex; align-items: center; justify-content: center; }
.sv-confirm-box { width: 8.4rem; max-width: 92vw; padding: .44rem; display: flex; flex-direction: column; gap: .16rem; }
.sv-confirm-box h3 { margin: 0; font-family: Montserrat, Arial, sans-serif; font-size: .36rem; }
.sv-confirm-box p { margin: 0; font-size: .25rem; color: var(--muted); }
.sv-confirm-btns { display: flex; gap: .16rem; justify-content: flex-end; margin-top: .12rem; flex-wrap: wrap; }

/* Клавиатура анкеты: шторка снизу экрана. */
.sv-kb {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 260;
  background: #dfe7ee; box-shadow: 0 -.06rem .3rem rgba(16, 32, 48, .25);
  padding: .16rem .3rem .22rem; display: flex; flex-direction: column; gap: .12rem;
  animation: sv-up .18s ease;
}
@keyframes sv-up { from { transform: translateY(100%); } }
.sv-kb-top { max-width: 15rem; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: .06rem; }
.sv-kb-label { font-size: .2rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-kb-field {
  display: flex; align-items: flex-end; min-height: .76rem; max-height: 1.6rem; overflow-y: auto; padding: .12rem .22rem;
  border: 3px solid var(--accent); border-radius: .16rem; background: #fff; font-size: .3rem; line-height: 1.3;
  white-space: pre-wrap; word-break: break-word;
}
.sv-kb-field.is-error { border-color: #d64545; }
.sv-kb-text { min-width: 0; }
.sv-kb-hint { font-size: .19rem; color: var(--muted); min-height: .2rem; }
.sv-kb-hint:empty { display: none; }
.sv-kb-field.is-error + .sv-kb-hint { color: #c03030; font-weight: 700; }
.sv-kb-keys { max-width: 15rem; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: .1rem; }
.sv-kb-row { display: flex; gap: .08rem; justify-content: center; }
.sv-key {
  flex: 1 1 0; max-width: 1.1rem; height: .74rem; padding: 0;
  border: none; border-radius: .14rem; background: #fff; color: var(--ink); box-shadow: 0 2px 0 #c4d0db;
  display: flex; align-items: center; justify-content: center; font-family: 'PT Sans', Arial, sans-serif; font-size: .32rem;
}
.sv-key svg { width: .38rem; height: .38rem; }
.sv-key-fn { background: #c9d6e2; font-size: .24rem; font-weight: 700; }
.sv-key-fn.on { background: var(--accent); color: #fff; }
.sv-key-w { flex: 1.5 1 0; max-width: 1.6rem; }
.sv-key-space { flex: 5 1 0; max-width: 5rem; font-size: .22rem; color: var(--muted); }
.sv-key-done { flex: 2 1 0; max-width: 2.4rem; background: var(--accent); color: #fff; font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .26rem; }
.sv-kb.is-date .sv-kb-top, .sv-kb.is-date .sv-kb-keys { max-width: 6.4rem; }
.sv-kb-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: .1rem; }
.sv-kb-pad .sv-key { max-width: none; height: .8rem; font-size: .36rem; }
.sv-kb-pad .sv-key-fn { font-size: .22rem; }
.sv-kb.is-date .sv-key-done { max-width: none; height: .8rem; }
body.sv-kb-open .sv { padding-bottom: 5.4rem; }

@media (orientation: portrait) {
  .sv-opt { width: 100%; }
  .sv-key { height: .9rem; }
  .sv-nav .sv-btn { min-width: 2.2rem; }
}

/* ================= Модуль «Прайс-лист» ================= */

.pr { display: flex; flex-direction: column; gap: .2rem; }
.pr-empty { padding: .8rem .6rem; display: flex; flex-direction: column; align-items: center; gap: .24rem; text-align: center; color: var(--muted); }
.pr-empty svg { color: var(--accent); }
.pr-empty p { margin: 0; max-width: 11rem; font-size: .3rem; line-height: 1.45; }
.pr-warn {
  display: flex; align-items: center; gap: .2rem; padding: .22rem .3rem;
  border-radius: .24rem; background: #fff4d6; border: 2px solid #f0c64a; color: #6b4b00; font-size: .26rem; font-weight: 700; line-height: 1.35;
}
.pr-warn svg { flex-shrink: 0; width: .44rem; height: .44rem; }
.pr-bar { display: flex; align-items: center; gap: .3rem; position: sticky; top: 0; z-index: 5; padding: .08rem 0 .12rem; background: var(--ground); }
.pr-search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: .16rem; height: .9rem; padding: 0 .16rem 0 .26rem;
  border: 3px solid var(--line); border-radius: .2rem; background: #fff; font-size: .3rem; cursor: text;
}
.pr-search.is-active { border-color: var(--accent); }
.pr-search > svg { flex-shrink: 0; width: .4rem; height: .4rem; color: var(--accent); }
.pr-q { flex: 1; min-width: 0; display: flex; align-items: center; white-space: nowrap; overflow: hidden; }
.pr-q .em-caret { display: none; height: .38rem; }
.pr-search.is-active .em-caret { display: block; }
.pr-q-ph { color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; }
.pr-clear { flex-shrink: 0; width: .66rem; height: .66rem; border: none; border-radius: 50%; background: var(--ground); color: var(--ink); font-size: .28rem; }
.pr-date { flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-end; gap: .02rem; font-size: .22rem; color: var(--muted); text-align: right; }
.pr-date b { color: var(--ink); }
.pr-found { font-size: .24rem; color: var(--muted); padding: 0 .06rem; }
.pr-list { display: flex; flex-direction: column; gap: .14rem; }
.pr-dep { overflow: hidden; }
.pr-dep-h, .pr-spec-h {
  width: 100%; display: flex; align-items: center; gap: .2rem; border: none; background: none; text-align: left; color: var(--ink);
  font-family: Montserrat, Arial, sans-serif; cursor: pointer;
}
.pr-dep-h { min-height: 1rem; padding: .2rem .34rem; font-size: .3rem; font-weight: 700; }
.pr-dep-h.is-static { cursor: default; min-height: .8rem; padding-bottom: .06rem; color: var(--accent); }
.pr-dep-n, .pr-spec-n { flex: 1; min-width: 0; }
.pr-cnt { flex-shrink: 0; font-family: 'PT Sans', Arial, sans-serif; font-weight: 400; font-size: .22rem; color: var(--muted); }
.pr-chev { flex-shrink: 0; width: .44rem; height: .44rem; color: var(--accent); transition: transform .15s; }
[aria-expanded="true"] > .pr-chev { transform: rotate(180deg); }
.pr-dep-h[aria-expanded="true"] { color: var(--accent); }
.pr-dep-b { padding: 0 .34rem .24rem; }
.pr-spec { border-top: 1px solid var(--line); }
.pr-spec-h { min-height: .86rem; padding: .14rem 0 .14rem .1rem; font-size: .26rem; font-weight: 600; }
.pr-spec-h[aria-expanded="true"] { color: var(--accent); }
.pr-spec .pr-rows { padding: 0 0 .16rem .1rem; }
.pr-spec-t { margin: .14rem 0 .04rem; font-family: Montserrat, Arial, sans-serif; font-size: .24rem; font-weight: 600; color: var(--muted); }
.pr-row {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name price" "code price";
  column-gap: .3rem; align-items: center; padding: .14rem .18rem; border-radius: .14rem;
}
.pr-row:nth-child(even) { background: #f3f7fa; }
.pr-name { grid-area: name; font-size: .26rem; line-height: 1.3; }
.pr-code { grid-area: code; font-size: .19rem; color: var(--muted-2); letter-spacing: .01em; }
.pr-price { grid-area: price; font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .28rem; white-space: nowrap; text-align: right; }
.pr mark { background: #ffe58a; color: inherit; border-radius: .04rem; padding: 0 .01rem; }
.pr-kb .sv-kb-keys { max-width: 14rem; }
body.pr-kb-open .pr { padding-bottom: 4.4rem; }

@media (orientation: portrait) {
  .pr-bar { flex-wrap: wrap; gap: .12rem; }
  .pr-search { flex-basis: 100%; }
  .pr-date { flex-direction: row; gap: .2rem; align-items: baseline; }
}

/* ================= Переводчик (modules/translator, окно из панели) ================= */
.tr { position: relative; display: flex; flex-direction: column; gap: .2rem; }
.tr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .1rem;
  min-height: .84rem; padding: 0 .32rem; border: none; border-radius: .2rem;
  font-family: Montserrat, Arial, sans-serif; font-weight: 700; font-size: .25rem; color: var(--ink);
}
.tr-btn svg { width: .34rem; height: .34rem; flex-shrink: 0; }
.tr-btn:disabled { opacity: .55; }
.tr-btn-go { background: #2e9d5b; color: #fff; }
.tr-btn-ghost { background: #fff; border: 2px solid var(--line); }
.tr-btn-end { background: #fde8e8; color: #a12a2a; }
.tr-err { min-height: .32rem; text-align: center; font-size: .24rem; font-weight: 700; color: #a15c00; }
.tr-overlay .tr-err { color: #ffe3a6; }

/* Выбор языка */
.tr-pick { background: #fff; border-radius: .32rem; padding: .32rem .4rem .4rem; }
.tr-x { top: .2rem; right: .2rem; }
.tr-pick-head h2 { margin: 0; font-size: .4rem; line-height: 1.15; padding-right: .9rem; }
.tr-pick-head p { margin: .06rem 0 0; font-size: .22rem; color: var(--muted); }
.tr-langs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .14rem; margin-top: .1rem; }
.tr-lang {
  position: relative; min-height: 1.05rem; padding: .14rem .5rem .14rem .18rem; border-radius: .22rem;
  border: 2px solid var(--line); background: var(--ground); color: var(--ink);
  display: flex; align-items: center; gap: .16rem; text-align: left;
}
.tr-lang-name { min-width: 0; display: flex; flex-direction: column; gap: .02rem; }
.tr-flag { font-size: .56rem; line-height: 1; flex-shrink: 0; font-family: 'Noto Color Emoji', 'Apple Color Emoji', 'Segoe UI Emoji', sans-serif; }
.tr-bar-lang .tr-flag { font-size: .4rem; vertical-align: -.06rem; }
.tr-lang b { font-family: Montserrat, Arial, sans-serif; font-size: .32rem; line-height: 1.1; }
.tr-lang small { font-size: .2rem; color: var(--muted); }
.tr-lang:active { border-color: var(--accent); background: var(--light-tile); }
.tr-lang-mic { position: absolute; top: .14rem; right: .14rem; width: .3rem; height: .3rem; color: var(--accent); }
.tr-lang-mic svg { width: 100%; height: 100%; }
@media (orientation: portrait) { .tr-langs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Согласие и завершение */
.tr-consent-card, .tr-end-card { max-width: 11rem; margin: 0 auto; padding: .4rem .5rem; display: flex; flex-direction: column; gap: .16rem; }
.tr-consent-card h2, .tr-end-card h2 { margin: 0; font-size: .4rem; }
.tr-consent-card p { margin: 0; font-size: .28rem; line-height: 1.4; }
.tr-consent-card .tr-ru { font-size: .2rem; color: var(--muted); }
.tr-consent-acts { display: flex; gap: .2rem; justify-content: flex-end; margin-top: .1rem; }
.tr-consent-acts .tr-btn { min-height: 1rem; font-size: .3rem; padding: 0 .44rem; }
.tr-consent .tr-err { color: #a12a2a; }
.tr-end-card { align-items: center; text-align: center; padding: .8rem .5rem; }
.tr-end-card > svg { width: 1.2rem; height: 1.2rem; color: #2e9d5b; }
.tr-end-card p { margin: 0; font-size: .24rem; color: var(--muted); }

/* Разговор */
.tr-chat { height: calc(100vh - 1.75rem); height: calc(100dvh - 1.75rem); gap: .14rem; }
.tr-bar { display: flex; align-items: center; gap: .2rem; background: #fff; border-radius: .24rem; padding: .12rem .14rem .12rem .3rem; }
.tr-bar-lang { font-family: Montserrat, Arial, sans-serif; font-weight: 800; font-size: .3rem; }
.tr-bar-note { flex: 1; font-size: .2rem; color: var(--muted); }
.tr-log {
  flex: 1; min-height: 0; overflow-y: auto; background: #fff; border-radius: .24rem; padding: .24rem;
  display: flex; flex-direction: column; gap: .16rem; -webkit-user-select: text; user-select: text;
}
.tr-msg { max-width: 82%; padding: .16rem .24rem; border-radius: .24rem; display: flex; flex-direction: column; gap: .06rem; }
.tr-msg-admin { align-self: flex-start; background: #e6f2fb; border-bottom-left-radius: .06rem; }
.tr-msg-own { align-self: flex-end; background: #eef7ef; border-bottom-right-radius: .06rem; }
.tr-msg-who { font-size: .18rem; color: var(--muted); }
.tr-msg-text { font-size: .36rem; line-height: 1.3; }
.tr-msg-own .tr-msg-text { font-size: .3rem; }
.tr-msg-sub { font-size: .2rem; color: var(--muted); }
.tr-play { align-self: flex-start; min-height: .66rem; font-size: .22rem; }
.tr-wait { align-self: center; padding: .1rem .24rem; border-radius: .3rem; background: #fff3c4; color: #5c4300; font-size: .22rem; }

.tr-input { display: flex; gap: .2rem; align-items: stretch; }
.tr-mic {
  position: relative; flex: 0 0 4.2rem; min-height: 2rem; border: none; border-radius: .32rem;
  background: var(--accent); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
  font-family: Montserrat, Arial, sans-serif; font-weight: 800; font-size: .3rem; overflow: hidden;
}
.tr-mic > svg { position: relative; width: .8rem; height: .8rem; }
.tr-mic-label { position: relative; padding: 0 .2rem; text-align: center; line-height: 1.15; }
.tr-mic-ring {
  position: absolute; left: 50%; top: 42%; width: 1.4rem; height: 1.4rem; margin: -.7rem 0 0 -.7rem; border-radius: 50%;
  background: rgba(255, 255, 255, .18); transition: transform .08s linear; pointer-events: none;
}
.tr-mic.is-rec { background: #d64545; }
.tr-mic.is-busy { background: #6a7a8a; }
.tr-novoice { flex: 0 0 4.2rem; display: flex; align-items: center; padding: .2rem .3rem; border-radius: .32rem; background: #fff3c4; color: #5c4300; font-size: .24rem; }
.tr-side { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .12rem; }
.tr-btn-type { align-self: flex-start; }
.tr-phrases { background: #fff; border-radius: .24rem; padding: .12rem .16rem; }
.tr-phrases small { display: block; font-size: .18rem; color: var(--muted); margin-bottom: .06rem; }
.tr-phrases > div { display: flex; flex-wrap: wrap; gap: .1rem; }
.tr-phrase { padding: .1rem .2rem; border-radius: .3rem; border: 2px solid var(--line); background: var(--ground); color: var(--ink); font-size: .23rem; }
.tr-phrase:active { border-color: var(--accent); }

.tr-confirm { padding: .24rem .3rem; display: flex; flex-direction: column; gap: .12rem; }
.tr-confirm > b { font-size: .22rem; color: var(--muted); }
.tr-confirm-text { font-size: .36rem; line-height: 1.3; }
.tr-confirm-acts { display: flex; gap: .16rem; justify-content: flex-end; flex-wrap: wrap; }
.tr-confirm-acts .tr-btn { min-height: .96rem; font-size: .28rem; }

.tr-kb { padding: .16rem; display: flex; flex-direction: column; gap: .1rem; }
.tr-kb-top { display: flex; gap: .14rem; align-items: stretch; }
.tr-kb-field {
  flex: 1; min-width: 0; min-height: .9rem; padding: .12rem .2rem; border: 3px solid var(--accent); border-radius: .2rem;
  display: flex; align-items: center; flex-wrap: wrap; font-size: .3rem; line-height: 1.25; word-break: break-word;
}
.tr-kb-text { white-space: pre-wrap; }
.tr-kb-ph { color: #9aa6b2; }
.tr-kb-close { position: static; flex-shrink: 0; width: .9rem; height: .9rem; }
.tr-kb-row { display: flex; gap: .08rem; justify-content: center; }
.tr-key {
  flex: 1 1 0; max-width: 1.1rem; height: .78rem; border: none; border-radius: .14rem;
  background: var(--ground); color: var(--ink); font-size: .32rem; font-family: 'PT Sans', Arial, sans-serif;
}
.tr-key:active { background: var(--light-tile); }
.tr-key-fn { background: #dbe5ee; max-width: 1.4rem; }
.tr-key-fn svg { width: .36rem; height: .36rem; }
.tr-key-space { flex: 4 1 0; max-width: 4rem; font-size: .22rem; }
.tr-kb.is-shift .tr-key-fn[data-key="SHIFT"] { background: var(--accent); color: #fff; }
.tr-kb-dense .tr-key { height: .64rem; font-size: .3rem; }
.tr-kb-sys {
  flex: 1; min-width: 0; min-height: 1.2rem; padding: .14rem .2rem; border: 3px solid var(--accent); border-radius: .2rem;
  font: inherit; font-size: .32rem; resize: none; -webkit-user-select: text; user-select: text;
}
.tr-kb-hint { font-size: .22rem; color: var(--muted); padding: 0 .06rem; }

/* Окно переводчика поверх экрана */
.tr-overlay .em-overlay-box { max-width: 17rem; }
.tr-overlay .em-overlay-form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tr-overlay .tr-chat { flex: 1; height: auto; min-height: 0; }
.tr-overlay .tr-msg-sub { color: #56606c; }

@media (orientation: portrait) {
  .tr-chat { height: calc(100vh - 2.2rem); height: calc(100dvh - 2.2rem); }
  .tr-input { flex-direction: column; }
  .tr-mic, .tr-novoice { flex-basis: auto; min-height: 1.8rem; }
  .tr-key { height: .9rem; font-size: .36rem; }
  .tr-msg { max-width: 92%; }
}

/* ================= ID устройства (правый верхний угол главного экрана) ================= */
/* Нужен администраторам: по нему устройство находят в панели (desk → «Устройства»). Пациентам не мешает. */
.device-id {
  position: fixed; top: .1rem; right: .18rem; z-index: 1;
  font: 600 .15rem/1 Montserrat, Arial, sans-serif; letter-spacing: .02em;
  color: #aab4bf; pointer-events: none; user-select: none; white-space: nowrap;
}

/* Документ на подпись поверх экрана (assets/js/doc-sign.js).
   Альбомная ориентация: документ на всю высоту, справа узкая колонка с названием и кнопками.
   Книжная: название одной строкой сверху, кнопки компактно снизу. Остальное место — документу. */
.ds-overlay .em-overlay-box { max-width: none; height: 100%; padding: .12rem; gap: 0; }
.ds-overlay .em-overlay-title { display: none; }
.ds-overlay .em-overlay-form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ds { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: .12rem; }
.ds.is-doc { display: grid; grid-template-columns: minmax(0, 1fr) 4.3rem; grid-template-rows: auto minmax(0, 1fr); }
.ds.is-doc .ds-view { grid-column: 1; grid-row: 1 / 3; }
.ds.is-doc .ds-head { grid-column: 2; grid-row: 1; }
.ds.is-doc .ds-foot { grid-column: 2; grid-row: 2; }
.ds-head { position: relative; min-width: 0; padding: .16rem .84rem .16rem .22rem; }
.ds-head h2 { margin: 0; font-size: .27rem; line-height: 1.2; overflow-wrap: anywhere; }
.ds-sub { margin-top: .06rem; font-size: .19rem; line-height: 1.3; color: var(--muted); overflow-wrap: anywhere; }
.ds-head .em-close { top: .12rem; right: .12rem; width: .62rem; height: .62rem; font-size: .28rem; }
.ds-view { flex: 1; min-height: 0; overflow-y: auto; overflow-x: auto; padding: .08rem; border-radius: .16rem; background: #cfd9e2; -webkit-overflow-scrolling: touch; }
.ds-pages { display: flex; flex-direction: column; align-items: center; gap: .1rem; min-width: min-content; }
.ds-page { background: #fff; box-shadow: 0 .02rem .1rem rgba(0, 0, 0, .2); flex-shrink: 0; }
.ds-page canvas { display: block; }
.ds-status { padding: 1rem .4rem; font-size: .28rem; color: var(--muted); text-align: center; }
.ds-foot {
  min-height: 0; overflow-y: auto; display: flex; flex-direction: column; justify-content: flex-end; gap: .12rem; padding: .14rem;
  background: #2b4054; border-radius: .2rem; box-shadow: 0 -.04rem .2rem rgba(0, 0, 0, .25); color: #fff;
}
.ds-foot .sv-btn { display: inline-flex; align-items: center; justify-content: center; gap: .1rem; flex-shrink: 0; min-width: 0; height: .84rem; padding: 0 .2rem; font-size: .26rem; }
.ds-foot .sv-btn svg, .ds-code .sv-btn svg { width: .32rem; height: .32rem; }
.ds-foot .sv-btn:disabled { opacity: .45; }
.ds-foot-msg { display: flex; align-items: center; gap: .12rem; font-size: .21rem; line-height: 1.3; }
.ds-foot-msg svg { width: .4rem; height: .4rem; flex-shrink: 0; color: #ffd23f; animation: ds-bob 1.4s ease-in-out infinite; }
@keyframes ds-bob { 50% { transform: translateY(.08rem); } }
.ds-foot-err { padding: .1rem .14rem; border-radius: .12rem; background: #ffd2d2; color: #7a1010; font-size: .2rem; font-weight: 700; }
.ds-zoom { display: flex; gap: .08rem; margin-bottom: auto; flex-shrink: 0; }
.ds-zoom button { flex: 1; height: .66rem; min-width: .8rem; border: none; border-radius: .14rem; background: rgba(255, 255, 255, .14); color: #fff; font-size: .36rem; font-weight: 700; }
.ds-agree {
  display: flex; align-items: center; gap: .14rem; padding: .1rem .14rem; text-align: left; flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, .35); border-radius: .16rem; background: transparent; color: #fff; font-size: .2rem; line-height: 1.3;
}
.ds-agree .sv-mark { flex-shrink: 0; border-color: #fff; background: transparent; }
.ds-agree:disabled { opacity: .45; }
/* Вопросы пациенту под документом: «Да» / «Нет», заранее ничего не выбрано. */
.ds-qs { display: flex; flex-direction: column; gap: .1rem; flex-shrink: 0; }
.ds-q { padding: .1rem .12rem; border: 2px solid #ffd23f; border-radius: .16rem; background: rgba(255, 255, 255, .06); }
.ds-q.done { border-color: rgba(255, 255, 255, .25); }
.ds-q-text { margin-bottom: .08rem; font-size: .2rem; line-height: 1.3; }
.ds-q-btns { display: flex; gap: .08rem; }
.ds-ans {
  flex: 1; height: .6rem; min-width: 1.1rem; border: 2px solid rgba(255, 255, 255, .4); border-radius: .12rem;
  background: transparent; color: #fff; font: 700 .24rem/1 Montserrat, Arial, sans-serif;
}
.ds-ans.on { background: #ffd23f; border-color: #ffd23f; color: #2b4054; }
.ds-agree.on { border-color: #ffd23f; background: rgba(255, 210, 63, .12); }
.ds-agree.on .sv-mark { background: #ffd23f; border-color: #ffd23f; color: #2b4054; }
@media (orientation: portrait) {
  .ds.is-doc { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
  .ds.is-doc .ds-head { grid-column: 1; grid-row: 1; }
  .ds.is-doc .ds-view { grid-column: 1; grid-row: 2; }
  .ds.is-doc .ds-foot { grid-column: 1; grid-row: 3; }
  .ds-head { padding: .1rem .84rem .1rem .22rem; }
  .ds-head h2, .ds-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ds-head h2 { font-size: .26rem; }
  .ds-sub { margin-top: .02rem; }
  .ds-head .em-close { top: 50%; transform: translateY(-50%); width: .56rem; height: .56rem; }
  .ds-foot { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .1rem .12rem; padding: .1rem .12rem; overflow: visible; }
  .ds-zoom { margin-bottom: 0; }
  .ds-zoom button { flex: none; width: .74rem; height: .74rem; }
  .ds-foot-msg, .ds-agree { flex: 1 1 100%; order: -1; }
  .ds-qs { flex: 1 1 100%; order: -2; }
  .ds-q { display: flex; align-items: center; gap: .14rem; }
  .ds-q-text { flex: 1; margin: 0; }
  .ds-q-btns { flex: none; }
  .ds-foot-msg.is-scroll { flex: 1 1 0; order: 0; min-width: 0; }
  .ds-foot .sv-btn { flex: 1 1 0; height: .78rem; }
  .ds-foot-err { flex-basis: 100%; order: -3; }
}
.ds-code { flex: 1; min-height: 0; overflow-y: auto; padding: .3rem .44rem; display: flex; flex-direction: column; align-items: center; gap: .14rem; text-align: center; }
.ds-code h3 { margin: 0; font-family: Montserrat, Arial, sans-serif; font-size: .4rem; }
.ds-code-to { margin: 0; font-size: .25rem; color: var(--muted); }
.ds-code-to small { color: #a05a00; }
.ds-cells { display: flex; gap: .14rem; margin: .06rem 0; }
.ds-cell {
  width: .9rem; height: 1.08rem; border-radius: .16rem; border: 3px solid var(--line); background: #fff;
  display: flex; align-items: center; justify-content: center; font: 700 .56rem/1 Montserrat, Arial, sans-serif; color: var(--ink);
}
.ds-cell.on { border-color: #9fb3c4; }
.ds-cell.cur { border-color: var(--accent); box-shadow: 0 0 0 .05rem rgba(0, 130, 200, .2); }
.ds-cells.shake { animation: ds-shake .4s; }
@keyframes ds-shake { 20%, 60% { transform: translateX(-.1rem); } 40%, 80% { transform: translateX(.1rem); } }
.ds-code-msg { min-height: .32rem; font-size: .24rem; color: var(--muted); }
.ds-code-msg.is-error { color: #c03030; font-weight: 700; }
.ds-pad { display: grid; grid-template-columns: repeat(3, 1.9rem); gap: .12rem; }
.ds-key { height: .9rem; border: none; border-radius: .18rem; background: var(--ground); color: var(--ink); font: 700 .42rem/1 Montserrat, Arial, sans-serif; }
.ds-key-fn { font-size: .22rem; }
.ds-key svg { width: .44rem; height: .44rem; }
.ds-key:active { transform: scale(.96); background: #d6e2ec; }
.ds-code-btns { display: flex; gap: .16rem; flex-wrap: wrap; justify-content: center; margin-top: .08rem; }
.ds-code .sv-btn { display: inline-flex; align-items: center; justify-content: center; gap: .1rem; }
.ds-code .sv-btn:disabled { opacity: .45; }
.ds-code-head { display: flex; flex-direction: column; align-items: inherit; gap: .1rem; }
/* Ввод кода: в альбомной ориентации ячейки и клавиатура слева, заголовок, сообщение и кнопки справа — всё в один экран. */
.ds-code.ds-enter {
  display: grid; justify-content: center; align-content: center; column-gap: .7rem; row-gap: .14rem; padding: .24rem .4rem;
  grid-template-columns: auto minmax(4.4rem, 6rem); grid-template-rows: auto auto auto;
  grid-template-areas: "cells head" "pad msg" "pad btns";
}
.ds-enter .ds-code-head { grid-area: head; align-self: center; }
.ds-enter .ds-cells { grid-area: cells; align-self: end; margin: 0; }
.ds-enter .ds-code-msg { grid-area: msg; }
.ds-enter .ds-pad { grid-area: pad; align-self: start; width: 100%; grid-template-columns: repeat(3, 1fr); }
.ds-enter .ds-code-btns { grid-area: btns; align-self: start; flex-direction: column; flex-wrap: nowrap; margin: 0; }
.ds-enter .ds-code-btns .sv-btn { width: 100%; }
.ds-final { justify-content: center; }
.ds-final p { margin: 0; max-width: 9rem; font-size: .28rem; color: var(--muted); }
.ds-final-icon {
  width: 1.4rem; height: 1.4rem; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #ffe9a8; color: #7a5600; font: 800 .8rem/1 Montserrat, Arial, sans-serif;
}
.ds-final-icon.ok { background: #e2f3e8; color: #1e8a4c; }
.ds-final-icon svg { width: .8rem; height: .8rem; }
.ds-decline .ds-reasons { display: flex; flex-direction: column; gap: .1rem; }
.ds-decline .sv-opt { min-height: .74rem; }
@media (orientation: portrait) {
  .ds-pad { grid-template-columns: repeat(3, 2.3rem); }
  .ds-key { height: 1.1rem; }
  .ds-code.ds-enter {
    grid-template-columns: auto; grid-template-rows: none; grid-template-areas: "head" "cells" "msg" "pad" "btns";
    justify-items: center; text-align: center;
  }
  .ds-enter .ds-code-head { align-items: center; }
  .ds-enter .ds-code-btns { flex-direction: row-reverse; flex-wrap: wrap; justify-content: center; margin-top: .08rem; }
  .ds-enter .ds-code-btns .sv-btn { width: auto; }
}

/* ================= Служебный раздел (lib/staff.php, assets/js/staff-login.js, staff.js) ================= */
/* Иконка входа — справа в шапке главного экрана, под ID устройства. Нейтральная, пациентам в глаза не бросается. */
.staff-enter {
  margin-left: auto; flex-shrink: 0; align-self: center;
  width: .8rem; height: .8rem; border-radius: .24rem; border: none;
  background: #fff; color: var(--muted-2); display: flex; align-items: center; justify-content: center;
}
.staff-enter svg { width: .44rem; height: .44rem; }
.staff-enter:active { transform: scale(.94); }

/* Окно PIN */
.staff-pin-box { position: relative; width: 7rem; padding: .44rem .6rem .48rem; gap: .14rem; }
.staff-pin-box.has-warn { width: 8.2rem; padding-top: .36rem; }
.staff-pin-box.has-warn .staff-pin-ic { display: none; }
.staff-pin-close {
  position: absolute; top: .26rem; right: .26rem; width: .72rem; height: .72rem; border-radius: 50%; border: none;
  background: var(--ground); color: var(--ink); display: flex; align-items: center; justify-content: center;
}
.staff-pin-close svg { width: .34rem; height: .34rem; }
.staff-pin-ic {
  width: .84rem; height: .84rem; border-radius: .24rem; background: var(--light-tile); color: var(--light-ic);
  display: flex; align-items: center; justify-content: center;
}
.staff-pin-ic svg { width: .44rem; height: .44rem; }
.staff-pin-box .modal-title { font-weight: 800; font-size: .44rem; }
.staff-pin-msg { font-size: .26rem; color: var(--muted-2); min-height: .36rem; }
.staff-pin-msg.is-err { color: #d6372b; font-weight: 700; }
.staff-pin-warn {
  display: flex; gap: .22rem; align-items: center; text-align: left; width: 100%;
  background: #fde8e6; border: 3px solid #f3b4ad; border-radius: .26rem; padding: .22rem .28rem;
  font: 800 .28rem/1.25 Montserrat, Arial, sans-serif; color: #8a1f17;
}
.staff-pin-warn[hidden] { display: none; }
.staff-pin-warn-ic {
  flex-shrink: 0; width: .64rem; height: .64rem; padding: .13rem; border-radius: .18rem; background: #d6372b; color: #fff;
}
.staff-dots { display: flex; gap: .26rem; justify-content: center; margin: .14rem 0 .22rem; }
.staff-dots i { width: .32rem; height: .32rem; border-radius: 50%; border: .04rem solid #b9c9d6; display: block; transition: background .1s; }
.staff-dots i.on { background: var(--accent); border-color: var(--accent); }
.staff-dots.err i { border-color: #d6372b; }
.staff-dots.err i.on { background: #d6372b; }
.staff-pad { display: grid; grid-template-columns: repeat(3, 1.5rem); gap: .16rem; justify-content: center; }
.staff-key {
  height: 1rem; border-radius: .24rem; border: none; background: var(--ground); color: var(--ink);
  font: 700 .46rem/1 Montserrat, Arial, sans-serif; display: flex; align-items: center; justify-content: center;
}
.staff-key:active { background: #cfe3f3; transform: scale(.96); }
.staff-key-del { background: transparent; color: var(--muted-2); }
.staff-key-del svg { width: .52rem; height: .52rem; }
.staff-key-ok { background: var(--accent); color: #fff; font-size: .28rem; }
.staff-pin-box.shake { animation: staff-shake .4s ease; }
@keyframes staff-shake { 20%, 60% { transform: translateX(-.14rem); } 40%, 80% { transform: translateX(.14rem); } }

/* Страницы раздела */
.staff { min-height: 100vh; padding: .4rem .48rem; display: flex; flex-direction: column; gap: .22rem; }
.staff-bar { position: sticky; top: 0; z-index: 10; background: var(--ground); padding: .4rem .48rem .24rem; }
.staff-top { display: flex; align-items: center; gap: .22rem; min-height: .86rem; }
.staff-lock {
  flex-shrink: 0; width: .86rem; height: .86rem; border-radius: .24rem; background: var(--night); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.staff-lock svg { width: .42rem; height: .42rem; }
.staff-title {
  margin: 0; font-weight: 800; font-size: .46rem; line-height: 1.1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.staff-role {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: .1rem; height: .56rem; padding: 0 .24rem;
  border-radius: .28rem; background: var(--night); color: #fff; font-weight: 700; font-size: .24rem;
}
.staff-role svg { width: .28rem; height: .28rem; }
.staff-timer {
  margin-left: auto; flex-shrink: 0; display: inline-flex; align-items: center; gap: .1rem; height: .56rem; padding: 0 .22rem;
  border-radius: .28rem; background: #fff; color: var(--muted-2); font-size: .24rem; white-space: nowrap;
}
.staff-timer[hidden] { display: inline-flex; visibility: hidden; }
.staff-timer svg { width: .28rem; height: .28rem; }
.staff-timer b { color: var(--ink); min-width: .5rem; }
.staff-btn {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; gap: .14rem;
  height: .86rem; padding: 0 .32rem; border-radius: .24rem; border: 3px solid var(--line); background: #fff;
  color: var(--ink); text-decoration: none; white-space: nowrap;
  font: 700 .28rem/1 Montserrat, Arial, sans-serif;
}
.staff-btn svg { width: .38rem; height: .38rem; }
.staff-btn:active { transform: scale(.97); }
.staff-exit { color: #c43b3b; }
.staff-sub { display: flex; align-items: baseline; justify-content: space-between; gap: .3rem; }
.staff-sub h2 { margin: 0; font-weight: 700; font-size: .3rem; }
.staff-sub span { font-size: .24rem; color: var(--muted-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 3rem; gap: .22rem; }
.staff-tiles .tile:active { transform: scale(.97); }
.staff-empty { min-height: 4rem; }

/* Окно «Выход из служебного раздела» (за 10 сек до автовыхода) */
.staff-warn-box { width: 8.6rem; padding: .56rem .6rem .5rem; }
.staff-warn-box p { margin: 0 0 .16rem; font-size: .26rem; color: var(--muted-2); }
.staff-warn-ring {
  --p: 100%;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: conic-gradient(var(--accent) var(--p), var(--light-tile) 0);
  display: flex; align-items: center; justify-content: center;
}
.staff-warn-ring b {
  width: 1.26rem; height: 1.26rem; border-radius: 50%; background: #fff;
  display: flex; align-items: center; justify-content: center; font: 800 .6rem/1 Montserrat, Arial, sans-serif;
}
.staff-warn-btns { display: flex; gap: .18rem; width: 100%; }
.staff-warn-btns > * { flex: 1; height: .9rem; font-size: .28rem; }

@media (orientation: portrait) {
  .staff-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 2.6rem; }
  .staff-top { gap: .14rem; }
  .staff-title { font-size: .36rem; flex: 1 1 0; }
  .staff-lock { width: .76rem; height: .76rem; }
  .staff-role svg, .staff-timer span, .staff-timer svg { display: none; }
  .staff-btn { padding: 0 .24rem; }
  .staff-sub { flex-direction: column; gap: .04rem; }
  .staff-pin-box, .staff-pin-box.has-warn { width: 8rem; }
  .staff-pad { grid-template-columns: repeat(3, 1.8rem); }
  .staff-key { height: 1.15rem; }
}

/* Служебная плитка «Визитки» (staff-vcards.php, assets/js/staff-vcards.js) */
.vc-list-view { display: flex; flex-direction: column; gap: .22rem; padding-bottom: 1.5rem; }
.vc-letters { display: flex; flex-wrap: wrap; gap: .1rem; }
.vc-letter {
  min-width: .7rem; height: .7rem; padding: 0 .18rem; border: none; border-radius: .18rem;
  background: #fff; font: 700 .28rem/1 Montserrat, Arial, sans-serif; color: var(--ink);
}
.vc-letter.on { background: var(--accent); color: #fff; }
.vc-letter:active { transform: scale(.95); }
.vc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .16rem; }
.vc-doc {
  position: relative; display: flex; align-items: center; gap: .2rem; min-height: 1.3rem; padding: .18rem .24rem;
  border: 3px solid transparent; border-radius: .24rem; background: #fff; text-align: left;
}
.vc-doc:active { transform: scale(.98); }
.vc-doc.on { border-color: var(--accent); background: #f2f8fd; }
.vc-photo {
  flex-shrink: 0; width: .94rem; height: .94rem; border-radius: 50%; overflow: hidden; background: var(--ground);
  display: flex; align-items: center; justify-content: center; color: var(--muted-2);
}
.vc-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; }
.vc-photo svg { width: .44rem; height: .44rem; }
.vc-doc-text { display: flex; flex-direction: column; gap: .04rem; min-width: 0; padding-right: .36rem; }
.vc-doc-text b { font-size: .26rem; line-height: 1.2; }
.vc-doc-text small { font-size: .2rem; color: var(--muted-2); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vc-check {
  position: absolute; top: .14rem; right: .14rem; width: .4rem; height: .4rem; border-radius: 50%;
  background: var(--accent); color: #fff; display: none; align-items: center; justify-content: center;
}
.vc-check svg { width: .26rem; height: .26rem; }
.vc-doc.on .vc-check { display: flex; }
.vc-bar {
  position: fixed; left: .48rem; right: .48rem; bottom: .3rem; z-index: 20; display: flex; align-items: center; gap: .3rem;
  padding: .18rem .18rem .18rem .36rem; border-radius: .3rem; background: var(--night); color: #fff;
  box-shadow: 0 .1rem .4rem rgba(16, 32, 48, .25);
}
.vc-bar-text { flex: 1; min-width: 0; font-size: .28rem; opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-bar-text.is-picked { opacity: 1; font-weight: 700; font-family: Montserrat, Arial, sans-serif; }
.vc-order { height: .9rem; padding: 0 .5rem; font-size: .3rem; flex-shrink: 0; }
.vc-order svg { width: .4rem; height: .4rem; }
.vc-order:disabled { background: #5d7488; color: #c9d5df; }
.vc-modal-box { width: 8rem; gap: .22rem; }
.vc-modal-ic {
  width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--light-tile); color: var(--light-ic);
  display: flex; align-items: center; justify-content: center;
}
.vc-modal-ic svg { width: .56rem; height: .56rem; }
.vc-modal-box .modal-title { font-weight: 800; font-size: .42rem; }
.vc-modal-data {
  width: 100%; margin: 0; display: grid; grid-template-columns: auto 1fr; gap: .14rem .3rem; text-align: left;
  padding: .26rem .3rem; border-radius: .24rem; background: var(--ground);
}
.vc-modal-data dt { font-size: .22rem; color: var(--muted-2); padding-top: .05rem; }
.vc-modal-data dd { margin: 0; font-size: .28rem; display: flex; flex-direction: column; gap: .04rem; }
.vc-modal-data dd b { font-family: Montserrat, Arial, sans-serif; font-size: .32rem; }
.vc-modal-data dd small { font-size: .22rem; color: var(--muted-2); }
.vc-modal-err { width: 100%; padding: .14rem .2rem; border-radius: .16rem; background: #fde8e6; color: #b3261e; font-size: .24rem; }
.vc-modal-btns { display: flex; gap: .18rem; width: 100%; }
.vc-modal-btns > * { flex: 1; height: .9rem; font-size: .28rem; }
.vc-modal-btns .btn-primary:disabled { opacity: .6; }
.vc-done { flex: 1; display: flex; align-items: center; justify-content: center; }
.vc-done-box {
  width: 9rem; max-width: 100%; padding: .7rem .6rem; border-radius: .4rem; background: #fff;
  display: flex; flex-direction: column; align-items: center; gap: .2rem; text-align: center;
}
.vc-done-ic { width: 1.3rem; height: 1.3rem; border-radius: 50%; background: #e2f3e8; color: #2e9d5b; display: flex; align-items: center; justify-content: center; }
.vc-done-ic svg { width: .64rem; height: .64rem; }
.vc-done-box h2 { margin: .1rem 0 0; font-weight: 800; font-size: .46rem; }
.vc-done-box p { margin: 0 0 .2rem; font-size: .28rem; color: var(--muted-2); line-height: 1.5; }
.vc-done-box p b { color: var(--ink); }
.vc-done-btns { display: flex; gap: .2rem; justify-content: center; flex-wrap: wrap; }
@media (orientation: portrait) {
  .vc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vc-modal-box { width: 8rem; }
  .vc-done-box { width: 100%; }
}
