/* Журнал смен NVC — рабочее приложение поверх tokens.css макета «Приёмная» (wow-b v3). */

[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
html { -webkit-text-size-adjust: 100%; }
html, body { height: auto; }
body { min-height: 100vh; overflow-x: clip; } /* clip не делает body отдельным скроллером: прокручивается окно */
#root { position: relative; z-index: 1; }
html.ov-open, html.ov-open body { overflow: hidden; }
a { color: inherit; }
input, textarea { font: inherit; color: var(--ink); }
:focus-visible { outline: 2.5px solid color-mix(in srgb, var(--me) 70%, transparent); outline-offset: 2px; }
.boot { padding: 40vh 24px 0; text-align: center; color: var(--ink-3); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.av.is-guest { background: var(--tag); color: var(--tag-ink); box-shadow: inset 0 -1.5px 0 rgba(90,60,30,.12), inset 0 0 0 1px rgba(90,60,30,.06); font-size: 12px; letter-spacing: 0; line-height: 1; text-align: center; }
.av.is-guest small { display: block; font-size: 9.5px; font-weight: 650; margin-top: 1px; }

/* ---------- телефон: настоящая прокрутка страницы вместо кадра 100vh ---------- */
.ph { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; }
.ph .board { min-height: calc(100vh - 96px); min-height: calc(100dvh - 96px); }
.ph .sheet { min-height: calc(100vh - 116px); min-height: calc(100dvh - 116px); padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
.ph::after { position: fixed; height: calc(96px + env(safe-area-inset-bottom)); }
.ph .console { position: fixed; bottom: calc(22px + env(safe-area-inset-bottom)); max-width: 640px; margin: 0 auto; }
.ph__top .tabs { min-width: 0; }
@media (max-width: 380px) { .ph__top .tab { padding: 0 8px; font-size: 15.5px; } }
.tab { white-space: nowrap; }

/* поиск — настоящее поле ввода внутри вдавленной плашки */
.search { cursor: text; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; outline: none; font-size: inherit; color: var(--ink); }
.search input::placeholder { color: var(--ink-3); opacity: 1; }
.search input::-webkit-search-cancel-button { display: none; }
.search:focus-within { box-shadow: inset 0 1.5px 3px rgba(80,55,30,.10), 0 0 0 2px color-mix(in srgb, var(--me) 55%, transparent); }
.console .search:focus-within { box-shadow: var(--shadow-console), 0 0 0 2px color-mix(in srgb, var(--me) 55%, transparent); }
.search .x { flex: none; width: 36px; height: 36px; margin-right: -8px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-3); }
.search .x[hidden] { display: none; }
.search .x .i { width: 18px; height: 18px; }
.console .search { font-size: 16px; }
.console .search input { font-size: 16px; }

/* ---------- строка: нить пациента считается от строки, а не фиксированной высотой ---------- */
.row { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .15s; }
.dk .row:hover { background: color-mix(in srgb, var(--deep) 45%, transparent); }
.row--chain-from .row__tag::after { display: none; }
.row--chain-from::after { content: ""; position: absolute; width: 2px; border-radius: 2px; background: var(--tag); z-index: 0; pointer-events: none; }
.row--chain-from.is-urg::after { background: var(--urgent-thread); }
.ph .row--chain-from::after { left: 33px; top: 58px; bottom: -15px; }
.ph .row--chained.row--chain-from::after { top: 52px; }
.dk .row--chain-from::after { left: 57px; top: 58px; bottom: -16px; }
.dk .row--chained.row--chain-from::after { top: 52px; }
.row__tag, .row__body, .chk, .row .meta { position: relative; z-index: 1; }
.row__l1 { min-width: 0; }
.row__name { overflow: hidden; text-overflow: ellipsis; max-width: 70%; }
.dk .row__l2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk .row .meta { min-width: 0; overflow: hidden; }
.dk .row .meta > b, .dk .row .meta > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.chk { cursor: pointer; position: relative; }
.chk::after { content: ""; position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; opacity: 0; transform: scale(.6); transition: opacity .16s, transform .16s;
  background: var(--me) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><path d='M6.5 12.5l3.6 3.6 7.4-7.8'/></svg>") center/18px no-repeat; }
[data-theme="dark"] .chk::after { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230F2A22' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><path d='M6.5 12.5l3.6 3.6 7.4-7.8'/></svg>"); }
.chk:hover::before { border-color: var(--me); }
.chk.is-on::after { opacity: 1; transform: none; }
.row.is-leaving { transition: transform .28s cubic-bezier(.5,0,.75,0), opacity .28s; transform: translateX(105%); opacity: 0; }
.row.is-fresh { animation: fresh 2.4s ease-out; }
@keyframes fresh { 0%, 30% { background: color-mix(in srgb, var(--me) 13%, transparent); } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .row.is-leaving { transition: opacity .15s; transform: none; } .row.is-fresh { animation: none; } }
.row.is-later .when { color: var(--ink); }

/* правила смены */
.rules { cursor: pointer; }
.rules[aria-expanded="true"] .chev { transform: rotate(180deg); }
.ph .rules-list { margin: 6px 12px 10px; }
.rules-list li { padding: 0; }
.rules-list button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 32px; color: var(--ink-2); font-size: 15px; text-align: left; border-radius: 8px; }
.ph .rules-list button { min-height: 44px; align-items: flex-start; padding: 11px 0; line-height: 1.35; }
.ph .rules-list button .i { margin-top: 2px; }
.rules-list button span { min-width: 0; }
.dk .rules-list button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk .rules-list { gap: 0; }

/* «Позже» */
.later { cursor: pointer; text-align: left; }
.later-h { width: 100%; cursor: pointer; text-align: left; }
.dk .later-h { padding: 8px 26px 0 46px; }
.dk .later-h::before { content: ""; position: absolute; top: 0; left: 96px; right: 26px; height: 1px; background: var(--line); }
.later-h + .row::before { display: none; }
.dk .key { padding: 18px 26px 4px 46px; }
.key { padding-bottom: 6px; }

/* шапка листа и разделы */
.sh__title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.sh__title span { font-weight: 500; color: var(--ink-3); margin-left: 6px; }
.dk .sh__title { font-size: 28px; font-weight: 750; letter-spacing: -.02em; line-height: 44px; }
.dk .sh__title span { font-size: 17px; letter-spacing: 0; }
.ph .sh { min-height: 44px; }
.sh .link { margin-left: auto; height: 44px; padding: 0 12px; border-radius: 13px; color: var(--ink-3); font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.sh .link .i { width: 18px; height: 18px; }
.sheet-search { margin: 8px 12px 6px; height: 48px; padding: 0 14px; border-radius: 14px; font-size: 16px; }
.dk .sheet-search { margin: 16px 34px 6px 36px; height: 46px; font-size: 15.5px; }
.day { padding: 18px 16px 4px 68px; font-size: 14px; font-weight: 650; color: var(--ink-3); }
.dk .day { padding: 22px 26px 6px 96px; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; }
.day + .row::before { display: none; }
.empty { margin: 32px 24px; padding: 22px 20px; border-radius: 14px; background: var(--deep); color: var(--ink-2); font-size: 15px; text-align: center; line-height: 1.45; }
.dk .empty { margin: 40px 36px; }
.netbar { margin: 0 12px 10px; padding: 10px 14px; border-radius: 12px; background: var(--deep); color: var(--ink-2); font-size: 14.5px; display: flex; gap: 8px; align-items: center; }
.netbar .i { width: 18px; height: 18px; color: var(--ink-3); }
.dk .netbar { margin: 12px 34px 0 36px; }
.updated { font-size: 15px; color: var(--ink-3); font-weight: 500; }

/* «Завершено»: жетоны погашены, справа знак закрытия */
.tag--off { opacity: .55; filter: saturate(.35); }
.row.is-closed .row__name { color: var(--ink-2); }
.done-mark { width: 44px; height: 44px; display: grid; place-items: center; }
.done-mark::before { content: ""; width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--ink-3) 85%, var(--sheet)) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><path d='M6.5 12.5l3.6 3.6 7.4-7.8'/></svg>") center/17px no-repeat; }
[data-theme="dark"] .done-mark::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23231F1B' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'><path d='M6.5 12.5l3.6 3.6 7.4-7.8'/></svg>"); }
.done-mark.is-removed::before { background: transparent; border: 2px dashed var(--ring); width: 24px; height: 24px; }
.ph .done-mark { grid-column: 3; grid-row: 1; align-self: start; margin-top: -10px; }
.status-word { color: var(--ink-3); font-weight: 650; }
.pat-chev { width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink-3); }
.ph .pat-chev { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
.count-open { color: var(--ink); font-weight: 650; }
.mark { background: color-mix(in srgb, var(--me) 18%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---------- компьютер ---------- */
.dk .sheet { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--ring) transparent; }
.dk__bar .tabs .tab { cursor: pointer; }
.dk__bar .search { cursor: text; }
.dk__bar .new-btn, .lock, .me, .tab { cursor: pointer; }
.brand__text { line-height: 1.2; }
@media (max-width: 1279px) {
  .dk { padding: 0 24px; }
  .dk__bar { gap: 10px; }
  .dk__bar .search { width: 220px; }
}
@media (max-width: 1180px) { .brand__text { display: none; } .brand { margin-right: 0; } }
@media (max-width: 1060px) { .lock__label { display: none; } .lock { padding: 0 12px; } .dk__bar .search { width: 190px; } }
.dk .cols { position: relative; }

/* ---------- меню пользователя ---------- */
.menu { position: fixed; z-index: 60; width: 300px; max-width: calc(100vw - 24px); padding: 8px; border-radius: 18px; background: var(--sheet); box-shadow: var(--shadow-console), 0 0 0 1px var(--line); }
.menu__who { display: flex; align-items: center; gap: 12px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); }
.menu__who b { display: block; font-size: 16px; font-weight: 650; }
.menu__who span { display: block; font-size: 14px; color: var(--ink-3); margin-top: 1px; }
.menu__label { padding: 12px 10px 6px; font-size: 13px; font-weight: 650; color: var(--ink-3); }
.seg { display: flex; padding: 3px; gap: 3px; border-radius: 13px; background: var(--deep); box-shadow: inset 0 1px 2px rgba(80,55,30,.10); }
[data-theme="dark"] .seg { box-shadow: inset 0 1px 2px rgba(0,0,0,.4); }
.seg button { flex: 1; min-height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; font-weight: 600; color: var(--ink-3); text-align: center; }
.seg button .i { width: 18px; height: 18px; }
.seg button[aria-pressed="true"], .seg button[aria-checked="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 2px rgba(60,36,16,.16), 0 0 0 1px var(--line); }
.menu .seg { margin: 0 2px; }
.menu .seg button { font-size: 14px; padding: 0 4px; gap: 5px; }
.menu__item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin-top: 8px; padding: 0 12px; border-radius: 12px; font-size: 15.5px; font-weight: 600; color: var(--ink-2); border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; }
.menu__item:hover { background: var(--deep); }
.menu__item .i { width: 20px; height: 20px; color: var(--ink-3); }

/* ---------- тост ---------- */
.toast { position: fixed; z-index: 70; left: 12px; right: 12px; bottom: calc(92px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 6px 6px 6px 18px; border-radius: 18px;
  background: var(--ink); color: var(--bg); box-shadow: 0 12px 30px -10px rgba(0,0,0,.45); font-size: 15px;
  animation: toast-in .2s ease-out; }
.toast__t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast__t b { font-weight: 700; }
.toast button { flex: none; height: 44px; padding: 0 14px; border-radius: 13px; font-weight: 700; color: var(--bg); background: color-mix(in srgb, var(--bg) 14%, transparent); }
.toast.is-plain { padding-right: 18px; }
.dk-mode .toast { bottom: 32px; left: 50%; right: auto; transform: translateX(-50%); width: 520px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.dk-mode .toast { animation: none; }

/* ---------- слои: карточка, форма, пациент ---------- */
.ov { position: fixed; inset: 0; z-index: 40; }
.ov__scrim { position: absolute; inset: 0; background: var(--bg); }
.ov__panel { position: relative; z-index: 1; height: 100%; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); -webkit-overflow-scrolling: touch; }
.ov__panel::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: var(--grain-op); z-index: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.25  0 0 0 0 0.15  0 0 0 1 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.ov__top { position: relative; z-index: 2; display: flex; align-items: center; gap: 4px; height: 56px; padding: 6px 8px 0; }
.ov__back { display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 12px 0 6px; border-radius: 13px; font-size: 16px; font-weight: 650; color: var(--ink-2); }
.ov__back .i { width: 22px; height: 22px; }
.ov__title { flex: 1; text-align: center; font-size: 16px; font-weight: 700; color: var(--ink); margin-right: 52px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov__x { display: none; width: 44px; height: 44px; border-radius: 13px; place-items: center; color: var(--ink-2); }
.ov .board { margin: 30px 8px 0; border-radius: 22px 22px 0 0; padding: 12px 8px 0; min-height: calc(100vh - 86px); min-height: calc(100dvh - 86px); }
.ov .clip { top: -14px; width: 112px; height: 30px; margin-left: -56px; }
.ov .sheet { border-radius: 14px 14px 0 0; padding: 22px 16px calc(130px + env(safe-area-inset-bottom)); min-height: calc(100vh - 106px); min-height: calc(100dvh - 106px); }
.ov__foot { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; padding: 18px 12px calc(18px + env(safe-area-inset-bottom)); display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: linear-gradient(to bottom, transparent 0, var(--bg) 18px); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: 17px; font-size: 16.5px; font-weight: 650; text-align: center; }
.btn .i { width: 22px; height: 22px; }
.btn--main { flex: 1; background: var(--me); color: var(--me-ink); box-shadow: inset 0 1px 0 rgba(255,255,255,.22), 0 2px 4px rgba(20,60,48,.25), 0 12px 24px -10px rgba(20,60,48,.55); }
.btn--soft { background: var(--sheet); color: var(--ink); box-shadow: var(--shadow-console); }
.btn--danger { background: var(--urgent); color: var(--urgent-ink); }
.btn[disabled] { opacity: .55; cursor: default; }

/* карточка задачи */
.card-head { display: flex; align-items: center; gap: 16px; }
.tag--lg { width: 64px; height: 64px; }
.tag--lg svg { width: 40px; height: 40px; }
.tag--lg .ini { font-size: 27px; }
.tag--lg::before { top: -7px; width: 12px; height: 12px; margin-left: -6px; border-width: 2.5px; }
.card-name { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; color: var(--ink); overflow-wrap: anywhere; }
.card-owner { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; margin: -4px 0 -10px -2px; padding: 0 4px 0 2px; border-radius: 10px; font-size: 16px; color: var(--ink-2); text-align: left; }
.card-owner .i { width: 18px; height: 18px; color: var(--ink-3); }
.card-owner:hover { color: var(--ink); }
.card-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 16px; font-size: 15px; color: var(--ink-3); }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px; border-radius: 9px; background: var(--deep); color: var(--ink-2); font-size: 14px; font-weight: 600; }
.pill .i { width: 15px; height: 15px; }
.pill--urg { background: var(--urgent); color: var(--urgent-ink); }
.card-text { margin-top: 14px; font-size: 17px; line-height: 1.5; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.tool { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 14px 0 12px; border-radius: 13px; background: var(--deep); color: var(--ink-2); font-size: 15px; font-weight: 600; box-shadow: inset 0 1px 2px rgba(80,55,30,.10); }
[data-theme="dark"] .tool { box-shadow: inset 0 1px 2px rgba(0,0,0,.4); }
.tool .i { width: 19px; height: 19px; }
.tool[aria-pressed="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 2px rgba(60,36,16,.16), 0 0 0 1.5px var(--ring); }
.tool--urg[aria-pressed="true"] { background: var(--urgent); color: var(--urgent-ink); box-shadow: none; }
.tool--danger { color: var(--urgent); }
[data-theme="dark"] .tool--danger { color: #FF8E72; }
.confirm { margin-top: 14px; padding: 14px; border-radius: 14px; background: var(--deep); }
.confirm p { font-size: 15px; color: var(--ink-2); margin-bottom: 10px; }
.confirm .row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.confirm .btn { min-height: 44px; font-size: 15px; padding: 0 16px; border-radius: 13px; }
.who { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.who h3, .sec-h { font-size: 14px; font-weight: 650; color: var(--ink-3); margin-bottom: 8px; }
.who ol { list-style: none; display: grid; gap: 2px; }
.who li { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 15px; color: var(--ink-2); }
.who li b { font-weight: 650; color: var(--ink); }
.who li b.me { color: var(--me); }
.who .when-t { color: var(--ink-3); white-space: nowrap; }
.who li > span { min-width: 0; }
.av--sm { width: 30px; height: 30px; font-size: 11.5px; flex: none; }
.av--sm.is-guest { font-size: 12px; }
.av--staff { background: var(--deep); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.av--staff.is-me { background: var(--me); color: var(--me-ink); box-shadow: none; }

/* форма */
.f-seg { margin-bottom: 18px; }
.field { display: block; margin-top: 16px; position: relative; }
.field > span, .field-l { display: block; font-size: 14px; font-weight: 650; color: var(--ink-3); margin-bottom: 7px; }
.inp { display: block; width: 100%; min-height: 50px; padding: 12px 14px; border-radius: 14px; border: 0; background: var(--deep); color: var(--ink); font-size: 16px; box-shadow: inset 0 1.5px 3px rgba(80,55,30,.10); outline: none; }
[data-theme="dark"] .inp { box-shadow: inset 0 1.5px 3px rgba(0,0,0,.45); }
.inp:focus { box-shadow: inset 0 1.5px 3px rgba(80,55,30,.10), 0 0 0 2px color-mix(in srgb, var(--me) 60%, transparent); }
.inp::placeholder { color: var(--ink-3); opacity: .85; }
textarea.inp { min-height: 128px; resize: vertical; line-height: 1.45; }
.inp[type="date"] { min-height: 44px; padding: 8px 10px; width: auto; min-width: 150px; background: var(--sheet); box-shadow: 0 0 0 1px var(--line); }
.suggest { position: absolute; z-index: 5; left: 0; right: 0; top: 100%; margin-top: 6px; padding: 6px; border-radius: 14px; background: var(--sheet); box-shadow: var(--shadow-console), 0 0 0 1px var(--line); list-style: none; }
.suggest button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 8px; border-radius: 10px; text-align: left; }
.suggest button:hover, .suggest button:focus-visible { background: var(--deep); }
.suggest b { font-weight: 650; }
.suggest small { display: block; font-size: 13.5px; color: var(--ink-3); }
.suggest .tag::before { display: none; }
.chips { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.chip { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: 76px; padding: 10px 2px 6px; border-radius: 14px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); text-align: center; }
.chip .tag { width: 40px; height: 40px; }
.chip .tag svg { width: 26px; height: 26px; }
.chip .tag::before { display: none; }
.chip[aria-pressed="true"] { background: var(--deep); color: var(--ink); box-shadow: inset 0 0 0 2px var(--me); }
.opts { margin-top: 20px; border-radius: 16px; background: var(--deep); padding: 2px 14px; }
.opt { display: flex; align-items: center; gap: 12px; min-height: 56px; font-size: 16px; color: var(--ink); }
.opt + .opt { border-top: 1px solid color-mix(in srgb, var(--ink-3) 18%, transparent); }
.opt > .i { width: 22px; height: 22px; color: var(--ink-3); }
.opt__l { flex: 1; min-width: 0; }
.opt__l small { display: block; font-size: 13.5px; color: var(--ink-3); }
.sw { position: relative; width: 52px; height: 32px; border-radius: 16px; background: color-mix(in srgb, var(--ink-3) 30%, var(--deep)); flex: none; transition: background .15s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: var(--sheet); box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.sw[aria-checked="true"] { background: var(--me); }
.sw.sw--urg[aria-checked="true"] { background: var(--urgent); }
.sw[aria-checked="true"]::after { transform: translateX(20px); }
.opt-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; text-align: left; font-size: 16px; }
.f-err { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--urgent) 10%, var(--sheet)); color: var(--ink); font-size: 15px; }
.sig { flex: 1 0 100%; display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink-3); min-width: 0; }
.sig b { color: var(--ink); font-weight: 650; }
.sig .av { width: 26px; height: 26px; font-size: 10.5px; flex: none; }
.sig > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* карточка пациента */
.pat-stats { margin-top: 12px; font-size: 15px; color: var(--ink-3); }
.btn--wide { width: 100%; margin-top: 18px; background: var(--deep); color: var(--ink); min-height: 52px; box-shadow: inset 0 1px 2px rgba(80,55,30,.10); }
.ov .sec-h { margin: 26px 0 0; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.ov .rows { margin: 0 -16px; }
.ov .rows .row:first-child::before { display: none; }
.ov .empty { margin: 14px 0 0; }

/* ---------- вход ---------- */
.login { min-height: 100vh; min-height: 100dvh; padding: 56px 12px 40px; }
.login__wrap { max-width: 440px; margin: 0 auto; }
.login .board { margin-top: 60px; border-radius: 22px; padding: 12px 8px; }
.login .clip { top: -14px; width: 112px; height: 30px; margin-left: -56px; }
.login .cat { right: 22px; width: 118px; height: 42px; }
.login .sheet { border-radius: 14px; padding: 34px 20px 24px; }
.login__brand { display: flex; align-items: center; gap: 12px; }
.login__brand .brand__mark { width: 44px; height: 44px; border-radius: 14px; }
.login__brand .brand__mark svg { width: 28px; height: 28px; }
.login h1 { font-size: 24px; font-weight: 750; letter-spacing: -.02em; line-height: 1.15; }
.login h1 small { display: block; font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--ink-3); margin-top: 2px; }
.login form { margin-top: 22px; }
.login .btn--main { width: 100%; margin-top: 20px; }
.login__err { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; padding: 11px 14px; border-radius: 12px; background: var(--deep); color: var(--ink); font-size: 15px; }
.login__err .i { width: 20px; height: 20px; color: var(--urgent); flex: none; }
[data-theme="dark"] .login__err .i { color: #FF8E72; }
.or { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; color: var(--ink-3); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn--guest { display: flex; width: 100%; flex-direction: column; gap: 1px; min-height: 60px; text-decoration: none; background: var(--deep); color: var(--ink); box-shadow: inset 0 1px 2px rgba(80,55,30,.10); }
[data-theme="dark"] .btn--guest { box-shadow: inset 0 1px 2px rgba(0,0,0,.4); }
.btn--guest small { font-size: 13.5px; font-weight: 500; color: var(--ink-3); }
.login__note { margin: 18px 8px 0; font-size: 14px; color: var(--ink-3); text-align: center; line-height: 1.45; }

/* ---------- компьютер: слои — модалка на планшете ---------- */
@media (min-width: 900px) {
  .ov { display: grid; place-items: start center; overflow-y: auto; padding: 40px 24px; }
  .ov__scrim { position: fixed; background: color-mix(in srgb, #1b1612 46%, transparent); }
  [data-theme="dark"] .ov__scrim { background: rgba(0,0,0,.6); }
  .ov__panel { width: 720px; max-width: 100%; height: auto; overflow: visible; border-radius: 30px; padding: 0 22px 22px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
  .ov__panel::before { position: absolute; border-radius: inherit; }
  .ov__top { height: 64px; padding: 8px 0 0; }
  .ov__back { display: none; }
  .ov__title { text-align: left; margin: 0 0 0 6px; font-size: 17px; }
  .ov__x { display: grid; }
  .ov .board { margin: 18px 0 0; border-radius: 24px; padding: 16px; min-height: 0; }
  .ov .clip { top: -18px; width: 150px; height: 40px; margin-left: -75px; }
  .ov .sheet { border-radius: 16px; padding: 30px 30px 26px; min-height: 0; }
  .ov__foot { position: static; padding: 18px 0 0; background: none; }
  .ov .rows { margin: 0 -30px; }
  .ov .btn--main { flex: 0 1 auto; min-width: 200px; }
  .ov__foot .sig { flex: 1 1 auto; order: -1; }
  .ov[data-kind="form"] .ov__foot .btn--main { flex: none; }
  .login { padding-top: 80px; }
  .card-text { font-size: 16.5px; }
}

/* строки внутри модалки на компьютере: та же сетка, что в листе */
.dk-mode .ov .row { grid-template-columns: 44px 1fr 180px 44px; column-gap: 14px; padding: 14px 16px 14px 30px; }
.dk-mode .ov .row + .row::before { left: 88px; right: 16px; }
.dk-mode .ov .row__name { font-size: 17px; }
.dk-mode .ov .row__owner, .dk-mode .ov .row__l2 { font-size: 15px; }
.dk-mode .ov .row__l2 { margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-mode .ov .row .meta { display: block; line-height: 1.3; min-width: 0; overflow: hidden; }
.dk-mode .ov .row .meta > b, .dk-mode .ov .row .meta > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dk-mode .ov .row .meta > b { font-size: 15px; }
.dk-mode .ov .row--chain-from::after { left: 51px; top: 58px; bottom: -16px; }
.dk-mode .ov .row--chained .row__tag { padding-top: 6px; }

/* вид животного: на телефоне 3 × 2 крупными плашками */
@media (max-width: 899px) {
  .chips { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chips { gap: 4px; }
  .chip { flex-direction: row; justify-content: flex-start; gap: 5px; min-height: 52px; padding: 6px 4px; font-size: 14px; letter-spacing: -.01em; text-align: left; white-space: nowrap; }
  .chip .tag { width: 30px; height: 30px; }
  .chip .tag svg { width: 21px; height: 21px; }
  .chip .tag .ini { font-size: 15px; }
}

/* телефон: строки в модалках (карточка пациента) — ровно как в листе: правила .ph из tokens.css */
@media (max-width: 899px) {
  .ov .rows .row { padding: 12px 6px 12px 12px; }
  .ov .rows .row + .row::before { left: 68px; right: 16px; }
  .ov .rows .row__tag { grid-row: 1 / span 2; padding-top: 2px; }
  .ov .rows .row__body { grid-column: 2 / span 2; grid-row: 1 / span 2; padding-right: 8px; }
  .ov .rows .chk { grid-column: 3; grid-row: 1; align-self: start; margin-top: -10px; position: relative; z-index: 1; }
  .ov .rows .done-mark { grid-column: 3; grid-row: 1; align-self: start; margin-top: -10px; }
  .ov .rows .row__l1 { padding-right: 44px; }
  .ov .rows .meta { margin-top: 5px; }
  .ov .rows .row--chained .row__tag { padding-top: 8px; }
  .ov .rows .row__l2 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 20px; }
  .ov .rows .row--chain-from::after { left: 33px; top: 58px; bottom: -15px; }
  .ov .rows .row--chained.row--chain-from::after { top: 52px; }
}
/* компьютер: модалка не выше окна; шапка и панель действий всегда видны, прокручивается лист */
@media (min-width: 900px) {
  .ov { place-items: center; padding: 24px; overflow: hidden; }
  .ov__panel { display: flex; flex-direction: column; max-height: calc(100vh - 48px); max-height: calc(100dvh - 48px); overflow: hidden; }
  .ov__top { flex: none; }
  .ov__panel > .board { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .ov__panel > .board > .sheet { flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--ring) transparent; }
  .ov__foot { flex: none; }
  /* строки в модалке: правый край кружка и разделителей = правый край контента (поле листа 30px) */
  .dk-mode .ov .rows { margin: 0 -16px; }
  .dk-mode .ov .row { padding: 14px 6px 14px 16px; }
  .dk-mode .ov .row + .row::before { left: 74px; right: 16px; }
  .dk-mode .ov .row--chain-from::after { left: 37px; }
}

.who li.who-wait { color: var(--ink-3); font-size: 15px; }
