/* PVA website design template.
   Every page of the site links this file. Change the look here, not in pages.
   Rules: white paper look, search bar is the centre, thin grey lines, square corners,
   no motion, one font (Inter, self-hosted in vendor/inter, Latvian letters in the latin-ext file), no buttons or controls nobody asked for,
   status always in words (colour alone never carries meaning). */

/* Inter (SIL Open Font License, vendor/inter/LICENSE), variable weight 100-900.
   latin-ext holds Latvian letters (ā č ē ģ ī ķ ļ ņ š ū ž); the browser loads it only when needed. */
@font-face { font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(vendor/inter/inter-latin-ext-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: "Inter Variable"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(vendor/inter/inter-latin-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* colours, fonts, sizes */
:root {
  --paper: #fff; --hover: #f7f7f7; --rule: #e4e4e4; --rule-head: #999; --search-border: #767676;
  --ink: #222; --ink-faded: #595959; --link: #1f3f6e; --warn: #7a4600; --err: #8b1e12; --ok: #1d6b2f;
  --shadow-search: 0 3px 14px rgb(0 0 0 / .16);
  --font: "Inter Variable", system-ui, "Segoe UI", Roboto, Arial, sans-serif;
  --font-type: var(--font); /* codes, counts, headers: same font, numbers in equal widths (.mono) */
}
/* page = fixed top (search, filters) + table that fills the rest; only the table scrolls,
   so the page has one vertical scrollbar and the search, filters and column headers stay visible */
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.5 var(--font);
  display: flex; flex-direction: column; overflow: hidden; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.search { flex: none; padding: 40px 16px 12px; width: 100%; max-width: 1280px; margin: 0 auto; box-sizing: border-box; } /* same width as the table (main) */
/* one button, two halves: the dark half is the current view; a click switches */
.toggle { display: inline-flex; margin: 0; padding: 0; font: 15px var(--font); color: var(--ink);
  background: var(--paper); border: 1px solid var(--search-border); border-radius: 0; cursor: pointer; }
.toggle span { padding: 6px 14px; }
.toggle[aria-pressed="true"] span:first-child, .toggle[aria-pressed="false"] span:last-child {
  background: var(--ink); color: var(--paper); }
#q { display: block; width: 100%; height: 64px; margin: 32px 0; padding: 0 24px; box-sizing: border-box;
  font: 20px var(--font-type); color: var(--ink); background: var(--paper);
  border: 1px solid var(--search-border); border-radius: 0; box-shadow: var(--shadow-search); }
#q::-webkit-search-cancel-button { appearance: none; }
main { flex: 1; min-height: 0; display: flex; flex-direction: column; width: 100%; max-width: 1280px;
  margin: 0 auto; padding: 0 16px 16px; box-sizing: border-box; }
#table { flex: 1; min-height: 0; }
.meta { margin: 0 0 24px; color: var(--ink-faded); }
/* visually hidden, still read by screen readers */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.count { margin: 0 0 8px; font-family: var(--font-type); font-variant-numeric: tabular-nums; color: var(--ink-faded); }
.faded { color: var(--ink-faded); }
.free { color: var(--ok); } .pay { color: var(--err); }
.bar { display: flex; align-items: center; gap: 12px; margin: 0 0 12px; }
/* bug-report and info buttons (right side), and their panels */
.bug { margin-left: auto; display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  color: var(--ink-faded); background: var(--paper); border: 1px solid var(--rule-head); border-radius: 50%; cursor: pointer; }
.bug:hover { color: var(--ink); }
.bug.gear + .bug { margin-left: 0; } /* settings button first, before bug and "i"; no function yet (creator, 2026-12-03) */
.bugform { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.bugform textarea { font: 15px/1.5 var(--font); padding: 8px; border: 1px solid var(--search-border); border-radius: 0;
  resize: vertical; margin-bottom: 10px; }
.bugform button { align-self: flex-start; padding: 8px 20px; font: 15px var(--font); color: var(--paper);
  background: var(--ink); border: 1px solid var(--ink); cursor: pointer; }
.bugform button:disabled { background: var(--rule); border-color: var(--rule); color: var(--ink-faded); cursor: not-allowed; }
.info { width: 30px; height: 30px; padding: 0; font: 700 16px var(--font); color: var(--ink);
  background: var(--paper); border: 1px solid var(--search-border); border-radius: 50%; cursor: pointer; }
dialog.panel { max-width: 760px; width: calc(100% - 32px); max-height: 85vh; padding: 24px 32px; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule-head); border-radius: 0; }
dialog.panel::backdrop { background: rgb(0 0 0 / .25); }
dialog.panel h2 { margin: 0 0 8px; font-size: 22px; }
dialog.panel h3 { margin: 20px 0 6px; font-size: 16px; }
dialog.panel p, dialog.panel ul { margin: 0 0 8px; }
dialog.panel .close { position: sticky; top: 0; float: right; font-size: 24px; line-height: 1; padding: 0 4px;
  background: none; border: 0; cursor: pointer; color: var(--ink); }
.rules { color: var(--ink-faded); font-size: 14px; }
/* type filter under the search: pressed = dark */
.types { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.types button { padding: 6px 14px; font: 15px var(--font); color: var(--ink); background: var(--paper);
  border: 1px solid var(--search-border); border-radius: 0; cursor: pointer; }
.types button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.types .print-btn { margin-left: auto; align-self: center; display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  color: var(--ink-faded); border-color: var(--rule-head); border-radius: 50%; } /* print, right end of the type buttons (creator, 2026-12-03) */
.types .print-btn:hover { color: var(--ink); }
.state { margin: 0; padding: 24px; text-align: center; }
/* loading skeleton: same columns as the table (150 px | rest | 170 px | 160 px), grey bars with a soft sweep */
.skeleton { flex: 1; overflow: hidden; }
.sk-head, .sk-row { display: grid; grid-template-columns: 150px 1fr 170px 160px; align-items: center; }
.sk-head { border-bottom: 1px solid var(--rule-head); font: bold 13px var(--font-type); text-transform: uppercase; }
.sk-head span { padding: 8px; line-height: 16px; min-height: 32px; }
.sk-row { min-height: 48px; border-bottom: 1px solid var(--rule); }
.sk-row i { display: block; height: 12px; margin: 0 8px; border-radius: 3px; max-width: calc(100% - 16px);
  background: linear-gradient(90deg, #eee 25%, #f6f6f6 50%, #eee 75%) 0 0 / 400% 100%; animation: sk 1.4s ease infinite; }
@keyframes sk { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk-row i { animation: none; } }
.state.err { color: var(--err); border: 1px solid var(--err); }
.mono { font-family: var(--font-type); font-variant-numeric: tabular-nums; }
/* section tags: soft background, dark text of the same hue (readable, AA contrast) */
.tag { display: inline-block; padding: 1px 8px; font-size: 13px; line-height: 1.6; border-radius: 3px;
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
/* ATC tags that wrap onto a second line get a small gap between them (creator, 2026-12-03) */
.tabulator-cell .tag[data-atc] { margin: 2px 0; }
.tag-gp   { background: #e3f1e5; color: #1d5b2a; }
.tag-lab  { background: #e2ecf8; color: #1c4475; }
.tag-imun { background: #eee6f6; color: #4f2a78; }
.tag-att  { background: #ddf1f0; color: #145953; }
.tag-spec { background: #fbecd9; color: #7a4600; }
.tag-kir  { background: #f8e2e2; color: #8b1e12; }
.tag-zobi { background: #f4efcf; color: #5e5200; }
.tag-cits { background: #ececec; color: #444; }
.tag-ssk  { background: #e6e9f2; color: #2f3b63; } /* SSK-10 block, e.g. A00-A09 */
/* ATC codes: one colour per first letter (14 ATC main groups), neighbouring letters get far-apart hues */
.atc-A { background: hsl(0 55% 91%); color: hsl(0 65% 24%); }
.atc-B { background: hsl(129 55% 91%); color: hsl(129 65% 24%); }
.atc-C { background: hsl(257 55% 91%); color: hsl(257 65% 24%); }
.atc-D { background: hsl(26 55% 91%); color: hsl(26 65% 24%); }
.atc-G { background: hsl(154 55% 91%); color: hsl(154 65% 24%); }
.atc-H { background: hsl(283 55% 91%); color: hsl(283 65% 24%); }
.atc-J { background: hsl(51 55% 91%); color: hsl(51 65% 24%); }
.atc-L { background: hsl(180 55% 91%); color: hsl(180 65% 24%); }
.atc-M { background: hsl(309 55% 91%); color: hsl(309 65% 24%); }
.atc-N { background: hsl(77 55% 91%); color: hsl(77 65% 24%); }
.atc-P { background: hsl(206 55% 91%); color: hsl(206 65% 24%); }
.atc-R { background: hsl(334 55% 91%); color: hsl(334 65% 24%); }
.atc-S { background: hsl(103 55% 91%); color: hsl(103 65% 24%); }
.atc-V { background: hsl(231 55% 91%); color: hsl(231 65% 24%); }
#info .tag { margin: 0 4px 6px 0; }
#info .src-org { margin: 12px 0 4px; font-weight: 600; }
#info .src-list { margin: 0 0 4px; padding-left: 24px; }
#info .src-list li { margin-bottom: 6px; }
#info .src-list .faded { font-size: 13px; }
#info .hist { margin-left: 4px; padding: 2px; vertical-align: -3px; color: var(--ink-faded); background: none; border: 0;
  border-radius: 4px; cursor: pointer; }
#info .hist:hover { color: var(--ink); background: var(--hover); }
#hist .hist-sub { margin: 8px 0 2px; font-weight: 600; }
#hist .hist-list { margin: 0 0 8px; padding-left: 20px; font-size: 14px; }
.linkbtn { padding: 0; font: 14px var(--font); color: #0000ee; text-decoration: underline; background: none; border: 0; cursor: pointer; }
/* clickable rows: the opened part sits under the cells */
.tabulator-row { cursor: pointer; }
.tabulator-row.open { background: var(--hover); }
.tabulator-row.open > .tabulator-cell { font-weight: 700; } /* opened row: its own line bold (creator, 2026-12-03) */
.exp { margin: 0 6px 0 0; padding: 0; width: 18px; font: 14px var(--font); color: var(--ink-faded);
  background: none; border: 0; cursor: pointer; }
.details .stars { margin: 8px 0 0; color: var(--ink-faded); }
.details .products { margin: 4px 0 0; padding-left: 18px; }
.clamp2 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.tabulator-row.open .clamp2 { display: inline; -webkit-line-clamp: unset; line-clamp: unset; } /* opened row: all ingredients */
.clamp2 .ing { display: inline-block; } /* one box per ingredient: it can slide to its new place */
.subview { margin-top: 12px; padding: 8px 10px; background: #f0f0f0; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; } /* controls of one type only (Medikamenti, SSK-10, Manipulācijas): grey panel so they read as part of that type (creator, 2026-12-03) */
.subview[hidden] { display: none; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
/* NVD compensated (KZS): small tag before the name; opened row lists diagnoses with %, conditions */
.cond { margin-left: 2px; font-weight: 600; cursor: help; }
.tag.kzs { font-size: 11px; line-height: 1.5; padding: 0 5px; vertical-align: baseline; background: #e8e8e8; color: #444; } /* grey (creator, 2026-12-03) */
.kzs-entry { margin: 4px 0 12px; padding-left: 10px; border-left: 2px solid var(--rule); }
.details { padding: 4px 16px 16px 112px; cursor: auto; white-space: normal; }
.change { color: var(--warn); }
.change + .change { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule); }
.change b { font-weight: bold; }
.change .note { color: var(--ink-faded); }

/* Tabulator: paper look, thin rules, square corners, no motion */
.tabulator { font: inherit; font-size: 15px; background: var(--paper); border: 0; }
.tabulator .tabulator-header { background: var(--paper); border-bottom: 1px solid var(--rule-head); color: var(--ink); }
.tabulator .tabulator-header .tabulator-col { background: var(--paper); border-right: 0; }
.tabulator .tabulator-header .tabulator-col .tabulator-col-title { font: bold 13px var(--font-type); text-transform: uppercase; white-space: normal;
  line-height: 16px; min-height: 32px; max-height: 32px; overflow: hidden; } /* always two lines high, in every view (creator, 2026-12-03) */
.tabulator .tabulator-tableholder .tabulator-table { background: var(--paper); color: var(--ink); }
.tabulator-row { background: var(--paper); border-bottom: 1px solid var(--rule); min-height: 48px; }
.tabulator-row.tabulator-row-even { background: var(--paper); }
.tabulator-row.tabulator-selectable:hover, .tabulator-row:hover { background: var(--hover); }
.tabulator-row .tabulator-cell { border-right: 0; padding: 12px 8px; white-space: normal; overflow-wrap: anywhere; }

/* column header: clicking anywhere on it opens the options popup */
.tabulator .tabulator-header .tabulator-col { cursor: pointer; }
.tabulator .tabulator-header .tabulator-col:hover { background: var(--hover); }
.tabulator .tabulator-header .tabulator-col.filtered .tabulator-col-title::after {
  content: " · filtrēts"; color: var(--warn); text-transform: none; font-weight: normal; }

/* header options popup: sort, search, value list (like an Excel filter) */
.tabulator-popup-container { background: var(--paper); border: 1px solid var(--search-border); border-radius: 0;
  box-shadow: var(--shadow-search); font: 15px/1.5 var(--font); }
.colpop { display: flex; flex-direction: column; gap: 4px; width: 280px; padding: 8px; }
.colpop button { padding: 6px 8px; text-align: left; font: inherit; color: var(--ink); background: var(--paper);
  border: 0; border-radius: 0; cursor: pointer; }
.colpop button:hover { background: var(--hover); }
.colpop .clear { background: var(--rule); } /* "Noņemt filtru": only while filtered, so it looks different */
.colpop .clear:hover { background: #d4d4d4; }
/* header arrow while the column is sorted (left click: ↑ -> ↓ -> off) */
.tabulator-col-title-holder { display: flex; align-items: flex-start; gap: 4px; }
.sort-ind { font: bold 14px var(--font); color: var(--ink); }
.tabulator .tabulator-header .tabulator-col { cursor: pointer; }
.colpop .sort-icon { float: right; min-width: 1em; text-align: center; color: var(--ink-faded); }
.colpop input[type=search] { height: 40px; margin: 4px 0; padding: 0 8px; font: 15px var(--font-type);
  border: 1px solid var(--search-border); border-radius: 0; }
.colpop-list { max-height: 280px; overflow-y: auto; border-top: 1px solid var(--rule); padding-top: 4px; }
.colpop-list label { display: block; padding: 2px 4px; cursor: pointer; overflow-wrap: anywhere; }
.colpop-list label:hover { background: var(--hover); }
/* right-click menu of the "Medikamenti" button: ATC groups */
.atcpop { position: fixed; z-index: 1000; width: 440px; }
.atcpop .tag { margin-right: 4px; }
.atcchip { display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; height: 33px; vertical-align: middle; padding: 0 12px; font: inherit; color: var(--ink); background: var(--paper);
  border: 1px solid var(--rule-head); border-radius: 3px; cursor: pointer; }
.atcchip:hover { background: var(--hover); }
.atcpop .copyitem { display: flex; align-items: center; gap: 8px; color: var(--link); }
.atcpop .copyitem:not(:first-child) { border-top: 1px solid var(--rule); }
.atcpop:not(:has(> :not(.copyitem))) { width: auto; } /* row menu: only copy items */
/* the × becomes a red round button on hover: a click removes the filter */
.atcchip .x { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; line-height: 1; }
.atcchip:hover .x, .atcchip:focus-visible .x { background: var(--err); color: var(--paper); }
.atcpop .colpop-list { max-height: 340px; }
.atchead { margin-top: 6px; padding: 3px 6px; font-size: 13px; border-radius: 3px; }
.types button.filtered::after { content: " · filtrēts"; color: var(--warn); }
.types button[aria-pressed="true"].filtered::after { color: inherit; opacity: .75; }
.nowrap { white-space: nowrap; }

/* NVD code inside a text: dotted underline, its name shows at once on hover (no browser tooltip delay) */
.code-ref { position: relative; color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.code-ref:hover { color: var(--ink); text-decoration-style: solid; }
.code-ref:hover::after { content: attr(data-name); position: absolute; left: 0; bottom: calc(100% + 4px); z-index: 20;
  width: max-content; max-width: 360px; padding: 4px 8px; font: 13px/1.35 var(--font); white-space: normal;
  color: #fff; background: #333; border-radius: 4px; pointer-events: none; }

/* bug report tied to a row: the row named at the top of the form, × unties it */
.bug-row { margin: 0 0 12px; padding: 6px 10px; font-size: 14px; background: var(--hover); border-radius: 4px; }
.bug-row-x { margin-left: 4px; padding: 0 4px; font-size: 16px; line-height: 1; color: var(--ink-faded); background: none; border: 0; cursor: pointer; }
.bug-row-x:hover { color: var(--ink); }

/* brand rows: active ingredients in a light line under the name; tighter lines keep the row 51 px high */
.tabulator-cell.two-line { padding-top: 7px; padding-bottom: 7px; line-height: 19px; }
.two-line .sub { display: block; font-size: 12.5px; line-height: 15px; color: #888; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* several ATC codes in the Sadaļa column: each on its own line (creator, 2026-12-03) */
.tabulator-cell[tabulator-field="sadala"] .tag[data-atc] { display: table; }
.tabulator-cell[tabulator-field="sadala"] .tag[data-atc] + .tag[data-atc] { margin-top: 4px; }

/* SSK-10 opened row: notes that apply to the whole block / chapter */
.ssk-group { margin-top: 10px; }
.ssk-p { margin: 2px 0; }
/* SSK-10 sub-code (A00.0) indented under its code (A00) */
.tabulator-cell.ssk-child { padding-left: 30px; }
/* SSK-10 view: chapter drop-down, same height and border as the type buttons */
#ssk-chapters { height: 33px; max-width: 100%; padding: 0 10px; font: 15px var(--font); color: var(--ink); background: var(--paper); border: 1px solid var(--search-border); border-radius: 0; cursor: pointer; }
/* its list: each choice as tall as the buttons (33 px) (creator, 2026-12-03). Needs the new customizable <select>
   (Chrome / Edge 135+); other browsers keep their own list look. */
#ssk-chapters, #ssk-chapters::picker(select) { appearance: base-select; }
#ssk-chapters { display: inline-flex; align-items: center; }
#ssk-chapters::picker(select) { padding: 0; border: 1px solid var(--search-border); max-height: 70vh; }
#ssk-chapters option { min-height: 33px; padding: 0 12px; display: flex; align-items: center; border-bottom: 1px solid var(--rule); }
#ssk-chapters option .tag, #ssk-chapters selectedcontent .tag { margin-left: 6px; }
#ssk-chapters > button { display: flex; align-items: center; min-width: 0; overflow: hidden; white-space: nowrap; }
/* SSK-10 code inside a text: a tag in its chapter's colour; its hover name must not be cut off by the tag */
.tag.ssk-ref { overflow: visible; text-decoration: none; padding: 0 5px; vertical-align: baseline; line-height: 1.4; }
.tag.ssk-ref:hover { text-decoration: underline; }
/* SSK-10 range tag (A01.1-A01.3): a click lists its codes */
button.ssk-range { border: 0; font-size: 13px; font-family: var(--font-type); cursor: pointer; }
.atcpop .range-item { display: block; padding: 3px 4px; color: var(--ink); text-decoration: none; }
.atcpop .range-item:hover { background: var(--hover); }
/* full-width header, one line */
.top { flex: none; border-bottom: 1px solid var(--rule); }
.top-in { padding: 6px 16px; line-height: 1.5; } /* full width, text at the left edge of the screen (creator, 2026-12-03) */
.top a { color: var(--link); text-decoration: none; }
.top a:hover { text-decoration: underline; }
