/* Shared look of the hub (design of 03.12.2026, after the owner's «Анализ 44» page): IBM Plex Sans, a white sheet
   on a soft gradient, tinted cards, pill controls, rows instead of tables where a row says it all.
   Page-specific rules live in the page's own <style>. */
@font-face{font-family:"IBM Plex Sans";font-weight:400 700;font-display:swap;src:url(/fonts/cyrillic.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"IBM Plex Sans";font-weight:400 700;font-display:swap;src:url(/fonts/latin.woff2) format("woff2");unicode-range:U+0000-00FF,U+2000-206F,U+20AC,U+2122,U+2212}
:root{color-scheme:light;
  --brand:#0D9488;--brand-h:#007D79;--deep:#004144;--soft:#f0fdfa;--bead:#CCFBF1;
  --ink:#161616;--mute:#525252;--faint:#5b6b7a;--border:#d5dcdf;--line:#e3ebe8;--card:#F3F7F6;--hover:#e7f1ee;--field:#7c8d94;
  --ok:#d1fae5;--ok-t:#065f46;--warn:#fef3c7;--warn-t:#78350f;--err:#fee2e2;--err-t:#991b1b;--focus:#165e9c;
  --accent:var(--brand-h);--bg:var(--card);
  --r-sheet:26px;--r-card:20px;--wide:1340px}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{min-height:100vh;margin:0;color:var(--ink);font:15px/1.5 "IBM Plex Sans",system-ui,"Segoe UI",sans-serif;font-variant-numeric:tabular-nums;
  background:radial-gradient(70% 38% at 12% 102%,rgba(45,212,191,.42),transparent 70%),radial-gradient(55% 30% at 92% 98%,rgba(156,54,181,.16),transparent 72%),radial-gradient(80% 40% at 50% -8%,rgba(153,246,228,.55),transparent 70%),linear-gradient(180deg,#EAF4F2,#E3EFED) fixed}
body.narrow{--wide:760px}
[hidden]{display:none!important}
h1,h2,h3,p{margin:0 0 8px}
h1{font-size:clamp(1.7rem,3vw,2.5rem);font-weight:650;line-height:1.1;letter-spacing:-.035em;color:var(--deep);overflow-wrap:anywhere}
h2{font-size:1.15rem;font-weight:600;line-height:1.3;letter-spacing:-.01em;color:var(--deep)}
h3{font-size:1rem;font-weight:600;color:var(--deep)}
h1[tabindex="-1"]:focus{outline:none}
a{color:var(--brand-h)}
img{max-width:100%}
button,input,select,textarea{font:inherit;color:inherit}
small,.muted{color:var(--faint)}
small{font-size:.86rem}
summary{min-height:44px;padding:10px 0;font-weight:500;cursor:pointer}
details.more>summary{padding-left:6px;color:var(--brand-h)}
:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.nw{white-space:nowrap}

/* Top bar: brand, search, bell, user */
.top{position:relative;display:flex;align-items:center;gap:12px;max-width:var(--wide);margin:0 auto;padding:12px 18px 12px 24px}
.brand{display:flex;align-items:center;gap:10px;min-width:0;color:var(--brand-h);font-size:1.1rem;font-weight:600;letter-spacing:-.01em;text-decoration:none}
.brand svg{flex:none}
.brand span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.brand small{flex:none;padding:1px 9px;border-radius:999px;background:rgba(255,255,255,.7);color:var(--mute);font-size:.78rem;font-weight:500;letter-spacing:0}
.search{position:relative;flex:1 1 240px;max-width:560px;margin-left:auto}
.search input{width:100%;min-height:44px;padding:10px 18px 10px 44px;border:1px solid rgba(255,255,255,.7);border-radius:999px;background:rgba(255,255,255,.72);backdrop-filter:blur(14px)}
.search input::placeholder{color:var(--faint)}
.search input:focus{outline:none;border-color:#14b8a6;background:#fff;box-shadow:0 0 0 3px var(--bead)}
.search>svg{position:absolute;z-index:1;top:13px;left:16px;color:var(--faint);pointer-events:none}
.found{position:absolute;z-index:40;top:50px;left:0;right:0;max-height:min(70vh,560px);padding:6px;overflow:auto;border-radius:18px;background:#fff;box-shadow:0 14px 30px -12px rgba(0,65,68,.35)}
.found button{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:0 12px;width:100%;min-height:52px;padding:8px 12px;border:0;border-radius:12px;background:none;text-align:left;cursor:pointer}
.found button:hover,.found button.on{background:var(--soft)}
.found b{font-weight:500}
.found small{grid-column:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.found .tag{grid-column:2;grid-row:1/3;align-self:center}
.found p{margin:0;padding:10px 12px;color:var(--faint)}
.top-actions{display:flex;flex:none;align-items:center;gap:8px}
@media (min-width:640px){.search+.top-actions{margin-left:0}}
.top-actions{margin-left:auto}
.bell{position:relative;display:inline-grid;place-items:center;width:44px;height:44px;border:0;border-radius:50%;background:rgba(255,255,255,.72);cursor:pointer}
.bell:hover,.me:hover{background:#fff}
.bell .count{position:absolute;top:-4px;right:-6px}
.me{display:flex;align-items:center;gap:8px;max-width:min(26ch,46vw);min-height:44px;padding:4px 14px 4px 4px;border:0;border-radius:999px;background:rgba(255,255,255,.72);cursor:pointer;white-space:nowrap}
.me b{display:grid;place-items:center;flex:none;width:36px;height:36px;border-radius:50%;background:var(--brand-h);color:#fff;font-size:.82rem;font-weight:600}
.me span{overflow:hidden;text-overflow:ellipsis}
.usermenu{position:absolute;z-index:40;top:62px;right:18px;display:flex;flex-direction:column;min-width:240px;max-width:calc(100vw - 24px);padding:6px;border-radius:18px;background:#fff;box-shadow:0 14px 30px -12px rgba(0,65,68,.35)}
.usermenu a,.usermenu button{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;min-height:44px;padding:10px 14px;border:0;border-radius:12px;background:none;color:var(--ink);text-align:left;text-decoration:none;cursor:pointer}
.usermenu a:hover,.usermenu button:hover{background:var(--soft)}
.usermenu hr{width:100%;margin:6px 0;border:0;border-top:1px solid var(--line)}
.usermenu form{margin:0}
.usermenu small{padding:6px 14px 2px}

/* Sheet and page head */
main{display:block}
.sheet{max-width:var(--wide);min-height:calc(100vh - 68px);margin:0 auto;padding:28px clamp(14px,3vw,36px) 60px;border-radius:var(--r-sheet) var(--r-sheet) 0 0;background:#fff;box-shadow:0 1px 1px rgba(0,65,68,.06),0 14px 30px -12px rgba(0,65,68,.18)}
.head{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:16px;margin:0 0 22px}
.head>div:first-child{min-width:0}
.head h1{margin:2px 0 0}
.eyebrow{margin:0;color:var(--brand-h);font-size:.8rem;font-weight:500;letter-spacing:.06em;text-transform:uppercase}
.lead{margin:6px 0 0;color:var(--faint);font-size:.92rem}
.tools,.toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.back{display:inline-flex;align-items:center;gap:4px;min-height:44px;margin:-10px 0 4px -6px;padding:0 10px 0 6px;border-radius:999px;color:var(--mute);font-weight:500;text-decoration:none}
.back:hover{background:var(--card);color:var(--deep)}
.linklike{display:inline-flex;align-items:center;min-height:44px;padding:4px 2px;border:0;background:transparent;color:var(--brand-h);font-weight:500;text-align:left;text-decoration:underline;text-decoration-color:#99f6e4;text-underline-offset:3px;cursor:pointer}
.linklike:hover{text-decoration-color:currentColor}
.icon{width:20px;height:20px;flex:none;vertical-align:middle;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
.count{display:inline-block;flex:none;min-width:22px;padding:0 6px;border-radius:11px;background:var(--brand-h);color:#fff;font-size:.78rem;font-weight:600;line-height:22px;text-align:center}
.seg{display:inline-flex;flex-wrap:wrap;gap:2px;max-width:100%;margin:0 0 18px;padding:4px;border-radius:24px;background:var(--card)}
.seg a{display:inline-flex;align-items:center;min-height:36px;padding:4px 16px;border-radius:999px;color:var(--mute);font-weight:500;text-decoration:none;white-space:nowrap}
.seg a:hover{color:var(--deep)}
.seg a[aria-current=page]{background:#fff;color:var(--deep);box-shadow:0 1px 3px rgba(0,65,68,.15)}

/* Layout blocks */
.card,.work-card{min-width:0;margin:0 0 18px;padding:20px 22px;border-radius:var(--r-card);background:var(--card)}
.card>:last-child,.work-card>:last-child{margin-bottom:0}
.card-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:4px 12px;margin:0 0 8px}
.card-head h2{margin:0}
.stack{display:flex;flex-direction:column;gap:12px}
.stack>*{margin-top:0;margin-bottom:0}
.stack>.btn:not(.big){align-self:flex-start}
.row{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.row>.field,.row>input,.row>select{flex:1 1 12rem;width:auto}
.hero,.home{display:grid;gap:18px;align-items:start;margin:0 0 18px}
.hero>*,.home>*{min-width:0;margin:0}
.grid2{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(400px,100%),1fr));gap:14px;align-items:start}
.grid2>*{margin:0}
section.block{margin:30px 0 0}
section.block>.card-head{margin-bottom:12px}

/* Buttons */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:8px 18px;border:1px solid var(--border);border-radius:999px;background:#fff;color:var(--ink);font-weight:500;line-height:1.25;text-align:center;text-decoration:none;cursor:pointer;touch-action:manipulation}
.btn:hover{background:#f4f8f7}
.btn:disabled{opacity:.55;cursor:default;pointer-events:none}
.btn.primary{border-color:var(--brand-h);background:var(--brand-h);color:#fff}
.btn.primary:hover{border-color:#00635f;background:#00635f}
.btn.danger{border-color:#eab8ad;color:var(--err-t)}
.btn.danger:hover{background:var(--err)}
.btn.big{display:flex;width:100%;min-height:54px;font-size:1.05rem}
.btn.sm{min-height:36px;padding:4px 14px;font-size:.9rem}
.btn.link{min-height:36px;padding:4px 6px;border-color:transparent;background:transparent;color:var(--brand-h);text-decoration:underline;text-decoration-color:#99f6e4;text-underline-offset:3px}
.btn.link:hover{text-decoration-color:currentColor}

/* Form controls */
input:where(:not([type=checkbox]):not([type=radio]):not([type=file])),select,textarea{display:block;width:100%;min-height:44px;padding:8px 16px;border:1px solid var(--field);border-radius:22px;background:#fff;color:var(--ink)}
textarea{min-height:88px;border-radius:16px;resize:vertical}
select[size]{padding:6px;border-radius:16px}
select[size] option{padding:6px 10px;border-radius:8px}
input:where(:not([type=checkbox]):not([type=radio])):focus,select:focus,textarea:focus{outline:none;border-color:#14b8a6;box-shadow:0 0 0 3px var(--bead)}
input[type=file]{max-width:100%;min-height:44px}
input[type=file]::file-selector-button{min-height:40px;margin-right:10px;padding:6px 16px;border:1px solid var(--border);border-radius:999px;background:#fff;color:var(--ink);font:inherit;font-weight:500;cursor:pointer}
input[type=checkbox],input[type=radio]{flex:none;width:20px;height:20px;margin:0;accent-color:var(--brand-h)}
label:has(>input[type=checkbox]),label:has(>input[type=radio]){display:flex;align-items:center;gap:10px;min-height:44px;font-weight:400;cursor:pointer}
.field{display:flex;flex-direction:column;gap:4px;color:var(--mute);font-size:.9rem;font-weight:500}
.field input,.field select,.field textarea{font-size:1rem;font-weight:400}
.field small{font-weight:400}
fieldset{min-width:0;margin:0;padding:0;border:0}
legend{margin-bottom:4px;padding:0;color:var(--mute);font-size:.9rem;font-weight:500}
.presets{display:flex;flex-wrap:wrap;gap:6px;margin:2px 0 6px}
.chip{min-height:44px;padding:4px 14px;border:1px solid var(--border);border-radius:999px;background:#fff;color:var(--ink);font-size:.9rem;font-weight:400;cursor:pointer}
.chip:hover{border-color:var(--brand);background:var(--soft)}

/* Tables: only where columns are compared; labelled rows (td[data-label]) under 640 px */
table.grid{width:100%;border-collapse:collapse;font-size:.93rem}
table.grid th,table.grid td{padding:9px 8px;border-top:1px solid var(--line);text-align:left;vertical-align:middle;overflow-wrap:anywhere}
table.grid th{border-top:0;color:var(--faint);font-size:.8rem;font-weight:500;vertical-align:bottom;overflow-wrap:normal}
table.grid .btn{white-space:nowrap}
table.grid .linklike{text-align:left}
.num,table.grid .num{text-align:right}
table.grid tr.rowlink{cursor:pointer}
table.grid tr.rowlink:hover td{background:var(--hover)}
@media (max-width:639.98px){
  table.grid,table.grid tbody,table.grid tr,table.grid td{display:block;width:100%}
  table.grid thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
  table.grid tr{padding:8px 0;border-top:1px solid var(--line)}
  table.grid td{display:flow-root;padding:4px 0;border:0}
  table.grid td,table.grid td.num{text-align:left}
  /* Label in a fixed left gutter: the float is pulled into the cell's padding by its negative margin, so a wrapped
     value never runs under it, while the flow-root cell still grows to a two-line label. */
  table.grid td[data-label]{padding-left:9rem}
  table.grid td[data-label]::before{content:attr(data-label);float:left;width:8.25rem;margin-left:-9rem;color:var(--faint);font-size:.86rem;line-height:22px}
  table.grid td:has(>label)::before{line-height:44px}
  table.grid td[data-label=""]{padding-left:0}
  table.grid td[data-label=""]::before{content:none}
  table.grid .tag{white-space:normal}
}

/* Status */
.tag{display:inline-block;padding:1px 9px;border-radius:999px;background:#eaf0f3;color:#334155;font-size:.8rem;font-weight:500;line-height:1.5;white-space:nowrap}
.tag.ok{background:var(--ok);color:var(--ok-t)}
.tag.warn{background:var(--warn);color:var(--warn-t)}
.tag.err{background:var(--err);color:var(--err-t)}
.tag.muted{background:#eef1f3;color:var(--mute)}
.error{display:block;padding:10px 14px;border:1px solid #eab8ad;border-radius:14px;background:#fff0ec;color:#7a1f12;font-weight:500}
.notice{display:block;padding:10px 14px;border-left:3px solid #d9a441;border-radius:10px;background:#fdf6e3;color:var(--ink)}
.error:empty,.notice:empty{display:none}
.empty{margin:0;padding:14px 4px;color:var(--faint)}
.toast{position:fixed;bottom:calc(22px + env(safe-area-inset-bottom));left:50%;z-index:100;width:max-content;max-width:min(560px,calc(100vw - 24px));margin:0;padding:10px 18px;border:1px solid #334155;border-radius:14px;background:#1f2937;color:#fff;font-weight:500;box-shadow:0 4px 20px rgba(19,57,45,.14);transform:translateX(-50%);pointer-events:none}
/* The clinic's pages keep a scan button at the bottom of the screen: the message goes to the top there */
body.narrow .toast{top:calc(12px + env(safe-area-inset-top));bottom:auto}
.toast:empty{display:none}
.toast.ok{border-color:#b4d4c0;background:#e1f2e9;color:var(--ok-t)}
.toast.error{border-color:#e7b1a5;background:#fff0ec;color:#7a1f12}

/* Action bar: stays at the bottom of the screen while the list scrolls */
.bar{position:sticky;bottom:0;z-index:5;display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:14px -8px 0;padding:10px 12px calc(10px + env(safe-area-inset-bottom));border:1px solid var(--line);border-radius:22px 22px 0 0;background:rgba(255,255,255,.94);backdrop-filter:blur(10px);box-shadow:0 -8px 24px -14px rgba(0,65,68,.35)}
.bar>.btn{flex:1 1 auto;min-height:50px}
.bar>.btn.icon-only{flex:none;width:54px;padding:0}
.bar>.btn.grow{flex:4 1 auto}
li>label.lrow{cursor:pointer}
@media (min-width:640px){.bar>.btn{flex:none}.bar>.btn.grow{flex:none}}

/* Dialogs: openDialog builds .dtop (title, close) and .dbody */
dialog{width:min(720px,calc(100vw - 20px));max-width:none;max-height:calc(100vh - 24px);max-height:calc(100dvh - 24px);padding:0;overflow:auto;border:0;border-radius:24px;background:#fff;color:var(--ink);box-shadow:0 30px 60px -20px rgba(0,40,40,.45)}
dialog.wide{width:min(1040px,calc(100vw - 20px))}
dialog::backdrop{background:rgba(0,40,40,.32);backdrop-filter:blur(3px)}
.dtop{position:sticky;top:0;z-index:2;display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:18px 18px 12px 24px;border-bottom:1px solid var(--line);background:#fff}
.dtop h2{margin:0;font-size:1.3rem;line-height:1.25;overflow-wrap:anywhere}
.dtop .eyebrow{margin-bottom:2px}
.dtop .dsub{margin:2px 0 0;color:var(--faint);font-size:.92rem}
.dbody{padding:16px 24px 24px}
.dbody>:last-child{margin-bottom:0}
/* The buttons of a dialog form stay in sight under a long list (the lens picker) */
dialog form>.row:has(>[type=submit]){position:sticky;bottom:0;z-index:1;margin:0 -24px -24px;padding:12px 24px calc(14px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:#fff}
.x{flex:none;width:44px;height:44px;border:0;border-radius:50%;background:var(--card);color:var(--mute);font-size:1.4rem;line-height:1;cursor:pointer}
.x:hover{background:var(--hover);color:var(--deep)}
dialog.full{width:100%;height:100%;max-height:none;margin:0;border-radius:0;background:#0b1217;color:#fff;box-shadow:none}
dialog.full[open]{display:flex;flex-direction:column}
dialog.full .dtop{position:static;border:0;background:transparent}
dialog.full .dtop h2{color:#fff}
dialog.full .x{background:rgba(255,255,255,.14);color:#fff}
dialog.full .dbody{display:flex;flex:1;flex-direction:column;gap:12px;min-height:0;padding:0 12px calc(12px + env(safe-area-inset-bottom))}
dialog.full::backdrop{background:#000}
dialog.full video{display:block;flex:1;width:100%;min-height:0;border-radius:14px;background:#000;object-fit:cover}
dialog.full .muted,dialog.full small{color:#c4d0d6}
dialog.full .btn.link,dialog.full a{color:#fff}
dialog.full :focus-visible{outline-color:#fff}
/* Camera result line: the only feedback while scanning, read at arm's length */
dialog.full [data-line]{margin:0;padding:8px 14px;border-radius:12px;font-size:1.125rem;font-weight:600;line-height:1.4}
dialog.full [data-line].ok{background:var(--ok);color:var(--ok-t)}
dialog.full [data-line].err{background:var(--err);color:var(--err-t)}

/* Photo preview */
.thumb{display:block;max-width:160px;max-height:160px;border:1px solid var(--line);border-radius:14px;background:#fff;object-fit:cover}
button.thumb{padding:0;overflow:hidden;cursor:pointer}
.thumb img{display:block;max-width:100%;max-height:158px;object-fit:cover}

/* The number card: one big figure, up to four readings, a bar of the same parts */
.kpi{position:relative;isolation:isolate;display:flex;flex-direction:column;overflow:hidden;margin:0 0 18px;padding:24px 26px;border-radius:var(--r-card);background:var(--deep);color:#fff}
.kpi::after{content:"";position:absolute;z-index:-1;top:-70px;right:-70px;width:240px;height:240px;border-radius:50%;box-shadow:0 0 0 26px rgba(45,212,191,.09),0 0 0 60px rgba(45,212,191,.06),0 0 0 96px rgba(45,212,191,.04);pointer-events:none}
.kpi-top{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:36px}
.kpi .lbl{color:#b9e0db;font-size:.92rem}
.kpi .big{margin:2px 0 0;font-size:3.4rem;font-weight:600;line-height:1;letter-spacing:-.06em}
.kpi .big small{margin-left:8px;color:#b9e0db;font-size:.95rem;font-weight:400;letter-spacing:0}
.kpi .btn{border-color:rgba(255,255,255,.35);background:transparent;color:#fff}
.kpi .btn:hover{background:rgba(255,255,255,.12)}
.kpi :focus-visible{outline-color:#fff}
.kgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(88px,1fr));gap:12px;margin-top:auto;padding-top:22px}
.kgrid>*{min-width:0;color:#fff;text-decoration:none}
.kgrid b{display:block;font-size:1.35rem;font-weight:600;letter-spacing:-.03em}
.kgrid span{color:#b9e0db;font-size:.82rem}
.kgrid a:hover span{color:#fff;text-decoration:underline;text-underline-offset:3px}
.kgrid i{display:inline-block;width:8px;height:8px;margin-right:6px;border-radius:50%}
.track{display:flex;gap:2px;height:8px;margin-top:18px;overflow:hidden;border-radius:99px;background:#165a5c}
.track i{min-width:0}
.c1{background:#5eead4}.c2{background:#a7cbdc}.c3{background:#edc98c}

/* Rows: an icon, a title with a line under it, a number, an arrow. The whole row is the link. */
.qrow{display:flex;align-items:center;gap:12px;min-height:56px;padding:9px 6px;border-top:1px solid var(--line);border-radius:10px;color:var(--ink);text-decoration:none}
:not(.qrow)+.qrow,.qrow:first-child{border-top:0}
a.qrow:hover,button.qrow:hover{background:var(--hover)}
button.qrow{width:100%;border-width:1px 0 0;border-style:solid;border-color:var(--line);background:none;text-align:left;cursor:pointer}
.ic{display:grid;place-items:center;flex:none;width:36px;height:36px;border-radius:11px;background:#dcebe5;color:#1d6650;font-size:.8rem;font-weight:600}
.ic.issue{background:#fde5df;color:#8f2d1c}
.ic.time{background:#fff0d7;color:#795218}
.ic.plain{background:#fff;color:var(--mute);box-shadow:inset 0 0 0 1px var(--line)}
.tx{flex:1;min-width:0}
.tx b,.tx small{display:block}
.tx b{font-weight:500;line-height:1.3}
.tx small{margin-top:1px;line-height:1.35}
.qrow .n{flex:none;min-width:1.5ch;color:var(--deep);font-size:1.15rem;font-weight:600;text-align:right}
.go{flex:none;color:var(--faint);font-size:1.2rem;line-height:1}
.qrow>.tag,.qrow>.row{flex:none}
.stats{display:flex;flex:none;flex-wrap:wrap;justify-content:flex-end;gap:6px}
@media (max-width:639.98px){.qrow{flex-wrap:wrap}.stats,.qrow>.row{order:5;flex-basis:100%;justify-content:flex-start;padding-left:48px}}

/* Tiles: the clinic's main sections */
.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(140px,100%),1fr));gap:10px;margin:0 0 18px}
.tile{position:relative;display:flex;flex-direction:column;justify-content:space-between;gap:12px;min-height:96px;padding:14px 16px;border-radius:18px;background:var(--card);color:var(--ink);font-weight:500;text-decoration:none}
.tile:hover{background:var(--hover)}
.tile .count{position:absolute;top:14px;right:14px}
.navtiles .tiles{margin:0}

/* Lenses: one block per catalog item, one row per lens with its serial number (owner, 03.12) */
.lgroup{min-width:0;margin:0 0 14px;padding:14px 18px;border-radius:18px;background:var(--card)}
.lgroup>h3{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;margin:0 0 4px;font-weight:600}
.lgroup>h3 small{font-weight:400}
.lgroup ul{margin:0;padding:0;list-style:none}
.lgroup>p{margin:0}
.lrow{display:grid;grid-template-columns:var(--pk,0px) 8.6rem 7.4rem minmax(0,1fr) auto;align-items:center;min-height:44px;padding:4px 0;border-top:1px solid var(--line)}
.pickable{--pk:32px}
.lrow .pk{grid-column:1}
.lrow .sn{grid-column:2;padding-right:10px;font-weight:500;overflow-wrap:anywhere}
.lrow .ex{grid-column:3;color:var(--mute);white-space:nowrap}
.lrow .info{display:flex;grid-column:4;flex-wrap:wrap;align-items:center;gap:4px 8px;min-width:0}
.lrow .info>small{margin-left:auto}
.lrow .grow{flex:1 1 auto}
.lrow .btn{flex:none}
.lrow label{min-height:36px}
button.sn{min-height:36px;padding:0;border:0;background:none;color:var(--brand-h);text-align:left;text-decoration:underline;text-decoration-color:#99f6e4;text-underline-offset:3px;cursor:pointer}
button.sn:hover{text-decoration-color:currentColor}
td button.sn{font-weight:500}
.lrow .do,.lrow>.btn,.lrow>.del{grid-column:5;margin-left:8px}
.lrow>.btn{min-height:40px}
/* Inventory marks: a tick for a found lens, a ring for one still to find */
.marked{--pk:26px}
.marked .pk{color:var(--faint);font-size:1.05rem;line-height:1}
.marked .pk.ok{color:#047857;font-weight:700}
.lrow.todo .sn,.lrow.todo .ex{color:var(--faint)}
.lgroup .rest{padding:9px 0;border-top:1px solid var(--line);color:var(--faint)}
.del{width:40px;height:40px;border:0;border-radius:50%;background:none;color:var(--err-t);font-size:1.4rem;line-height:1;cursor:pointer}
.del:hover{background:var(--err)}
@media (max-width:639.98px){
  .lrow{grid-template-columns:var(--pk,0px) minmax(0,1fr) auto auto}
  .lrow .do,.lrow>.btn,.lrow>.del{grid-column:4}
  .lrow .info{grid-column:2/-1;grid-row:2;padding-bottom:4px}
  .lrow .info:empty{display:none}
  .lrow .info>small{margin-left:0}
}

/* Facts of a card and a timeline of events */
.metrics{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin:0 0 18px}
.metrics>*{min-width:0;padding:12px 16px;border-radius:16px;background:var(--card)}
.metrics span{display:block;color:var(--mute);font-size:.8rem}
.metrics b{display:block;color:var(--deep);font-size:1.05rem;font-weight:600;overflow-wrap:anywhere}
.metrics b a{color:inherit}
.metrics .tag{white-space:normal}
.sum{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:10px;margin:0 0 12px}
.sum>div{padding:10px 14px;border-radius:14px;background:#fff}
.sum small{display:block}
.sum strong{display:block;color:var(--deep);font-size:1.2rem;font-weight:600}
.events{margin:0;padding:0;list-style:none}
.events li{display:grid;grid-template-columns:8.6rem minmax(0,1fr);gap:2px 14px;padding:9px 0;border-top:1px solid var(--line)}
.events li:first-child{border-top:0}
.events time{color:var(--faint);font-size:.88rem}
.events small{display:block}
.facts{display:grid;grid-template-columns:max-content 1fr;gap:8px 16px;margin:0}
.facts dt{color:var(--faint)}
.facts dd{margin:0}
.notes{display:flex;flex-direction:column;margin:0;padding:0;list-style:none}
.notes a{display:block;padding:10px 0;border-top:1px solid var(--line);color:var(--ink);text-decoration:none}
.notes li:first-child a{border-top:0}
.notes a:hover strong{color:var(--brand-h)}
.notes strong{font-weight:500}
.notes .new strong::after{content:'';display:inline-block;width:8px;height:8px;margin-left:8px;border-radius:50%;background:var(--brand);vertical-align:middle}

/* Bottom tabs on phones and tablets (owner, 03.12: «как приложение»): the sections stay under the thumb while a list
   is scrolled. They replace the documents switch and the clinic's section tiles there. */
.tabs{display:none}
.ck{display:grid;place-items:center;flex:none;width:36px;min-height:44px;cursor:pointer}
@media (max-width:899.98px){
  body.has-tabs{--tabs:calc(62px + env(safe-area-inset-bottom))}
  body.has-tabs .tabs{position:fixed;z-index:30;right:0;bottom:0;left:0;display:flex;gap:2px;padding:6px 4px calc(6px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:rgba(255,255,255,.95);backdrop-filter:blur(12px);box-shadow:0 -8px 24px -16px rgba(0,65,68,.4)}
  .tabs a{position:relative;display:flex;flex:1 1 auto;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-width:0;min-height:50px;padding:0 4px;border-radius:14px;color:var(--mute);font-size:.7rem;font-weight:500;letter-spacing:-.01em;text-decoration:none}
  .tabs a span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .tabs a[aria-current=page]{background:var(--soft);color:var(--brand-h)}
  .tabs .icon{width:22px;height:22px}
  .tabs .count{position:absolute;top:1px;left:calc(50% + 4px);min-width:18px;padding:0 5px;font-size:.68rem;line-height:18px}
  body.has-tabs .sheet{padding-bottom:calc(28px + var(--tabs))}
  body.has-tabs .bar{bottom:var(--tabs)}
  body.has-tabs:not(.narrow) .toast{bottom:calc(14px + var(--tabs))}
  body.has-tabs:not(.narrow):has(main .bar) .toast{bottom:calc(86px + var(--tabs))} /* above the pinned action */
  body.has-tabs .seg,body.has-tabs .navtiles,body.has-tabs .wide-only{display:none}
}
@media (min-width:900px){
  .hero,.home{grid-template-columns:minmax(0,1.1fr) minmax(0,1fr)}
  /* «Работа со складом»: numbers and clinics on the left, the to-do list in full height on the right */
  .home{grid-template-rows:auto 1fr;grid-template-areas:"kpi todo" "list todo"}
  .home>:nth-child(1){grid-area:kpi}
  .home>:nth-child(2){grid-area:todo}
  .home>:nth-child(3){grid-area:list}
}
@media (max-width:639.98px){
  body{background:linear-gradient(180deg,#DDF3EE,#E3EFED 240px)}
  /* iOS zooms into a field with a smaller font */
  input:where(:not([type=checkbox]):not([type=radio])),select,textarea{font-size:16px}
  .top{flex-wrap:wrap;padding:10px 12px}
  .search{order:3;flex-basis:100%;max-width:none}
  .me span{display:none}
  .me{padding:4px}
  .usermenu{right:12px}
  .sheet{padding:22px 14px 48px;border-radius:22px 22px 0 0}
  .card,.work-card{padding:16px}
  .kpi{padding:20px}
  .kpi .big{font-size:2.8rem}
  .dtop{padding:14px 12px 10px 16px}
  .dbody{padding:14px 16px 20px}
  dialog form>.row:has(>[type=submit]){margin:0 -16px -20px;padding-inline:16px}
  dialog{width:calc(100vw - 12px);max-height:calc(100vh - 12px);max-height:calc(100dvh - 12px);border-radius:20px}
  .events li{grid-template-columns:1fr}
}
@media (prefers-reduced-motion:no-preference){
  .btn,.me,.bell,.tile,.qrow,.chip,.back,.seg a,.x{transition:background-color .15s ease-out,color .15s ease-out,border-color .15s ease-out}
  .toast:not(:empty){animation:toast-in .18s ease-out}
  dialog[open]{animation:dialog-in .16s ease-out}
}
@keyframes toast-in{from{opacity:0;transform:translate(-50%,6px)}}
@keyframes dialog-in{from{opacity:0;transform:translateY(8px)}}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}
