/* Diplodok brand layer: the one source of colours, type and shared components for the whole service.
   Source: the clinic's style guide ("Диплодок. Гид по стилю", 2024). Rules are summarised in docs/design-system.md.
   Font: Onest (SIL OFL 1.1), stored in static/brand/, the free stand-in for the guide's TT Norms Pro (owner's decision).
   Nothing is loaded from the internet. */
@font-face{font-family:'Onest';font-style:normal;font-weight:100 900;src:url("../brand/onest-cyrillic-wght-normal.fe2bd26ae82a.woff2") format('woff2');unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:'Onest';font-style:normal;font-weight:100 900;src:url("../brand/onest-latin-wght-normal.3db826ed1c5d.woff2") format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}

:root{
  /* brand colours (style guide, page 13); the neutrals, tints and sizes are the canvas values (docs/design/canvas/tokens.json, docs/design-system.md).
     Contrast is checked with APCA, not WCAG 2: small text never sits on violet or orange; there it uses a tint with a brand-coloured edge. */
  --violet:#9094F8; --orange:#FF8F43; --lime:#C1E06B; --milk:#FFFAE8;
  --surface:#F7F1DC; --white:#fff;
  --ink:#1F2433; --muted:#565B6E; --line:#EAE3CC; --line2:#F1EDDA; --field:#CFCAB0; --field-edge:#80859A;
  --link:#3A3FA8; --focus:#4A4FCC;
  --violet-tint:#E4E5FD; --orange-tint:#FFE6D4; --lime-tint:#EEF6CF;
  --danger:#B3261E; --danger-tint:#FBE4E2;
  /* older names, kept so existing rules keep working; they point at the tokens above */
  --violet7:var(--link); --violet1:var(--violet-tint); --orange1:var(--orange-tint); --lime1:var(--lime-tint);
  --bad:var(--danger); --bad1:var(--danger-tint);
  --orange7:#A04300; --lime7:#3A5A0C; --good:#3A5A0C; --pink1:#FFD9EC; --pinkp:#F7A8D0;
  /* shape and size */
  --r-sm:10px; --r:14px; --r-lg:24px; --radius-pill:9999px; --radius-md:12px; --radius-lg:24px;
  --ctl:40px; --ctl-touch:44px; --size-field:48px; --size-btn-primary:52px; --size-border:2px; --size-focus-ring:3px;
  --dur-fast:120ms; --ease-out:cubic-bezier(0.2,0,0,1);
  --shadow:0 12px 32px rgba(31,36,51,.18);
  --font:"Onest","Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;
  --wrap:1208px;
  color-scheme:light;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--milk);color:var(--ink);font-family:var(--font);font-size:16px;line-height:24px}
/* Medium for headings, Regular for text (style guide, page 10). Generic page styles below are scoped to <main>, so the board's own toolbar and dialogs keep their look. */
main h1,main h2,main h3{font-weight:500;margin:0}
main h1{font-size:32px;line-height:40px;letter-spacing:-.01em} main h2{font-size:24px;line-height:32px} main h3{font-size:20px;line-height:28px}
a{color:var(--link)}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:var(--size-focus-ring) solid var(--focus);outline-offset:2px}
.skip{position:absolute;left:-9999px;top:8px;z-index:100;background:var(--ink);color:#fff;padding:8px 14px;border-radius:var(--r-sm)}
.skip:focus{left:8px}

/* ---------- the shared header (every page, the board too): a white bar with the logo, search and tools, and the tabs under it ---------- */
.site-header{position:relative;z-index:40;background:var(--white);color:var(--ink)}
.site-header a{color:inherit}
.site-header .hd{display:flex;align-items:center;gap:16px;min-height:64px;padding:0 24px}
.site-header .brand{display:flex;align-items:center;min-width:44px;min-height:44px;text-decoration:none;color:var(--ink)}
.site-header .brand img{height:48px;width:auto;display:block}
.site-header .hsearch{position:relative;display:flex;margin-left:auto;width:min(420px,40vw)}
.site-header .hsearch input{width:100%;height:var(--ctl-touch);padding:0 48px 0 44px;border:2px solid var(--line);border-radius:var(--radius-pill);background:var(--white);color:var(--ink)}
.site-header .hsearch input:hover{border-color:var(--field-edge)}
.site-header .hsearch input::placeholder{color:var(--muted)}
.site-header .hsearch .search-ic{position:absolute;left:14px;top:50%;width:20px;height:20px;transform:translateY(-50%);fill:none;stroke:var(--ink);stroke-width:2;stroke-linecap:round;pointer-events:none}
.site-header .hsearch kbd{position:absolute;right:12px;top:50%;transform:translateY(-50%);padding:0 8px;border-radius:8px;background:var(--surface);color:var(--muted);font:500 14px/22px var(--font);pointer-events:none}
.site-header .hsearch button{display:none}
.site-header .tools{display:flex;align-items:center;gap:8px}
.site-header .icon-btn{position:relative;display:grid;place-items:center;width:var(--ctl-touch);height:var(--ctl-touch);border-radius:50%;color:var(--ink);text-decoration:none}
.site-header .icon-btn svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.site-header .icon-btn:hover{background:var(--surface)}
.site-header .icon-btn[aria-current="page"]{background:var(--violet-tint)}
.site-header details{position:relative}
.site-header summary{list-style:none;cursor:pointer}
.site-header summary::-webkit-details-marker{display:none}
.site-header .avatar{display:grid;place-items:center;width:var(--ctl-touch);height:var(--ctl-touch);padding:0;border-radius:50%;background:var(--violet-tint);box-shadow:inset 0 0 0 2px var(--violet);font:700 14px/20px var(--font);color:var(--ink)}
.site-header .drop{position:absolute;right:0;top:calc(100% + 6px);min-width:240px;background:var(--white);color:var(--ink);border:2px solid var(--line);border-radius:var(--radius-md);box-shadow:var(--shadow);padding:6px;display:flex;flex-direction:column;z-index:50}
.site-header .tabs .drop{right:auto;left:0}
.site-header .drop a,.site-header .drop button{display:flex;align-items:center;min-height:var(--ctl-touch);padding:0 12px;border:0;border-radius:var(--r-sm);background:none;color:var(--ink);text-decoration:none;font:500 16px/24px var(--font);text-align:left;cursor:pointer;width:100%;box-shadow:none}
.site-header .drop a:hover,.site-header .drop button:hover{background:var(--surface)}
.site-header .drop small{display:block;padding:6px 12px 2px;color:var(--muted)}
.site-header .drop form{margin:0}
.site-header .tact{display:none}
.site-header .menu{display:none}
.site-header .only-narrow{display:none}
.site-header .bottombar{display:none}
/* tabs (shape from the canvas): the current tab is milk and joins the page under it */
.site-header .tabs{--h:36px;--h-active:44px;--shape-para:polygon(6.4px 16.3px,5.6px 12.6px,6px 8.7px,7.6px 5.2px,10.3px 2.4px,13.7px 0.6px,17.5px 0,calc(100% - 22.2px) 0,calc(100% - 19.8px) 0.2px,calc(100% - 17.5px) 0.9px,calc(100% - 15.4px) 2.1px,calc(100% - 13.6px) 3.6px,calc(100% - 12.1px) 5.5px,calc(100% - 11px) 7.7px,calc(100% - 0px) 100%,14px 100%);--shape-trap:polygon(0 100%,11px 7.7px,12.1px 5.5px,13.6px 3.6px,15.4px 2.1px,17.5px 0.9px,19.8px 0.2px,22.2px 0,calc(100% - 22.2px) 0,calc(100% - 19.8px) 0.2px,calc(100% - 17.5px) 0.9px,calc(100% - 15.4px) 2.1px,calc(100% - 13.6px) 3.6px,calc(100% - 12.1px) 5.5px,calc(100% - 11px) 7.7px,calc(100% - 0px) 100%);--shape-active:polygon(0 100%,11.3px 8.4px,12.4px 6.1px,13.8px 4px,15.7px 2.3px,17.9px 1px,20.3px 0.3px,22.8px 0,calc(100% - 22.8px) 0,calc(100% - 20.3px) 0.3px,calc(100% - 17.9px) 1px,calc(100% - 15.7px) 2.3px,calc(100% - 13.8px) 4px,calc(100% - 12.4px) 6.1px,calc(100% - 11.3px) 8.4px,calc(100% - 0px) 100%);display:flex;align-items:flex-end;padding:4px 24px 0}
.site-header .tabs>a,.site-header .tabs>details{flex:none;margin-left:-11px}
.site-header .tabs>:first-child{margin-left:0}
.site-header .tabs>a,.site-header .tabs>details>summary{position:relative;isolation:isolate;display:inline-flex;align-items:center;height:var(--h);padding:0 32px;color:var(--muted);text-decoration:none;font:500 16px/24px var(--font)}
.site-header .tabs>a::after,.site-header .tabs>details>summary::after{content:"";position:absolute;inset:-4px 0 0}
.site-header .tabs>a::before,.site-header .tabs>details>summary::before{content:"";position:absolute;inset:0;z-index:-1;background:var(--line);clip-path:var(--shape-para);transition:background-color var(--dur-fast) var(--ease-out)}
.site-header .tabs>a:first-child::before,.site-header .tabs>details:first-child>summary::before{clip-path:var(--shape-trap)}
.site-header .tabs>a:hover,.site-header .tabs>details>summary:hover{color:var(--ink)}
.site-header .tabs>a[aria-current="page"],.site-header .tabs>details.is-current>summary{height:var(--h-active);color:var(--ink);font-weight:700}
.site-header .tabs>a[aria-current="page"],.site-header .tabs>details.is-current{position:relative;z-index:2;margin-left:-4px}
.site-header .tabs>:first-child[aria-current="page"],.site-header .tabs>details.is-current:first-child{margin-left:0}
.site-header .tabs>a[aria-current="page"]::before,.site-header .tabs>details.is-current>summary::before{background:var(--milk);clip-path:var(--shape-active)}
.site-header .tabs>a:focus-visible,.site-header .tabs>details>summary:focus-visible{outline-offset:-6px;border-radius:12px}
.site-header .icon-btn .count{position:absolute;top:0;right:-2px;min-width:22px;height:22px;padding:0 6px;border:2px solid var(--white);border-radius:11px;background:var(--orange);color:var(--ink);font:700 13px/18px var(--font);text-align:center;box-sizing:border-box}
.site-header .drop hr{width:100%;height:0;margin:6px 0;border:0;border-top:2px solid var(--line)}
.site-header .drop a svg,.site-header .drop button svg{flex:none;width:20px;height:20px;margin-right:12px;fill:none;stroke:var(--ink);stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
.site-header .drop:has(.who){min-width:300px}
.site-header .who .cap{overflow-wrap:anywhere}
.site-header .who{display:flex;align-items:center;gap:12px;padding:10px 12px}
.site-header .who .avatar.big{flex:none;width:48px;height:48px;font-size:16px}
.site-header .who b{display:block;font-weight:700}
.site-header .who .cap{display:block;color:var(--muted);font-size:14px;line-height:20px}
@media (min-width:769px){
  .site-header{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));grid-template-rows:64px auto;column-gap:24px;padding:0 max(24px,calc((100% - var(--wrap))/2 + 24px))}
  .site-header.no-tabs{grid-template-rows:56px}
  .site-header .hd{display:contents}
  .site-header .brand{grid-column:1;grid-row:1 / span 2;align-self:center;justify-self:start}
  .site-header .brand img{height:min(80px,calc((100vw - 48px - 264px)/12 + 24px - 12px))}
  .site-header.no-tabs .brand{grid-row:1}
  .site-header.no-tabs .brand img{height:48px}
  .site-header .hsearch{grid-column:2 / span 7;grid-row:1;width:auto;margin:0;align-self:center}
  .site-header .hsearch input{height:40px}
  .site-header .tools{grid-column:9 / -1;grid-row:1;justify-self:end;align-self:center}
  .site-header .tabs{grid-column:2 / -1;grid-row:2;padding:4px 0 0}
}
@media (max-width:768px){
  .site-header .hd{padding:0 10px 0 12px;gap:8px;min-height:56px}
  .site-header .brand b{display:none}
  .site-header .brand img{height:34px}
  .site-header .hsearch,.site-header .wide-nav{display:none}
  .site-header .menu{display:block;margin-left:auto}
  .site-header .tact{display:flex;gap:8px;align-items:center;margin-left:auto}
  .site-header .tact+.menu{margin-left:0}
  .site-header .only-narrow{display:block}
  .site-header .menu .hsearch{display:flex;width:auto;padding:6px;margin:0}
  .site-header .menu .hsearch input{border-color:var(--field-edge)}
  .site-header .only-narrow.hd-search{display:grid}
  .site-header .hd-search{margin-left:auto}
  .site-header .tact+.hd-search{margin-left:0}
  body.board .site-header .hd-search{display:none}
  body:has(.bottombar){padding-bottom:92px}
  .site-header .bottombar{position:fixed;left:12px;right:12px;bottom:12px;z-index:35;display:flex;height:68px;padding:6px;background:var(--white);border:2px solid var(--line);border-radius:34px;box-shadow:var(--shadow)}
  .site-header .bottombar>a,.site-header .bottombar>.bb-slot{position:relative;flex:1 1 0;min-width:0}
  .site-header .bottombar>a,.site-header .menu>summary{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border-radius:28px;color:var(--ink);text-decoration:none;font:700 12px/16px var(--font)}
  .site-header .bottombar svg,.site-header .menu>summary svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
  .site-header .menu>summary svg{fill:currentColor;stroke:none}
  .site-header .bottombar>a[aria-current="page"]{background:var(--violet-tint);box-shadow:inset 0 0 0 2px var(--violet)}
  .site-header .bottombar .count{position:absolute;top:2px;left:calc(50% + 4px);min-width:20px;height:20px;padding:0 5px;border:2px solid var(--white);border-radius:10px;background:var(--orange);color:var(--ink);font:700 12px/16px var(--font);text-align:center;box-sizing:border-box}
  .site-header .menu{position:static;margin:0}
  .site-header .menu>summary{position:fixed;z-index:36;right:18px;bottom:18px;width:calc((100vw - 48px) / 4);height:56px;padding:0;border:0;background:none}
  .site-header .menu[open]>summary{background:var(--violet-tint);box-shadow:inset 0 0 0 2px var(--violet)}
  .site-header .menu .drop{position:fixed;left:8px;right:8px;top:auto;bottom:92px;max-height:calc(100dvh - 160px);overflow:auto}
}

/* ---------- page layout ---------- */
/* the page rhythm of the canvas (.wrap): 1208 px wide, 24 px between blocks */
main{max-width:var(--wrap);margin:0 auto;padding:32px 24px 48px;display:grid;gap:24px;align-content:start}
main>*{margin-block:0}
main p{margin:0}
.card{background:#fff;border:2px solid var(--line);border-radius:var(--r-lg);padding:24px;max-width:34rem}
.card p{margin:.6em 0}
.crumbs,.meta,.muted{color:var(--muted);font-size:.9rem}
.msg{display:flex;gap:12px;align-items:flex-start;padding:12px 16px;margin:0;border:2px solid var(--lime);border-radius:var(--r-lg);background:var(--lime-tint)}
.stack>.msg,.stack>form{margin:0}
.msg.warn{border-color:var(--orange);background:var(--orange-tint)}
.msg.error,.msg.err{border-color:var(--danger);background:var(--danger-tint)}
.msg .grow{flex:1}

/* ---------- buttons: one primary (orange, ink, 18 px bold), secondary (white) and danger ---------- */
main button,main .button{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:var(--size-btn-primary);padding:0 24px;border:var(--size-border) solid var(--orange);border-radius:var(--radius-pill);background:var(--orange);color:var(--ink);font:700 18px/24px var(--font);text-decoration:none;cursor:pointer}
main button:hover,main .button:hover{box-shadow:inset 0 0 0 999px rgb(31 36 51/.08)}
main button:active,main .button:active{box-shadow:inset 0 0 0 999px rgb(31 36 51/.16)}
main button.secondary,main .button.secondary{min-height:var(--ctl-touch);background:var(--white);border-color:var(--line);font-weight:500}
main button.secondary:hover,main .button.secondary:hover{background:var(--surface);box-shadow:none}
main button.danger{min-height:var(--ctl-touch);background:var(--white);color:var(--danger);border-color:var(--line);font-weight:500}
main button.danger:hover{background:var(--danger-tint);box-shadow:none}
main button.link{background:none;border:0;min-height:0;padding:0;color:var(--link);text-decoration:underline;font-weight:500;font-size:inherit;box-shadow:none}
main button:disabled{background:var(--line);border-color:transparent;color:var(--muted);cursor:not-allowed;box-shadow:none}
.actions{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center}
form.inline{display:inline}

/* ---------- forms: one field height (48 px), pill fields, labels without colons ---------- */
main label{font-weight:500;font-size:16px;line-height:24px}
main input[type=text],main input[type=email],main input[type=password],main input[type=search],main input[type=number],main input[type=tel],main input[type=url],main input[type=date],main input[type=time],main select{width:100%;min-height:var(--size-field);padding:0 18px;border:var(--size-border) solid var(--field);border-radius:var(--radius-pill);background:var(--white);color:var(--ink);font:500 16px/24px var(--font)}
main textarea,main textarea.ds-input{width:100%;padding:12px 18px;border:var(--size-border) solid var(--field);border-radius:var(--radius-lg);background:var(--white);color:var(--ink);font:500 16px/24px var(--font)}
main input:hover,main select:hover,main textarea:hover{border-color:var(--field-edge)}
main input[type=checkbox],main input[type=radio]{width:20px;height:20px;accent-color:var(--link)}
.card p>label{display:block;margin-bottom:4px}
ul.errorlist{color:var(--danger);padding-left:1.1rem;margin:.3rem 0}
.helptext{color:var(--muted);font-size:14px}

/* the shared field component (ds_field.html): used by the sign-in forms and the administration screens */
.ds-field{display:grid;gap:6px;align-content:start;min-width:0;margin:0}
.ds-label{font-size:16px;font-weight:500;line-height:24px}
.ds-field .cap{font-size:14px;line-height:20px;color:var(--muted)}
.ds-field .ferr,.ferr{color:var(--danger);font-size:14px;line-height:20px;font-weight:600}
.ds-field:has(.ferr) .ds-input,.ds-field:has(.ferr) .ds-select{border-color:var(--danger)}
.selectpill{position:relative}
main .ds-select{appearance:none;padding-right:44px}
.selectpill .chev{position:absolute;right:16px;top:50%;width:18px;height:18px;margin-top:-9px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.ck{display:flex;align-items:flex-start;gap:12px;min-height:var(--ctl-touch);padding:8px 0;font-weight:500;font-size:16px;cursor:pointer}
main .ck input{flex:none;width:24px;height:24px;margin:0}

/* sign-in and account pages: one centred card, fields stacked, one primary button */
.auth{max-width:30rem;width:100%;margin-inline:auto;display:grid;gap:16px}
.auth>p{color:var(--muted)}
.authcard{display:grid;gap:16px;padding:24px;max-width:none}
.authcard .actions{padding-top:4px}
.authcard .alt{margin:0;font-size:16px}
.auth>.alt{margin:16px 0 0;font-size:16px}
code{padding:2px 8px;border-radius:8px;background:var(--surface);color:var(--ink);font:500 15px/24px ui-monospace,Consolas,monospace;word-break:break-all}
.qr{display:inline-block;padding:12px;border:2px solid var(--line);border-radius:var(--r);background:var(--white)}
.qr svg{display:block;max-width:100%;height:auto}

/* ---------- tables ---------- */
main table{border-collapse:collapse;width:100%;background:#fff;border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
main th,main td{text-align:left;padding:.65rem .8rem;border-bottom:1px solid var(--line2);vertical-align:top}
main th{background:var(--violet1);color:var(--ink);font-weight:600;font-size:14px}
@media (max-width:40rem){main table{display:block;overflow-x:auto}}

/* ---------- home launcher ---------- */
.launcher{display:grid;grid-template-columns:repeat(auto-fit,minmax(15rem,1fr));gap:16px;margin-top:1.2rem}
.tile{position:relative;overflow:hidden;display:flex;flex-direction:column;justify-content:flex-end;min-height:9.5rem;padding:1.1rem 1.3rem;border:2px solid var(--line);border-radius:var(--r-lg);background:var(--white);text-decoration:none;color:var(--ink)}
.tile b,.tile span{position:relative;z-index:1}.tile b{font-size:20px;font-weight:600}.tile span{font-size:16px;color:var(--muted)}
.tile::before{content:"";position:absolute;right:-30px;top:-40px;width:170px;height:170px;border-radius:50%;pointer-events:none;z-index:0}   /* the brand colour as a graphic, never as a text background */
.tile.violet::before{background:var(--violet)}.tile.lime::before{background:var(--lime)}.tile.orange::before{background:var(--orange)}
.tile:hover{border-color:var(--field-edge)}
