/* ============================================================================
   Fonts (IBM Plex, self-hosted)
   ============================================================================ */
/* IBM Plex, served from this origin: a page view used to tell Google who was
   reading it, from which clinic address, and the Content-Security-Policy had to
   name two of their hosts. Files and licence in public/fonts/ — the same latin
   and latin-ext subsets Google served, so nothing changes on screen. Sans is one
   variable file per subset (Google serves the four weights from it too), Mono is
   one file per weight. latin-ext is what carries ą č ę ė į š ų ū ž. */
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/ibm-plex-mono-400-latin.woff2') format('woff2');
    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;
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/ibm-plex-mono-400-latin-ext.woff2') format('woff2');
    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: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/ibm-plex-mono-500-latin.woff2') format('woff2');
    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;
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/ibm-plex-mono-500-latin-ext.woff2') format('woff2');
    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: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/ibm-plex-sans-latin.woff2') format('woff2');
    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;
}
@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/fonts/ibm-plex-sans-latin-ext.woff2') format('woff2');
    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: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/ibm-plex-sans-latin.woff2') format('woff2');
    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;
}
@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/fonts/ibm-plex-sans-latin-ext.woff2') format('woff2');
    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: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/ibm-plex-sans-latin.woff2') format('woff2');
    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;
}
@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/fonts/ibm-plex-sans-latin-ext.woff2') format('woff2');
    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: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/ibm-plex-sans-latin.woff2') format('woff2');
    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;
}
@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/fonts/ibm-plex-sans-latin-ext.woff2') format('woff2');
    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;
}

/* ============================================================================
   Design tokens (docs/design-system.md)
   ============================================================================ */
/* ===== Design tokens (docs/design-system.md) =====
   Calm clinical: one confident teal, quiet surfaces, colour kept for meaning.
   New rules use these names; the --color-* names below are the older ones,
   kept as aliases so every existing rule reads the same values. */
:root {
    /* brand: the clinic's teal */
    --teal-50: #eef7f7; --teal-100: #d7eeef; --teal-200: #aedcde; --teal-300: #7cc3c7;
    --teal-500: #1a929c; --teal-600: #0e7c86; --teal-700: #0b6870; --teal-800: #065a62; --teal-900: #0a3f44;
    /* neutrals: ink for text, line for borders, surface for backgrounds */
    --ink: #1a2b2d; --ink-2: #3c5053; --ink-3: #5f7275; --ink-4: #8aa0a3;
    --line: #d4e0e1; --line-soft: #e3ebec; --line-strong: #7b9194; --surface: #ffffff; --surface-2: #f0f6f6;
    /* states: each differs in fill as well as hue */
    --urgent: #d92d20; --urgent-strong: #b42318; --urgent-bg: #fdf1f0;       /* today/tomorrow, nobody told */
    --soon: #c2410c; --soon-bg: #fff4ec;                                      /* 2-10 days, nobody told */
    --unreachable: #facc15; --unreachable-line: #d4a50b;                      /* „Nepasiekiamas" */
    --told: #6cc24a; --told-line: #58ad38; --told-ink: #0f3312;               /* „Pranešta" */
    --told-hover: #5fb53e; --told-hover-line: #4c9a30; --told-text: #2f6b1a;  /* its hover; told as text on white */
    --unreachable-hover: #eab308; --unreachable-hover-line: #b8900a;          /* „Nepasiekiamas" hovered */
    --urgent-ink: #7a271a; --urgent-line: #f6cfcb; --urgent-note: #8f4a42;   /* the red bar's text, edge, small print; the tries badge */
    --today: #f4cf62; --today-ink: #4a3505;                                   /* today's column */
    --today-hi: #fbe49c; --today-line: #e3b640; --today-strong: #2e2103;      /* its band: top of the gradient, edge, the date */
    --vaa-ink: #1e40af; --eit-ink: #92400e;                                   /* the procedures as text on white */
    --vaa-bg: #eff6ff; --eit-bg: #fef3c7;                                     /* and their chips */
    --vaa: #2f5bd6; --eit: #e08a1e;                                           /* the two procedures */
    /* type: IBM Plex Sans for words, Plex Mono for digits only */
    --fs-xs: 12px; --fs-sm: 13px; --fs-base: 14px; --fs-md: 16px; --fs-lg: 20px; --fs-xl: 24px; --fs-2xl: 32px;
    /* space, radii, depth, motion */
    --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
    --radius-xs: 4px; --radius-sm: 8px; --radius: 12px; --radius-pill: 999px;
    --shadow: 0 1px 3px rgba(26,43,45,0.08), 0 1px 2px rgba(26,43,45,0.05);
    --shadow-md: 0 4px 14px rgba(26,43,45,0.10);
    --motion-fast: 120ms; --motion: 160ms; --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
    --transition: var(--motion) var(--ease);
    /* the older names */
    --color-primary: var(--teal-600);
    --color-primary-dark: var(--teal-800);
    --color-primary-light: #e6f5f5;
    --color-accent: #c2410c;
    --color-text: var(--ink);
    --color-text-light: var(--ink-3);
    --color-bg: var(--surface);
    --color-bg-alt: var(--surface-2);
    --color-border: var(--line);
    --color-success: #047857;
    --color-success-light: #ecfdf5;
}
/* =====================================================================
   Refinement pass (2026-09-08): typeface with character but built for
   long reading; monospaced tabular digits for codes and phones; a clear
   "today"; quiet empty slots; keyboard focus that can be seen.
   ===================================================================== */
:root { --font-family: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif; --font-mono: 'IBM Plex Mono', Consolas, monospace; --color-border-soft: #e3ebec; }

/* ============================================================================
   Base: page, type, links, focus, motion, small utilities
   ============================================================================ */
/* Text links: the clinic's teal, not the browser's blue. :where() keeps them at
   no weight at all, so any link a class styles (a button, a card, a name) keeps
   its own colour. */
:where(a) { color: var(--teal-700); text-decoration-thickness: 1px; text-underline-offset: 2px; }
:where(a:hover) { color: var(--teal-900); }
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--surface-2);
    -webkit-font-smoothing: antialiased;
}
.ds-muted { color: var(--ink-3); font-size: 13px; }
@media (min-width: 600px) {
    .dsw-hit > .ds-muted { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@keyframes dsw-hl-fade { 0%, 60% { outline-color: var(--color-accent); } 100% { outline-color: transparent; } }
body { font-family: var(--font-family); letter-spacing: -0.005em; }
.ds-mono, .dsw-sub, .reg-line, .dsw-phone, .ds-cal-day, .stac-count, .dsw-count { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.ds-mono { font-size: 0.95em; }
/* keyboard focus */
/* Keyboard focus: a 2px teal ring, 2px out. It no longer sets border-radius: a
   pill (the bar's chips, badges, counters) or a rounded button kept its ring but
   lost its shape the moment it was focused. The ring follows the element's own
   corners. */
:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }
/* Motion is feedback, never decoration: with reduced motion asked for, nothing
   slides or fades. The highlight on a card a search or the warning bar opened
   then stays plain until reg.js takes its class away, rather than vanishing at once. */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
@keyframes dsw-hl-red-fade { 0%, 60% { outline-color: var(--urgent); } 100% { outline-color: transparent; } }
.audit-day h3 .ds-muted { font-weight: 400; margin-left: 6px; }
.ds-registry:not(.stac-page) .dsw-card.dsw-slot .dsw-sub .ds-mono { font-size: 1em; }
@keyframes dsl-turn { to { transform: rotate(360deg); } }
.ds-history li > .ds-muted:first-child { min-width: 120px; font-variant-numeric: tabular-nums; }
.ds-history li > .ds-muted:last-child { color: var(--ink-3); font-size: var(--fs-sm); }
@media (min-width: 900px) {
    .dsw-awaiting-list > .dsw-awaiting-row > .ds-mono { grid-column: 4; }
    .dsw-awaiting-list > .dsw-awaiting-row > .ds-muted:not(.dsw-filed) { grid-column: 6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* ===== DS pages polish, part 4 (design, kulkardio_1, 2026-09-29) ===== */
.ds-nowrap { white-space: nowrap; }

/* ===== Spacing utilities (csp-styles, kulkardio_4, 2026-10-01): for what used to be inline style
   attributes, so the proxy's CSP can say style-src 'self' (audit A27). =====
   A utility says what this one element needs, as the inline style it replaced did, so it wins over
   any component's margin: !important here and nowhere else (utilities-win, kulkardio_1, 2026-10-13).
   Without it, a later component rule of the same weight silently won (.ds-actions, .reg-table-wrap,
   .reg-help, .ds-title). Never put a u-* class where a component's own spacing must stay. */
.u-mt-0 { margin-top: 0 !important; }
.u-mt-8 { margin-top: var(--sp-2) !important; }
.u-mt-12 { margin-top: var(--sp-3) !important; }
.u-mt-16 { margin-top: var(--sp-4) !important; }
.u-mt-24 { margin-top: var(--sp-5) !important; }
.u-center { text-align: center !important; }
/* ============================================================================
   Layout: header, unit switcher, containers, page titles
   ============================================================================ */
/* ===== Layout ===== */
.reg-container { max-width: 1000px; margin: 0 auto; padding: 0 20px; }
.reg-main { min-height: 100vh; }
/* ===== Header ===== */
.reg-header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 0 0;
    position: sticky;
    top: 0;
    z-index: 100;
}
.reg-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.reg-logo {
    font-weight: 700;
    color: var(--teal-600);
    text-decoration: none;
}
.reg-logo span {
    font-weight: 400;
    color: var(--ink-3);
}
.reg-nav { display: flex; align-items: center; gap: 16px; }
.reg-user { font-size: 14px; color: var(--ink-3); }
/* Several roles wrap to a second line rather than cut mid-word; the full list is in the title. */
.reg-role { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: var(--fs-xs); line-height: 1.25; color: var(--ink-3); white-space: normal; overflow: hidden; }
/* ===== Dashboard ===== */
.reg-dashboard {
    padding: 32px 0;
}
@media (max-width: 899px) {
    .reg-header-inner { height: 48px; }
}
.ds-title { margin: 20px 0 16px; }
.ds-title p { margin: 2px 0 0; font-size: 14px; color: var(--ink-3); }
.ds-back { display: inline-flex; align-items: center; min-height: 32px; font-size: 14px; color: var(--ink-3); text-decoration: none; margin-top: 12px; }
.ds-back:hover { color: var(--teal-600); }
.ds-center { text-align: center; display: block; }
/* ===== Header: clinical unit switcher ===== */
.reg-units { display: inline-flex; gap: 2px; padding: 3px; border-radius: 100px; border: 1px solid var(--line); }
.reg-unit { padding: 5px 14px; border-radius: 100px; font-size: 13px; font-weight: 600; color: var(--ink-3); text-decoration: none; white-space: nowrap; min-height: 32px; display: inline-flex; align-items: center; }
.reg-unit:hover { color: var(--teal-600); }
.reg-unit-on { background: var(--teal-600); color: #fff; }
.reg-unit-on:hover { color: #fff; }
@media (max-width: 599px) {
    .reg-units { order: 3; width: 100%; justify-content: center; }
}
/* ===== Header: keep one row on desktops ===== */
.reg-header .reg-container { max-width: 1240px; }
.reg-header-inner { gap: 12px; }
.reg-logo, .reg-nav .reg-btn, .reg-user { white-space: nowrap; }
.reg-user { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 600px) and (max-width: 899px) { .reg-units { order: 3; }
}
/* ===== DS registry: week and month views ===== */
.ds-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.reg-logo { letter-spacing: -0.02em; font-size: 19px; }
.reg-header { box-shadow: 0 1px 0 rgba(14,124,134,0.08), 0 4px 16px rgba(26,43,45,0.04); }
.reg-units { background: #eef4f4; border-color: transparent; }
.reg-unit-on { box-shadow: 0 1px 2px rgba(6,90,98,0.25); }
/* ===== Rolės ir teisės (admin/permissions.php) =====
   The only table in the project allowed to scroll sideways: nine columns of
   permissions never fit a phone. The role column and the two header rows stay
   put while it scrolls, so a tick always says which role and which permission. */
.reg-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ds-toolbar .ds-views .reg-unit { font-size: 14px; padding: 7px 18px; min-height: 38px; }
/* ===== Telling the two switchers apart =====
   The unit pills at the top and the view buttons in the calendar looked the same, so
   the eye could not tell "which part of the clinic" from "which view of it". The
   units keep the pills and move next to the logo; the views become tabs
   (clinic head, 2026-09-23). */
@media (min-width: 600px) {
    .reg-header-inner > .reg-units { margin-right: auto; margin-left: 28px; }
}
.ds-views .reg-unit { border-radius: 0; background: transparent; border-bottom: 2px solid transparent;
    color: var(--ink-3); font-weight: 600; }
.ds-views .reg-unit:hover { color: var(--teal-600); border-bottom-color: var(--line); }
.ds-views .reg-unit-on, .ds-views .reg-unit-on:hover { background: transparent; color: var(--teal-600);
    border-bottom-color: var(--teal-600); }

/* ===== Header: „Pasiūlymas" (suggestion-box, kulkardio_3, 2026-10-06) ===== */
/* A label on a computer; on a phone the bar has four buttons, so it becomes the pencil alone
   (its title and aria-label still say „Pasiūlymas"). */
.reg-suggest-icon { display: none; }
/* ===== „Kalendorius: Savaitė · Mėnuo" back to the calendar (calendar-pair, kulkardio_3, 2026-10-07) ===== */
.ds-calpair { display: flex; align-items: center; flex-wrap: nowrap; gap: var(--sp-2); margin: var(--sp-3) 0 var(--sp-1); }
.ds-calpair-label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-base); color: var(--ink-3); margin-right: 2px; }
.ds-calpair-center { justify-content: center; margin-top: var(--sp-4); }
/* ============================================================================
   Components: buttons
   ============================================================================ */
/* ===== Buttons =====
   primary (the one thing to do), outline (the others), success, quiet (a link
   that behaves like a button) and danger (an outline in red). Three sizes; on a
   phone every button is at least 44px high. Only colours move on hover, over
   --motion; a press sinks by a pixel; focus shows at once (no transition on
   the outline). */
.reg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 18px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: var(--fs-base);
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color var(--motion) var(--ease), border-color var(--motion) var(--ease),
        color var(--motion) var(--ease), box-shadow var(--motion) var(--ease), transform var(--motion-fast) var(--ease);
}
.reg-btn:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(1px); }
.reg-btn:disabled, .reg-btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.reg-btn-primary { background: var(--teal-600); color: #fff; }
.reg-btn-primary:hover { background: var(--teal-800); }
.reg-btn-outline { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.reg-btn-outline:hover { background: var(--teal-50); border-color: var(--teal-300); color: var(--teal-800); }
.reg-btn-success { background: var(--color-success); color: #fff; }
.reg-btn-success:hover { background: #065f46; }
.reg-btn-danger { background: var(--surface); color: var(--urgent-strong); border-color: var(--urgent); }
.reg-btn-danger:hover { background: var(--urgent-bg); }
.reg-btn-sm { min-height: 32px; padding: 5px 12px; font-size: var(--fs-sm); }
.reg-btn-lg { min-height: 48px; padding: 12px 24px; font-size: var(--fs-md); }
.reg-btn-block { width: 100%; }
.reg-copy-btn {
    flex-shrink: 0;
    background: none;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--ink-3);
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
    line-height: 1;
    transition: var(--transition);
}
.reg-copy-btn:hover {
    border-color: var(--teal-600);
    color: var(--teal-600);
}
.reg-copy-btn.reg-copied {
    border-color: var(--color-success);
    color: var(--color-success);
}
.dsw-awaiting-row a:not(.reg-btn) { color: var(--ink); font-weight: 600; text-decoration: none; }
.dsw-awaiting-row .reg-btn { margin-left: auto; }
.dsw-actions .reg-btn { padding: 2px 8px; font-size: 11px; min-height: 24px; }
.dsw-form .reg-btn { padding: 0 6px; font-size: 11px; min-height: 20px; height: 20px; }
.dsw-results .dsw-awaiting-row .reg-btn { margin-left: auto; }
.dsw-results .dsw-hit-actions .reg-btn { margin-left: 0; height: 30px; min-height: 30px; padding: 0 12px; font: 500 13px/1 var(--font-family); }
/* ===== A found patient in one predictable row (design, 2026-09-28) =====
   The classic results, the live list under the box and the red bar (ds-bar,
   .ds-bar-row) share this row. On a phone it wrapped into three uneven lines
   (about 126px each, the buttons on line 1 or 2 by the length of the name).
   Now, on a phone: line 1 is the procedure badge, the name (cut short with „…"
   if it must) and the two actions at the same width on the right; line 2 is
   the small print: telephone, who registered, the date, and in the classic
   results the status and the code where the width allows. An invisible break
   (::after, order 1) splits the two lines. On a computer: one line, the name
   and the registrar shortened rather than the row wrapping. */
.dsw-hit .dsw-hit-actions .reg-btn { min-width: 76px; justify-content: center; }
.ds-dialog-choices .reg-btn { width: 100%; }
/* That reset is for the week card's ✕ box; the referral card's „Atšaukti" is a
   .reg-btn-danger and keeps its red outline (it read as a text link, 2026-09-29). */
.reg-btn.dsw-cancel-btn { border: 1px solid var(--urgent); background: var(--surface); }
.reg-btn.dsw-cancel-btn:hover { background: var(--urgent-bg); }
.reg-btn, .reg-input, .reg-tab, .dsw-cancel-btn { font-family: var(--font-family); }
@media (prefers-reduced-motion: reduce) {
    .reg-btn:active { transform: none; }
}
/* An icon inside a button: sized to the text so the button keeps its height,
   and hidden from a screen reader, which reads the label instead. */
.reg-btn-ico { font-size: 1em; line-height: 1; margin-right: 8px; }
.ds-contact-actions .reg-btn { width: 100%; min-height: 48px; justify-content: center; font-size: 16px; }
.ds-dialog-actions .reg-btn { flex: 1; }
.admin-actions .reg-btn { width: 100%; min-height: 46px; padding: 6px 10px; text-align: center; line-height: 1.25; }
/* The bar's „Pranešti" sits in a .dsw-form, and the week card's „.dsw-form .reg-btn" (20px, 11px type)
   shrank it beside a 32px „Perkelti" (control's live check). On a computer both are .reg-btn-sm again;
   the phone's 44px rule above is untouched. */
@media (min-width: 600px) {
    .ds-alerts .dsw-hit-actions .dsw-form .reg-btn,
    .dsl-list .dsw-hit-actions .dsw-form .reg-btn { height: auto; min-height: 32px; padding: 5px 12px; }
}
.ds-alerts .dsw-hit-actions .dsw-form .reg-btn, .dsl-list .dsw-hit-actions .dsw-form .reg-btn { font-size: var(--fs-sm); }
/* „Paskirti datą" between two cards keeps the cards' spacing. */
.ds-page > a.reg-btn-block { margin-top: var(--sp-4); }
@media (min-width: 900px) {
    .dsw-awaiting-list > .dsw-awaiting-row > a:not(.reg-btn) { grid-column: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .dsw-awaiting-list > .dsw-awaiting-row > .reg-btn { grid-column: 8; margin-left: 0; }
}

/* ============================================================================
   Components: alerts
   ============================================================================ */
/* ===== Alerts ===== */
.reg-alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
}
.reg-alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.reg-alert-success {
    background: var(--color-success-light);
    color: #065f46;
    border: 1px solid #a7f3d0;
}
/* Said to the physician on the confirmation, where it has to be read, not
   skimmed: the same shape as the other alerts, in the colour of a caution. */
.reg-alert-warn {
    background: #fffbeb;
    border: 1px solid #fcd34d;
    color: #92400e;
}
.ds-noak { margin: 12px 0; font-weight: 600; text-align: center; }
.reg-alert-info {
    background: var(--color-primary-light);
    color: #065a62;
    border: 1px solid #a7d8db;
}
.reg-alert { white-space: pre-line; }
.ds-echo-warn { margin-top: 12px; }

/* ============================================================================
   Components: cards, tables, tabs, badges
   ============================================================================ */
/* ===== Cards ===== */
.reg-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 32px;
}
.reg-card-header {
    margin-bottom: 24px;
}
.reg-card-header h1, .reg-card-header h2 {
    font-size: 20px;
    font-weight: 700;
}
/* Belongs with "Layout"; kept here because it must come after .reg-card-header h1, .reg-card-header h2. */
.reg-dashboard h1 {
    font-size: 24px;
    margin-bottom: 24px;
}
.reg-card-header p {
    color: var(--ink-3);
    font-size: 14px;
    margin-top: 4px;
}
/* ===== Table ===== */
.reg-table-wrap { overflow-x: auto; margin-top: 24px; }
.reg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.reg-table th, .reg-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}
.reg-table th {
    font-weight: 600;
    color: var(--ink-3);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--surface-2);
}
.reg-table tr:hover td { background: var(--surface-2); }
.reg-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap; /* „EP", „Atšaukta" never break inside a badge (ward list at 390) */
}
.reg-badge-draft { background: #fef3c7; color: #92400e; }
.reg-badge-submitted { background: var(--color-success-light); color: #065f46; }
.reg-badge-vaa { background: var(--vaa-bg); color: var(--vaa-ink); }
.reg-badge-eit { background: var(--eit-bg); color: var(--eit-ink); }
/* ===== Registrar Dashboard ===== */
.reg-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--line);
    margin-bottom: 0;
}
.reg-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-3);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: var(--transition);
}
.reg-tab:hover { color: var(--ink); }
a.reg-tab { text-decoration: none; }
.reg-tab-active {
    color: var(--teal-600);
    border-bottom-color: var(--teal-600);
}
.reg-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 100px;
    background: var(--teal-600);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    margin-left: 6px;
}
@media (max-width: 899px) {
    .reg-card { padding: 16px; border-radius: var(--radius-sm); }
    .reg-card-header h1, .reg-card-header h2 { font-size: 18px; }
}
/* Belongs with "Layout"; kept here because it must come after .reg-card-header h1, .reg-card-header h2 in (max-width: 899px). */
@media (max-width: 899px) {
    .reg-dashboard h1 { font-size: 20px; margin-bottom: 16px; }
}
/* Belongs with "Layout"; kept here because it must come after .reg-dashboard h1 in (max-width: 899px). */
.ds-title h1 { font-size: 22px; font-weight: 700; margin: 0; line-height: 1.3; }
.ds-eyebrow { display: block; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.ds-card { padding: 18px 16px; margin-top: 16px; }
.ds-card-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.ds-card-head h2 { font-size: 16px; font-weight: 700; margin: 0; }
.ds-datebox .ds-eyebrow { color: var(--teal-800); }
.ds-datebox-none .ds-eyebrow, .ds-datebox-none .ds-datebox-day { color: #92400e; }
.ds-dateline .reg-badge { vertical-align: 1px; }
.ds-badge-naujas { background: #fef3c7; color: #92400e; }
.ds-badge-suplanuotas { background: #eff6ff; color: #1e40af; }
.ds-badge-itrauktas { background: var(--color-success-light); color: #065f46; }
.ds-badge-atlikta { background: var(--color-primary-light); color: var(--teal-800); }
.ds-badge-neatvyko { background: #f3f4f6; color: #374151; }
.ds-badge-atsauktas { background: #fef2f2; color: #991b1b; }
/* ===== DS week cards: actions; arrived state ===== */
.ds-badge-atvyko { background: var(--color-success); color: #fff; }
.dsw-sub .reg-badge { font-size: 10px; padding: 0 5px; }
/* The three blocks are one family: same heading, same padding, same links. */
.ds-card-links .ds-card-head { margin-bottom: 4px; }
.reg-badge-stac_b { background: var(--color-primary-light); color: var(--teal-800); }
.reg-badge-stac_ep { background: #ecebfb; color: #3b3f9e; }
/* „Pacientai be datos": how many wait for a date, in red on the button (clinic head, 2026-10-08). */
.ds-views .reg-tab-count, .ds-views .reg-unit-on .reg-tab-count { background: var(--urgent); color: #fff;
    min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; }
@media (min-width: 900px) {
    .dsw-awaiting-list > .dsw-awaiting-row > .reg-badge:first-child { grid-column: 1; justify-self: start; }
}

/* ============================================================================
   Components: forms, inputs, checkboxes, choices, focus
   ============================================================================ */
/* ===== Forms ===== */
.reg-form-group {
    margin-bottom: 16px;
}
.reg-form-group label {
    display: block;
}
.reg-form-group label .req { color: var(--color-accent); }
.reg-input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: 15px;
    background: var(--surface);
}
.reg-input:focus {
    outline: none;
}
select.reg-input { cursor: pointer; }
textarea.reg-textarea { resize: vertical; min-height: 60px; }
.reg-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.reg-form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}
.reg-help {
    font-size: 13px;
    margin: 8px 0 0;
}
.reg-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}
/* ===== Checkbox ===== */
.reg-checkbox-label {
    cursor: pointer;
}
.reg-checkbox-label input[type="checkbox"] {
    accent-color: var(--teal-600);
}
.reg-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.reg-checkbox-row .reg-checkbox-label { flex-shrink: 0; margin: 0; padding: 8px 0; }
/* ===== Forms, refined (design, 2026-09-28; docs/design-system.md) =====
   Labels a quiet 13px/600 caption; fields 42px with a soft edge that warms on
   hover and a teal glow on focus; selects with their own chevron; disabled
   fields visibly asleep. Checkboxes and radios drawn in the system's style,
   20px, aligned with their text in rows that are 40px high (44px on a phone):
   the „.reg-form-group label" rule had turned every checkbox row into a block,
   the box sitting on the baseline of its words. Help text above AA (it was 4.4:1). */
.reg-form-group label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.reg-input { min-height: 42px; padding: 9px 12px; border-color: var(--line); color: var(--ink); line-height: 1.35;
    transition: border-color var(--motion) var(--ease), box-shadow var(--motion) var(--ease), background-color var(--motion) var(--ease); }
.reg-input::placeholder { color: var(--ink-3); opacity: 0.85; }
.reg-input:hover:not(:disabled):not(:focus) { border-color: #b3c7c9; }
.reg-input:focus { border-color: var(--teal-600); box-shadow: 0 0 0 3px rgba(14, 124, 134, 0.16); }
.reg-input:disabled, .reg-input[readonly] { background: var(--surface-2); color: var(--ink-3); border-color: var(--line-soft); cursor: not-allowed; }
select.reg-input { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%233c5053' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; }
/* Disabled selects: the whole background again, because „.reg-input:disabled" sets it
   with the shorthand and the chevron would otherwise repeat across the field. */
select.reg-input:disabled { background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238aa0a3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center / 12px 8px; }
textarea.reg-input { min-height: 88px; line-height: 1.45; }
.reg-help { color: var(--ink-3); }
.reg-form-group .reg-checkbox-label, .reg-checkbox-label { display: flex; align-items: center; gap: 10px; min-height: 40px; margin: 0; padding: 6px 0;
    font-size: 15px; font-weight: 400; line-height: 1.35; color: var(--ink); }
.reg-checkbox-label input[type="checkbox"], .reg-checkbox-label input[type="radio"] { appearance: none; -webkit-appearance: none; flex: 0 0 20px;
    width: 20px; height: 20px; margin: 0; border: 1.5px solid #9fb4b7; border-radius: 5px; background: var(--surface) center / 12px 10px no-repeat;
    cursor: pointer; transition: background-color var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease); }
.reg-checkbox-label input[type="radio"] { border-radius: 50%; }
.reg-checkbox-label input[type="checkbox"]:hover, .reg-checkbox-label input[type="radio"]:hover { border-color: var(--teal-500); }
.reg-checkbox-label input[type="checkbox"]:checked { background-color: var(--teal-600); border-color: var(--teal-600); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 10'%3E%3Cpath d='M1.5 5.2l3 3 6-6.4' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.reg-checkbox-label input[type="radio"]:checked { background-color: var(--teal-600); border-color: var(--teal-600); box-shadow: inset 0 0 0 4px var(--surface); }
.reg-checkbox-label input:disabled { opacity: 0.5; cursor: not-allowed; }
.reg-checkbox-label:has(input:disabled) { color: var(--ink-3); cursor: not-allowed; }
.ds-checks { gap: 2px; }
.ds-checks .ds-indent { margin: 2px 0 6px 30px; width: calc(100% - 30px); max-width: 340px; }
@media (max-width: 599px) { .reg-checkbox-label, .reg-form-group .reg-checkbox-label, .reg-input { min-height: 44px; } }
/* ===== Form page ===== */
.reg-form-page {
    padding-block: 24px; /* block only: a shorthand here took .reg-container's side gutter away */
}
/* Belongs with "Layout"; kept here because it must come after .reg-form-page. */
/* ===== Responsive ===== */
@media (max-width: 899px) {
    .reg-container { padding: 0 12px; }
}
/* Belongs with "Layout"; kept here because it must come after .reg-container in (max-width: 899px). */
@media (max-width: 899px) {
    .reg-dashboard { padding-block: 20px; } /* block only: the shorthand took the side gutter away */
}
/* Belongs with "Layout"; kept here because it must come after .reg-container in (max-width: 899px). */
@media (min-width: 600px) and (max-width: 899px) { .reg-header-inner { height: auto; min-height: 56px; flex-wrap: wrap; padding-block: 8px; }
}
.reg-section {
    margin-bottom: 24px;
}
.reg-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}
/* ===== Auto-fill indicator ===== */
.reg-autofill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--color-success);
    margin-left: 8px;
}
@media (max-width: 899px) {
    .reg-form-page { padding-block: 16px; }
    .reg-input { font-size: 16px; }
}
.ds-confirm .reg-checkbox-label { min-height: 44px; }
.ds-card .reg-section { margin-bottom: 0; }
.ds-checks { display: flex; flex-direction: column; }
.ds-checks .reg-checkbox-label { min-height: 44px; }
.ds-indent { margin-left: 26px; width: auto; max-width: 320px; }
.ds-choices { display: flex; flex-direction: column; gap: 8px; }
.ds-choice { display: flex; align-items: center; gap: 12px; padding: 12px 14px; min-height: 52px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.ds-choice input { width: 20px; height: 20px; accent-color: var(--teal-600); flex-shrink: 0; margin: 0; }
.ds-choice:has(input:checked) { border: 2px solid var(--teal-600); background: var(--color-primary-light); padding: 11px 13px; }
.ds-choice-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ds-choice-date { font-size: 15px; font-weight: 500; }
.ds-choice-hint { font-size: 12px; color: var(--teal-800); }
.ds-choice-free { font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.ds-choice:has(input:checked) .ds-choice-free { color: var(--teal-800); font-weight: 500; }
.ds-choice-none { border-style: dashed; }
.ds-more { border: 1px dashed #9fb6b8; border-radius: var(--radius-sm); }
.ds-more summary { list-style: none; cursor: pointer; padding: 12px 14px; min-height: 52px; display: flex; align-items: center; font-size: 15px; font-weight: 500; color: var(--teal-600); }
.ds-more summary::-webkit-details-marker { display: none; }
.ds-more summary::after { content: '›'; margin-left: auto; font-size: 20px; transition: var(--transition); }
.ds-more[open] summary::after { transform: rotate(90deg); }
.ds-more[open] { border-style: solid; }
.ds-more .ds-choice { border-left: none; border-right: none; border-radius: 0; }
.ds-cancel-form .reg-help { margin: 0; }
.dsw-search .reg-input { max-width: 360px; }
@media (max-width: 899px) { .dsw-search .reg-input { max-width: 100%; }
}
.ds-dialog :focus-visible { outline: 2px solid var(--teal-600); outline-offset: 2px; }
.reg-input:focus-visible { outline: none; }
.ds-choices-row { flex-direction: row; }
.ds-choices-row .ds-choice { flex: 1; }
.people-search .reg-input { max-width: 420px; }
.people-filter .reg-form-row-3 .reg-form-group { margin-bottom: 8px; }
.role-group .reg-checkbox-label { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.ds-toolbar-left .reg-input { max-width: 320px; }
/* ===== A telephone number the rule refuses (reg.js, 2026-09-28): red edge, reason under it ===== */
.reg-input.reg-input-bad, .reg-input.reg-input-bad:focus { border-color: var(--urgent); box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.12); }
/* A box emptied because what it belonged to changed (the relation of a replaced second number). */
.reg-input.reg-input-attn { border-color: var(--soon); box-shadow: 0 0 0 3px var(--soon-bg); }
/* ===== eit-form (kulkardio_2, 2026-09-29): „Kita" text field and the echocardiography warning ===== */
.ds-kita[hidden], .ds-echo-warn[hidden], .ds-echo-soon[hidden] { display: none; }
.ds-kita { margin-top: 8px; }
/* ===== vaa-groups (kulkardio_3, 2026-10-01): the VAA history boxes in two labelled groups ===== */
/* The legend looks like .role-group's, so the two grouped-checkbox fieldsets read as one component. */
.ds-check-group { border: 1px solid var(--line-soft); border-radius: 8px; margin: 4px 0 6px; padding: 4px 12px 6px; min-width: 0; }
.ds-check-group legend { padding: 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }

/* ===== A read-only field (csp-styles, kulkardio_4, 2026-10-01): stac/new.php shows the ward this way on the edit form ===== */
.inp-static { background: var(--surface-2); }
/* ============================================================================
   Components: dialogs
   ============================================================================ */
.ds-cancel-label { color: var(--ink-3); }
/* ===== Cancel dialog ===== */
.ds-dialog { border: none; border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 24px; width: min(92vw, 380px); font-family: var(--font-family); color: var(--ink); }
.ds-dialog::backdrop { background: rgba(26, 43, 45, 0.45); }
.ds-dialog-name { margin: 0 0 12px; font-weight: 600; }
.ds-dialog-choices { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.ds-dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
/* The date picker inside the assign dialog: one press per day, and a day with
   no places left is greyed rather than hidden, so a full week reads as full
   instead of looking like a gap in the calendar. */
.ds-assign-dialog { width: min(94vw, 420px); }
.ds-daypick { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 14px; max-height: 46vh; overflow-y: auto; }
.ds-daypick-day { display: block; cursor: pointer; }
.ds-daypick-day input { position: absolute; opacity: 0; width: 0; height: 0; }
.ds-daypick-cell { display: flex; align-items: baseline; gap: 10px; padding: 10px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius); }
.ds-daypick-day input:checked + .ds-daypick-cell { border-color: var(--teal-600); background: var(--color-primary-light); box-shadow: inset 0 0 0 1px var(--teal-600); }
.ds-daypick-day input:focus-visible + .ds-daypick-cell { outline: 2px solid var(--teal-600); outline-offset: 2px; }
.ds-daypick-wd { font-weight: 600; min-width: 32px; }
.ds-daypick-date { flex: 1; }
.ds-daypick-free { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ds-daypick-full .ds-daypick-cell { opacity: 0.5; cursor: not-allowed; }
/* ===== Cancel dialog: explanation box ===== */
.ds-dialog-label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 500; margin: 8px 0; }
.ds-dialog-label textarea { font-weight: 400; }
.ds-dialog .ds-dialog-name { margin: 0 0 16px; padding: 10px 14px; border-left: 3px solid var(--teal-600); border-radius: 0 8px 8px 0;
    background: var(--surface-2); font-size: 18px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; color: var(--ink); }
.ds-dialog .ds-dialog-name:empty { display: none; }
.ds-dialog .ds-dialog-name:has(+ .ds-contact-when:not(:empty)),
.ds-assign-dialog .ds-dialog-name:has(+ .ds-muted) { margin-bottom: 0; padding-bottom: 2px; border-radius: 0 8px 0 0; }
.ds-cancel-label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; margin: 6px 0; }
/* ===== The cancellation dialog =====
   Centred on the screen, the chosen reason turns green, and the two things you can
   do are at the bottom where they belong (clinic head, 2026-09-23). */
.ds-dialog { margin: auto; }
.ds-reason { display: block; cursor: pointer; }
.ds-reason input { position: absolute; opacity: 0; width: 0; height: 0; }
.ds-reason .ds-reason-btn { display: flex; width: 100%; justify-content: center; cursor: pointer; }
.ds-reason input:focus-visible + .ds-reason-btn { outline: 2px solid var(--teal-600); outline-offset: 2px; }
.ds-reason input:checked + .ds-reason-btn { color: #1b7f3b; border-color: #1b7f3b; background: #f1f9f3; font-weight: 700; }
.ds-reason-note { display: block; margin: 4px 0 12px; }
/* The rule above out-ranked the hidden attribute, so the week dialog's note box was
   in view for every reason; it appears with „Kita“ only, as intended (F51). */
.ds-reason-note[hidden] { display: none; }
.ds-move-told { margin: var(--sp-3) 0; }

/* ============================================================================
   Components: copyable lines and date headers (from the old registrar list)
   ============================================================================ */
.reg-entries-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}
.reg-entry-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px;
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.reg-entry-card.reg-done {
    opacity: 0.5;
}
.reg-entry-main {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.reg-entry-action {
    flex-shrink: 0;
    padding-top: 2px;
}
.reg-date-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 16px 0 6px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0;
}
.reg-date-header:first-child { padding-top: 8px; }
.reg-entry-lines { flex: 1; min-width: 0; }
.reg-line-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
}
.reg-line-row + .reg-line-row { margin-top: 2px; }
.reg-line {
    font-size: 14px;
    line-height: 1.4;
    color: var(--ink);
    user-select: all;
    word-break: break-word;
    flex: 1;
    min-width: 0;
}
@media (max-width: 899px) {
    .reg-entry-action { align-self: flex-end; }
}
.ds-entry .reg-line-row { align-items: center; }

/* ============================================================================
   Pages: sign-in and enrolment
   ============================================================================ */
/* ===== Login page ===== */
.reg-login-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.reg-login-card {
    width: 100%;
    max-width: 420px;
}
.reg-login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.reg-login-logo h1 {
    font-size: 28px;
    color: var(--teal-600);
}
.reg-login-logo h1 span {
    font-weight: 400;
    color: var(--ink-3);
}
.reg-login-logo p {
    font-size: 14px;
    color: var(--ink-3);
    margin-top: 4px;
}
/* ===== Enrolment (enrol.php): the computer's authenticator step, "Tai ne aš" restart ===== */
.reg-enrol-h { font-size: 20px; margin: 0 0 8px; color: var(--ink); }
/* A card that explains two cases one after the other: the second heading needs air. */
.reg-enrol-h-next { margin-top: 24px; }
.reg-enrol-restart { margin-top: 12px; }
.reg-enrol-steps li { margin-bottom: 6px; }
.reg-enrol-key { margin: 0 0 16px; overflow-wrap: anywhere; }
.reg-enrol-key code { font-family: var(--font-mono, 'IBM Plex Mono', monospace); font-size: 13px; }
.reg-enrol-qr-img { max-width: 220px; margin: 8px auto 0; }
.reg-enrol-qr-img svg { display: block; width: 100%; height: auto; }
/* The computer's QR code, front and centre: the page decides computer or phone
   from the request (deviceKindFromRequest), not from the window width. */
.reg-enrol-qr-main { margin-bottom: 20px; text-align: center; }
.reg-enrol-qr-main .reg-enrol-qr-img { margin-top: 0; }
/* The fold-out: the manual key, under the QR code. */
.reg-enrol-fold { margin-bottom: 20px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.reg-enrol-fold > summary::-webkit-details-marker { display: none; }
.reg-enrol-fold > summary::after { content: '›'; margin-left: auto; font-size: 20px; transition: var(--transition); }
.reg-enrol-fold[open] > summary::after { transform: rotate(90deg); }
.reg-enrol-fold .reg-enrol-qr-img { margin-bottom: 14px; }
/* Enrolment: who is enrolling (two pills above the number), and the quiet "start over" link. */
.reg-enrol-kind { display: flex; gap: 10px; margin-top: 4px; }
.reg-enrol-pill { flex: 1; position: relative; margin: 0; }
.reg-enrol-pill span { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--ink-3); cursor: pointer; transition: var(--transition); user-select: none; }
.reg-enrol-pill span:hover { border-color: var(--ink-3); }
.reg-enrol-pill input:checked + span { border-color: var(--teal-600); background: var(--color-primary-light); color: var(--teal-800); }
.reg-enrol-pill input:focus-visible + span { outline: 2px solid var(--teal-600); outline-offset: 2px; }
.reg-enrol-again { margin-top: 16px; text-align: center; }
.reg-enrol-again-btn:hover { color: var(--ink); }
.reg-enrol-steps-clear li { margin-bottom: 10px; }
.reg-enrol-stores { display: grid; gap: 8px; margin-top: 8px; }
/* On the registration and code steps the title is the way back to the start page;
   it must not look like a link in the middle of a heading (clinic head, 2026-09-23). */
.reg-login-logo h1 a { color: inherit; text-decoration: none; }
.reg-login-logo h1 a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ============================================================================
   Pages: unit landing (dashboard, DS home, my referrals)
   ============================================================================ */
.reg-dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.reg-dash-card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    text-decoration: none;
    color: var(--ink);
    transition: var(--transition);
    border: 2px solid transparent;
}
.reg-dash-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--teal-600);
}
.reg-dash-card h2 {
    font-size: 20px;
    margin-bottom: 8px;
    color: var(--teal-600);
}
.reg-dash-card p {
    font-size: 14px;
    color: var(--ink-3);
}
@media (max-width: 899px) {
    .reg-dash-card { padding: 20px; }
}
.ds-card-new h2 { display: flex; align-items: center; justify-content: space-between; }
.ds-plus { font-weight: 400; font-size: 24px; line-height: 1; }
.ds-rows { display: flex; flex-direction: column; }
.ds-row { display: flex; flex-direction: column; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.ds-row:hover .ds-row-name { color: var(--teal-600); }
.ds-row-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
.ds-row-name { font-size: 15px; font-weight: 600; }
.ds-row-date { font-size: 13px; }
.ds-card-links { padding: 6px 16px; }
.ds-card-links .ds-link-row:first-of-type { border-top: none; }
.ds-link-row { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: 15px; }
.ds-link-row span { color: var(--ink-3); }
.ds-help-top { margin: -6px 0 12px; }
@media (max-width: 599px) {
    .reg-card { padding: 18px 16px; }
}
/* ===== Dashboard: clinical unit cards ===== */
.reg-dash-units { margin-top: 4px; }
.reg-dash-unit { background: var(--teal-600); color: #fff; border: 2px solid var(--teal-600); padding: 28px 24px; min-height: 150px; display: flex; flex-direction: column; gap: 6px; }
.reg-dash-unit h2 { color: #fff; font-size: 26px; margin: 0; }
.reg-dash-unit-go { margin-top: auto; font-size: 14px; font-weight: 600; color: #fff; opacity: 0.9; }
.reg-dash-unit:hover { background: var(--teal-800); border-color: var(--teal-800); box-shadow: var(--shadow-md); }
h1, h2, h3, .ds-title h1, .reg-dash-unit h2 { letter-spacing: -0.015em; }
/* ===== Unit landing pages: the calendar button and the ward badges ===== */
/* Closer to the heading than the cards below it: the calendar is the first
   thing a registrar wants, not one of three equal choices. */
.nav-calendar { margin-top: -8px; margin-bottom: 20px; }
/* "Įtraukti pacientą į" and the procedure name read as one block, the lead a
   shade quieter so the name is what the eye lands on. */
/* The two procedure cards sit inside the "Įtraukti pacientą" block, so they carry no
   frame of their own: the block is the frame, and they are the choices in it. */
.ds-card .reg-dash-grid { margin: 0; }
.ds-card .ds-card-new { box-shadow: none; border: 1px solid var(--line); }
.ds-card .ds-card-new:hover { border-color: var(--teal-600); background: var(--color-primary-light); }
/* ===== "Mano siuntimai": the patient's sheet, one press from the row =====
   The row itself is a link, so the sheet cannot be nested inside it; the two sit
   side by side in a wrapper and the border moves to the wrapper. Open referrals
   only: there is nothing to hand a patient whose referral was cancelled. */
.ds-row-wrap { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.ds-row-wrap .ds-row { flex: 1; min-width: 0; border-top: none; }
.ds-row-sheet { flex: 0 0 auto; align-self: center; display: inline-flex; align-items: center; padding: 0 16px;
    min-height: 38px; font-size: 14px; font-weight: 600; white-space: nowrap;
    border: 1px solid var(--teal-600); border-radius: 8px; color: var(--teal-600); text-decoration: none; background: #fff; }
.ds-row-sheet:hover { background: var(--color-primary-light); }
/* „Mano siuntimai": one line on a desktop, two on a phone. The row is a flex line
   that wraps; the name is allowed to take the whole width below 700px, which pushes
   the rest onto a second line and no further. */
.ds-rows .ds-row { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.ds-row-meta { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-size: 14px; min-width: 0; }
/* The procedure belongs to the person, so it sits beside the name: that leaves the
   second line to the identity and the date, and a phone gets exactly two lines. */
.ds-row-type { font-weight: 700; letter-spacing: 0.03em; font-size: 13px; margin-left: 6px; }
.ds-row-type-vaa { color: var(--vaa-ink); }
.ds-row-type-eit { color: #b45309; }
/* A status worth saying out loud: arrived, missed, cancelled. Scheduled is the date. */
.ds-row-flag { font-weight: 600; }
.ds-row-flag-atvyko { color: #047857; }
.ds-row-flag-neatvyko, .ds-row-flag-atsauktas { color: #b91c1c; }
.ds-rows .ds-row, .ds-row-meta { max-width: 100%; overflow-wrap: anywhere; }
.ds-row-wrap { max-width: 100%; }
/* ===== DS pages polish, part 2: the referral card (design, kulkardio_1, 2026-09-29) ===== */
/* Whom the card is about, first. */
.ds-card-name { margin: 0 0 var(--sp-3); font-size: var(--fs-xl); font-weight: 600; line-height: 1.25; color: var(--ink); overflow-wrap: anywhere; }
/* ===== DS home: procedures still to come (design, kulkardio_1, 2026-09-29) =====
   The same card as VAA/EIT, drawn quiet: white with a dashed edge, no shadow, no hover, nothing to
   press. Text stays legible (--ink-3, 4.95:1 on white), lighter than the live cards' teal. */
.ds-card .ds-card-soon { background: var(--surface); border: 1px dashed var(--line); box-shadow: none; cursor: default; }
.ds-card .ds-card-soon:hover { background: var(--surface); border-color: var(--line); box-shadow: none; }
.ds-card .ds-card-soon h2 { color: var(--ink-3); font-weight: 500; }
.ds-card .ds-card-soon p { color: var(--ink-3); }
.ds-soon-tag { padding: 2px 8px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--ink-2);
    font-size: var(--fs-xs); font-weight: 600; letter-spacing: 0.02em; }

/* ============================================================================
   Pages: DS waiting lists and search results
   ============================================================================ */
/* ===== DS: registrar list and capacity planner ===== */
.ds-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ds-group-counts { font-weight: 500; text-transform: none; letter-spacing: 0; }
.ds-group-warn { color: #92400e; }
.ds-entry { margin-top: 8px; }
.ds-entry-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; font-size: 12px; color: var(--ink-3); }
.ds-entry-meta a { color: var(--teal-600); text-decoration: none; font-weight: 600; }
.ds-entry-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.ds-entry-actions form { margin: 0; }
.dsw-awaiting { margin-top: 0; margin-bottom: 16px; }
/* One line when closed: the list used to push the week calendar further down
   every time it grew. The chevron is the only marker; "Sąrašas ›" keeps its
   place on the right and opens the list page instead of the box. */
.ds-awaiting { padding: 0; }
.ds-awaiting > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 12px 16px; }
.ds-awaiting > summary::-webkit-details-marker { display: none; }
.ds-awaiting > summary::before { content: '›'; font-size: 20px; line-height: 1; color: var(--ink-3); transition: var(--transition); }
.ds-awaiting[open] > summary::before { transform: rotate(90deg); }
.ds-awaiting-title { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.ds-awaiting-link { margin-left: auto; white-space: nowrap; }
.ds-awaiting .dsw-awaiting-list { padding: 0 16px 12px; }
.dsw-awaiting-list { display: flex; flex-direction: column; }
.dsw-awaiting-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.dsw-results { margin-top: 0; margin-bottom: 16px; }
/* A search result is one link to its week (the name's ::after covers the line); the
   two buttons after the name and „Paskirti datą“ sit above it (2026-09-28). */
.dsw-hit { position: relative; padding-left: 8px; padding-right: 8px; border-radius: var(--radius-sm); }
.dsw-hit:hover { background: var(--surface-2); }
.dsw-hit-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.dsw-hit-link:focus-visible { outline: none; }
.dsw-hit-link:focus-visible::after { outline: 2px solid var(--teal-600); outline-offset: -2px; }
.dsw-hit-actions, .dsw-hit .reg-btn { position: relative; z-index: 1; }
.dsw-hit-actions { display: inline-flex; gap: 6px; align-items: center; }
.dsw-hit-date { margin-left: auto; white-space: nowrap; font-weight: 600; font-variant-numeric: tabular-nums; }
/* The row's actions in one fixed column at the right end, after the date and „Istorija", so the
   code, the telephone and the physician follow the name on every row, with or without
   „Perkelti" (walk 5, 2026-10-01). A phone keeps its own two lines (below). */
@media (min-width: 600px) {
    .dsw-hit > .dsw-hit-date { order: 1; }
    .dsw-hit > .pt-hist-link { order: 2; }
    .dsw-hit > .dsw-hit-actions, .dsw-hit > .reg-btn { order: 3; }
    .dsw-hit > .dsw-hit-actions { min-width: 158px; justify-content: flex-end; }
    /* A row with nothing to press keeps the column empty, so its date lines up with the others;
       a row without a date takes „Istorija" (and „Paskirti datą") to the right end all the same. */
    .dsw-hit:not(:has(> .dsw-hit-actions)):not(:has(> .reg-btn))::after { content: ''; order: 3; flex: 0 0 158px; }
    .dsw-hit:not(:has(> .dsw-hit-date)) > .pt-hist-link { margin-left: auto; }
    .dsw-hit > .reg-btn, .dsw-results .dsw-hit > .reg-btn { margin-left: 0; }
}
@media (min-width: 600px) {
    .dsw-hit { flex-wrap: nowrap; }
    .dsw-hit > .dsw-hit-link { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .dsw-hit > * { flex-shrink: 0; }
    .dsw-hit > .dsw-hit-link, .dsw-hit > .ds-muted { flex-shrink: 1; }
}
.dsw-awaiting-row.dsw-hl { outline: 3px solid var(--color-accent); outline-offset: 1px; }
.dsl-list > .dsw-awaiting-row:first-child { border-top: 0; }
.dsl-list .dsw-hit.dsl-on, .dsl-list .dsl-idle.dsl-on { background: var(--color-primary-light); }
/* „Laukia datos" / „Laukia patvirtinimo" on a computer: the same column in every row, placed by
   class, so a missing telephone or „2×" shifts nothing. */
@media (min-width: 900px) {
    .dsw-awaiting-list > .dsw-awaiting-row { display: grid; align-items: center; column-gap: var(--sp-3);
        grid-template-columns: 44px 200px 28px 112px 128px minmax(0, 1fr) auto auto; }
    .dsw-awaiting-list > .dsw-awaiting-row > * { grid-row: 1; min-width: 0; }
}
/* ===== Copyable code and telephone in a found patient's row (design, kulkardio_1, 2026-09-29) =====
   Above the row's stretched link, as the buttons are, so a click selects instead of opening the week;
   `all` makes one click or a double-click take the whole value, „+" included. */
.dsw-hit > .ds-copy { position: relative; z-index: 1; cursor: text; -webkit-user-select: all; user-select: all; }

/* ============================================================================
   Pages: DS calendar — toolbar, live search, warning bar, week
   ============================================================================ */
.ds-bulk-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ds-bulk-label { font-weight: 600; font-size: 14px; }
.ds-bulk-field { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 500; }
.ds-num { width: 72px; padding: 8px 10px; text-align: center; font-variant-numeric: tabular-nums; }
@media (max-width: 599px) {
    .ds-num { width: 62px; padding: 8px 6px; }
}
.ds-views { flex-shrink: 0; }
.dsw-today { font-size: 12px; font-weight: 500; margin-left: 8px; text-decoration: none; }
.dsw-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: start; }
.dsw-day { background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.dsw-weekend { box-shadow: none; }
.dsw-head { display: flex; flex-direction: column; }
.dsw-date { font-size: 14px; }
.dsw-count { font-weight: 600; padding: 1px 6px; border-radius: 100px; white-space: nowrap; }
.dsw-closed { background: var(--surface-2) !important; color: #9fb6b8 !important; }
.dsw-section { display: flex; flex-direction: column; }
.dsw-card { display: flex; border-radius: 6px; font-size: 12px; min-width: 0; }
.dsw-card.dsw-off { opacity: 0.5; }
.dsw-name { font-weight: 600; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsw-name:hover { color: var(--teal-600); }
.dsw-form { margin: 0; }
.dsw-card.dsw-arrived { border-color: #6ee7b7; }
.dsw-actions { flex-wrap: wrap; margin-top: 4px; }
.dsw-phone { text-decoration: none; white-space: nowrap; }
/* ===== DS registry: neutral cards, add links, month '+' ===== */
.dsw-add { display: inline-flex; align-items: center; gap: 4px; border: 1px dashed #9fb6b8; border-radius: 6px; font-weight: 600; color: var(--teal-600); text-decoration: none; }
.dsw-add:hover { border-color: var(--teal-600); background: var(--color-primary-light); }
/* ===== DS week view: calm design ===== */
.dsw-section-vaa { border-left: 3px solid var(--vaa); padding-left: 8px; }
.dsw-section-eit { border-left: 3px solid var(--eit); padding-left: 8px; }
.dsw-card, .dsw-card.dsw-arrived { border: 1px solid var(--line); border-left: 1px solid var(--line); background: var(--surface); }
.dsw-count, .dsw-count-vaa, .dsw-count-eit { background: var(--surface-2); color: var(--ink-3); }
.dsw-link { color: var(--ink-3); text-decoration: none; cursor: pointer; display: inline-flex; align-items: center; }
.dsw-link:hover { color: var(--teal-600); }
/* ===== DS week view: compact rows ===== */
.dsw-day { gap: 6px; padding: 6px 8px; }
.dsw-card { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 1px 8px; padding: 3px 6px; line-height: 1.3; }
.dsw-name { font-size: 12px; }
.dsw-link { font-size: 11px; min-height: 20px; padding: 0 3px; }
.dsw-add { min-height: 24px; padding: 2px 6px; font-size: 11px; }
@media (max-width: 899px) { .dsw-link { min-height: 28px; font-size: 13px; }
}
/* Belongs with "dialogs"; kept here because it must come after .dsw-link in (max-width: 899px). */
.ds-dialog-close { font-size: 14px; }
/* ===== DS week view: day counts share the group colour ===== */
.dsw-count-vaa { background: var(--vaa-bg); color: var(--vaa-ink); }
.dsw-count-eit { background: var(--eit-bg); color: var(--eit-ink); }
/* ===== DS week view: arrival checkbox ===== */
.dsw-checkbox { width: 18px; height: 18px; border: 1.5px solid #9fb6b8; background: #fff; cursor: pointer; padding: 0; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; line-height: 1; }
.dsw-checkbox:hover { border-color: var(--color-success); background: var(--color-success-light); }
.dsw-checkbox-on { background: var(--color-success); border-color: var(--color-success); cursor: default; }
.dsw-card.dsw-arrived .dsw-name { color: var(--ink-3); }
/* ===== DS week view: group header with free count and add link; plain phone ===== */
.dsw-phone { color: var(--ink); font-weight: 500; }
/* Belongs with "DS waiting lists and search results"; kept here because it must come after .dsw-phone. */
@media (max-width: 599px) {
    .dsw-hit > * { order: 2; font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; }
}
/* Belongs with "forms"; kept here because it must come after .dsw-hit > * in (max-width: 599px). */
.reg-field-error { font-size: 13px; color: var(--urgent-strong); margin: 6px 0 0; }
/* Belongs with "sign-in and enrolment"; kept here because it must come after .dsw-hit > * in (max-width: 599px). */
.reg-enrol-who { margin: 0 0 20px; font-size: 16px; line-height: 1.5; }
/* Belongs with "sign-in and enrolment"; kept here because it must come after .dsw-hit > * in (max-width: 599px). */
.reg-enrol-steps { margin: 0 0 20px; padding-left: 22px; line-height: 1.5; font-size: 14px; }
/* Belongs with "sign-in and enrolment"; kept here because it must come after .dsw-hit > * in (max-width: 599px). */
.reg-enrol-again-btn { background: none; border: 0; padding: 0 12px; min-height: 44px; font: inherit; font-size: 13px; color: var(--ink-3); text-decoration: underline; cursor: pointer; }
/* Belongs with "sign-in and enrolment"; kept here because it must come after .reg-enrol-steps. */
/* The authenticator steps: four short lines a person follows with the phone in the
   other hand, the lead of each in bold; the camera warning is a box of its own
   (clinic head, 2026-09-28). */
.reg-enrol-steps-clear { font-size: 15px; }
/* Belongs with "sign-in and enrolment"; kept here because it must come after .dsw-hit > * in (max-width: 599px). */
.reg-enrol-camera { margin: 0 0 18px; white-space: normal; }
/* ===== DS registry: search and highlight ===== */
.dsw-search { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }
/* „Išvalyti" beside the search: a text link one can see (it was the week card's 11px grey link). */
.dsw-search > .dsw-link { font-size: var(--fs-sm); font-weight: 500; color: var(--teal-700); text-decoration: underline; text-underline-offset: 2px; min-height: 40px; }
.dsw-search > .dsw-link:hover { color: var(--teal-900); }
.dsw-hit-actions .dsw-form { display: inline-flex; }
/* „Pranešta ✓" in one green everywhere: search, live and bar rows as the week and the card (review B15). */
.dsw-hit-actions .dsw-called-on { background: var(--told); border-color: var(--told-line); color: var(--told-ink); font-weight: 600; }
.dsw-hit-actions .dsw-called-on:hover { background: var(--told-hover); border-color: var(--told-hover-line); }
/* The telephone is a tel: link now; „.dsw-awaiting-row a" made it 600 like the name. */
.dsw-hit > .dsw-phone { font-weight: 500; color: var(--ink); }
@media (max-width: 599px) {
    .dsw-hit > .reg-badge:first-child, .dsw-hit > .dsw-hit-link, .dsw-hit > .ds-double,
    .dsw-hit > .dsw-hit-actions, .dsw-hit > .reg-btn { order: 0; font-size: inherit; color: inherit; }
}
.dsw-card.dsw-hl { outline: 3px solid var(--color-accent); outline-offset: 1px; }
/* ===== DS week view: fixed slot grid ===== */
.dsw-day { min-height: 0; }
.dsw-section { gap: 3px; }
/* The VAA places read 8 + 4 + 4 (clinic head, 2026-10-03): a little air under the eighth
   slot, booked or empty, so a place's number reads at a glance; the twelfth already has
   the capacity edge under it. Counted among the slots only, so the „Visi atvyko" line
   above them does not shift it; every day draws at least eight, so the gaps line up. */
.dsw-section-vaa > .dsw-slot:nth-child(8 of .dsw-slot) { margin-bottom: 6px; }
.dsw-slot { box-sizing: border-box; border-radius: 6px; }
.dsw-slot-empty { display: flex; align-items: center; justify-content: center; text-decoration: none; }
a.dsw-slot-empty:hover { border-color: var(--teal-600); color: var(--teal-600); background: var(--color-primary-light); }
.dsw-card.dsw-slot { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 0 6px; padding: 3px 6px; overflow: hidden; flex-wrap: nowrap; }
.dsw-checkbox-gap { width: 18px; height: 18px; }
.dsw-text { display: flex; flex-direction: column; min-width: 0; }
.dsw-text .dsw-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsw-sub { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsw-sub .dsw-phone { color: var(--ink); font-weight: 500; }
/* A long surname still won't always fit this narrow a column at any legible size;
   the tightened tracking buys a little room, and the title attribute (set where this
   is rendered) carries the full "Vardas Pavardė, rolė" for anything still clipped. */
.dsw-sub.dsw-phys { color: var(--ink-3); font-weight: 400; font-size: 11px; letter-spacing: -0.02em; }
.dsw-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 0; margin: 0; }
.dsw-actions .dsw-link { min-height: 18px; padding: 0 2px; font-size: 11px; line-height: 18px; }
.dsw-card.dsw-off { height: auto; min-height: 30px; padding: 2px 6px; }
.dsw-card.dsw-off .dsw-name { font-size: 11px; }
/* ===== DS week view: consolidated day header ===== */
.dsw-head { gap: 3px; margin-bottom: 4px; }
.dsw-typeline { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 22px; }
.dsw-typeline .dsw-add { min-height: 22px; padding: 0 6px; font-size: 11px; border-style: solid; border-color: var(--line); color: var(--teal-600); }
.dsw-section-eit { margin-top: 10px; }
/* ===== DS week view: narrower weekend columns =====
   The actions used to appear only on hover and then jump to an absolute corner, which
   made the card flicker and shift under the pointer. They are always visible now, and
   nothing about a card moves when it is hovered (clinic head, 2026-09-23). */
/* ===== DS week view: three short lines per row ===== */
.dsw-text { line-height: 1.2; }
.dsw-sub.dsw-phone { color: var(--ink); }
@media (min-width: 900px) {
    .dsw-card.dsw-slot { position: relative; }
}
/* ===== DS week view: a fourth line (registering physician) needs more room ===== */
.dsw-slot { height: 64px; }
/* ===== DS week view: weekends are ordinary columns; actions always visible ===== */
@media (min-width: 900px) {
    .dsw-actions .dsw-link { font-size: 10.5px; line-height: 16px; min-height: 16px; }
}
.dsw-weekend { background: var(--surface-2); }
/* ===== DS week view: seven columns fit from 1280px, none narrower than 160px =====
   At 180px the week needed 1308px, so on a 1280px screen Sunday slid off the side.
   A smaller gap and the day's own padding give the pixels back; below about 1200px
   the week still scrolls sideways rather than squeeze the cards further. */
@media (min-width: 900px) {
    .dsw-grid { grid-template-columns: repeat(7, minmax(160px, 1fr)); gap: 6px; }
    .ds-registry { overflow-x: auto; }
    .dsw-day { padding: 6px 5px; }
    .dsw-section-vaa, .dsw-section-eit { padding-left: 5px; }
}
/* ===== Search highlight fades ===== */
.dsw-card.dsw-hl { animation: dsw-hl-fade 6s ease-out forwards; }
/* ===== DS week view: cancelled and no-show rows at the bottom of the day ===== */
.dsw-off-list { margin-top: 12px; padding-top: 8px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 3px; }
/* „Perkelta į 2026-10-05" wraps under the name instead of ending in „…" (walk 17). */
.dsw-off-list .dsw-closed-tag { white-space: normal; overflow: visible; text-overflow: clip; }
/* ===== DS week view: no-show = red cross, not washed out ===== */
.dsw-checkbox-no { background: var(--color-accent); border-color: var(--color-accent); color: #fff; cursor: default; }
/* ===== DS week view: outcome boxes are buttons (undo with confirmation) ===== */
button.dsw-checkbox-on, button.dsw-checkbox-no { cursor: pointer; }
button.dsw-checkbox-on:hover { background: #065f46; border-color: #065f46; }
button.dsw-checkbox-no:hover { background: #9a3412; border-color: #9a3412; }
.dsw-filed { white-space: nowrap; }
.dsw-cancel-btn { background: none; border: none; }
.dsw-sub { font-size: 11.5px; }
/* week grid */
.dsw-day { border: 1px solid var(--line-soft); box-shadow: none; border-radius: 10px; }
/* Today: the teal frame, a pixel stronger through an outline so nothing inside
   moves, and the date on a band of honey gold across the top of the column. The
   word „šiandien" beside the date went: the colour says it (clinic head,
   2026-09-28). The band reaches the column's edges through the day's own padding,
   6px 8px, 6px 5px on a desktop (--dsw-pad-*). The band adds no height (clinic head,
   2026-10-01: the columns start level): its top padding is the padding it covers, so
   the date sits where every other day's date sits, and the edge takes the last pixel. */
.dsw-today-col { border-color: var(--teal-600); outline: 1px solid var(--teal-600); outline-offset: 0; background: #f3fafa;
    box-shadow: 0 0 0 4px rgba(14,124,134,0.16); --dsw-pad-y: 6px; --dsw-pad-x: 8px; }
.dsw-today-col .dsw-date { margin: calc(-1 * var(--dsw-pad-y)) calc(-1 * var(--dsw-pad-x)) -1px; padding: var(--dsw-pad-y) var(--dsw-pad-x) 0;
    background: linear-gradient(180deg, var(--today-hi), var(--today)); border-bottom: 1px solid var(--today-line); border-radius: 9px 9px 0 0; color: var(--today-ink); }
.dsw-today-col .dsw-date strong { color: var(--today-strong); }
@media (min-width: 900px) { .dsw-today-col { --dsw-pad-x: 5px; } }
.dsw-date strong { font-size: 20px; letter-spacing: -0.02em; }
.dsw-date { color: var(--ink-3); }
.dsw-card.dsw-slot { border-color: var(--line-soft); transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.dsw-card.dsw-slot:hover { border-color: #9fc7cb; box-shadow: 0 1px 4px rgba(26,43,45,0.06); }
.dsw-text .dsw-name { font-size: 12.5px; letter-spacing: -0.01em; }
/* A free place reads as free at a glance (clinic head, 2026-09-28): a firmer
   2px dash in --line-strong (3.3:1, the edge of a control; 1.5px is drawn as 1) and a „+" in muted ink
   (4.95:1; it was 1.5:1). A closed place stays different: hatched, no border. */
.dsw-slot-empty { border: 2px dashed var(--line-strong); color: var(--ink-3); font-size: 18px; font-weight: 400; }
.dsw-slot-closed { border: none; background: repeating-linear-gradient(135deg, #e9f0f0 0 5px, transparent 5px 11px); opacity: 1; }
.dsw-section-vaa { border-left-color: var(--vaa); }
.dsw-section-eit { border-left-color: var(--eit); }
.dsw-checkbox { border-radius: 5px; border-color: #b8c8ca; transition: background 0.12s ease, border-color 0.12s ease; }
.dsw-typeline .dsw-add { border-radius: 100px; }
@media (prefers-reduced-motion: reduce) {
    .dsw-card.dsw-hl, .dsw-awaiting-row.dsw-hl { animation: none !important; }
}
/* ===== Ward blocks ===== */
.dsw-section-stac_b { border-left: 3px solid var(--teal-600); padding-left: 8px; }
.dsw-section-stac_ep { border-left: 3px solid #5b5fc7; padding-left: 8px; }
.dsw-count-stac_b { background: var(--color-primary-light); color: var(--teal-800); }
.dsw-count-stac_ep { background: #ecebfb; color: #3b3f9e; }
/* ===== Places edited inside the calendars ("Keisti vietas") ===== */
.cap-edit-btn { align-self: flex-end; flex-shrink: 0; }
/* The places input sits where the normal view shows "+": the week type line and the month bar row stay one line each. */
.cap-num { width: 52px; padding: 2px 6px; min-height: 26px; font-size: 12px; font-weight: 600; text-align: center; flex-shrink: 0; -moz-appearance: textfield; }
.cap-num::-webkit-outer-spin-button, .cap-num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.dsw-typeline .cap-num { margin-left: auto; }
/* A group a press returns to (#dsw-…) stops below the sticky header, not under it. */
.dsw-section { scroll-margin-top: 72px; }
/* A number the save refused comes back as typed, in red, so it is corrected rather than retyped (F66). */
.cap-num.cap-num-refused { border-color: #b91c1c; background: #fdf1f1; }
.dsm-bar-row .cap-num { width: 44px; padding: 2px 4px; }
.cap-actions { display: flex; align-items: center; gap: 14px; margin: 12px 0; }
.cap-cancel { font-size: 14px; }
.cap-bulk { margin: 4px 0 12px; }
.cap-bulk > summary { cursor: pointer; font-size: 14px; color: var(--teal-600); font-weight: 500; padding: 4px 0; }
.cap-bulk[open] > summary { margin-bottom: 8px; }
.cap-inline-help { margin: 0; }
.ds-views-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex-shrink: 0; }
@media (min-width: 900px) { .cap-edit .dsw-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
/* „Pranešta": the button itself says it, in fresh-grass green, and the card stays
   as it was (clinic head, 2026-09-28). The pale wash over the whole card, and the
   bold that came with it, went; the button's pale field had been lost under the
   white of the desktop buttons, so a ✓ in the word was all that showed. Dark green
   lettering on the bright field reads at 6:1. The ward's „Patvirtinta" keeps its wash. */
.dsw-card.dsw-confirmed { background: #f2f9f4; border-color: #cfe6d4; }
.dsw-card.dsw-confirmed:hover { border-color: #9fc7cb; }
.ds-registry .dsw-card .dsw-actions .dsw-called-btn.dsw-called-on { background: var(--told); border: 1px solid var(--told-line); border-radius: 4px; color: var(--told-ink); }
.ds-registry .dsw-card .dsw-actions .dsw-called-btn.dsw-called-on:hover { background: var(--told-hover); border-color: var(--told-hover-line); }
.dsw-called-btn { background: none; border: none; font-family: var(--font-family); }
/* ===== Telling the patient, when the telephone is not answered (clinic head, 2026-09-28) =====
   „Pranešti" turns red ten days before a visit nobody has told the patient about;
   the corner counts the different days a call failed; after three it reads
   „Nepasiekiamas" and takes the wider half of the row. The bar above the calendar
   lists the red ones; a line opens the week on the card, framed in red. */
.dsw-contact-btn { position: relative; }
.ds-registry .dsw-card .dsw-actions .dsw-contact-btn.dsw-due,
.ds-registry .dsw-hit-actions .dsw-contact-btn.dsw-due { background: var(--urgent); border: 1px solid var(--urgent-strong); border-radius: 4px; color: #fff; }
.ds-registry .dsw-card .dsw-actions .dsw-contact-btn.dsw-due:hover,
.ds-registry .dsw-hit-actions .dsw-contact-btn.dsw-due:hover { background: var(--urgent-strong); }
/* „Nepasiekiamas": bright yellow, dark lettering (#1a2b2d on #facc15, 9.4:1), so a
   visit nobody could reach stands apart from the red still-to-call and the green
   told (clinic head, 2026-09-28). Pressing it opens the same dialog. */
.ds-registry .dsw-card .dsw-actions .dsw-contact-btn.dsw-unreachable,
.ds-registry .dsw-hit-actions .dsw-contact-btn.dsw-unreachable { background: var(--unreachable); border: 1px solid var(--unreachable-line); border-radius: 4px; color: var(--ink); }
.ds-registry .dsw-card .dsw-actions .dsw-contact-btn.dsw-unreachable:hover,
.ds-registry .dsw-hit-actions .dsw-contact-btn.dsw-unreachable:hover { background: var(--unreachable-hover); border-color: var(--unreachable-hover-line); }
.ds-registry .dsw-card .dsw-actions:has(.dsw-unreachable) { grid-template-columns: auto 1fr; }
/* The corner counts the days a call failed, at the system's 12px floor (review B16; it was 9.5px). */
.dsw-contact-btn .dsw-tries { position: absolute; top: -9px; right: -6px; min-width: 18px; padding: 0 4px; border-radius: 9px;
    background: var(--urgent-ink); color: #fff; font-size: var(--fs-xs); font-weight: 600; line-height: 16px; text-align: center; box-shadow: 0 0 0 1.5px #fff; pointer-events: none; }
/* In the seven-column week the button is 26px tall and the word fills it: the badge sits on its top edge, clear of the word. */
@media (min-width: 900px) { .ds-registry .dsw-card .dsw-actions .dsw-contact-btn .dsw-tries { top: -12px; right: -3px; } }
@media (max-width: 899px) {
    .ds-registry .dsw-card .dsw-actions .dsw-act { display: inline-flex; align-items: center; justify-content: center; min-height: 36px;
        padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; background: #fff; line-height: 1.2; }
}
.dsw-card.dsw-hl.dsw-hl-red { outline-color: var(--urgent); animation-name: dsw-hl-red-fade; }
.ds-alerts { margin: 0 0 14px; padding: 10px 12px 12px; background: var(--urgent-bg); border: 1px solid var(--urgent-line); border-left: 4px solid var(--urgent); border-radius: 10px; }
.ds-alerts-head { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: 0 0 8px; font-size: 14px; color: var(--urgent-ink); }
.ds-alerts-sign { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%;
    background: var(--urgent); color: #fff; font-weight: 700; font-size: 14px; }
.ds-alerts-note { color: var(--urgent-note); font-size: 12.5px; }
.dsw-actions .dsw-form { display: inline-flex; }
/* Week card actions: icon + word. Phones show the words in a row; desktops show only the icons, one narrow column. */
.dsw-act { display: inline-flex; align-items: center; gap: 4px; }
/* ===== DS week card: labelled buttons, stacked on the right =====
   Words rather than icons, because they are easier to see and to hit; stacked in a
   narrow column so the card stays one row tall (clinic head, 2026-09-23). Nothing
   appears, disappears or moves on hover. */
@media (min-width: 900px) {
    .dsw-card.dsw-slot { grid-template-columns: auto minmax(0, 1fr) auto; }
    .dsw-card.dsw-slot .dsw-actions { display: flex; flex-direction: column; align-items: stretch; justify-content: center;
        gap: 2px; margin: 0 0 0 4px; position: static; background: transparent; padding: 0; }
    .dsw-actions .dsw-act { display: flex; justify-content: center; align-items: center; width: 100%; min-width: 0;
        font-size: 10px; line-height: 16px; min-height: 16px; border: 1px solid var(--line-soft); border-radius: 4px; background: #fff; white-space: nowrap; }
    .dsw-actions .dsw-act:hover { border-color: var(--teal-600); background: var(--color-primary-light); }
    .dsw-actions .dsw-form { display: flex; width: 100%; }
    .dsw-card.dsw-slot .dsw-sub { max-width: none; opacity: 1; }
}
/* ===== The rows under a day: moved away, or cancelled =====
   Both read as ordinary text with one red word for what happened. An all-red row was
   hard on the eye and a half-faded one hard to read at all; who did it and when is a
   click away in the history (clinic head, 2026-09-23). */
.dsw-card.dsw-closed { opacity: 1; height: auto; min-height: 0; padding: 4px 6px; background: #fff; border-color: #e8cfcf; }
.dsw-card.dsw-closed .dsw-name { color: var(--ink); font-size: 12px; }
.dsw-card.dsw-closed .dsw-closed-tag { color: #b91c1c; font-weight: 600; font-size: 11px; max-width: none; opacity: 1; }
.dsw-card.dsw-closed:hover { border-color: #d9a8a8; }
/* ===== DS week card: both marks on the left, the name across the rest =====
   The arrival tick and the cancel cross are the two a registrar reaches for, so they
   stand together in a fixed column and the patient's name gets the width it needs
   (clinic head, 2026-09-23). */
.dsw-marks { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.dsw-checkbox-cancel { border-color: #e3bcbc; color: #b91c1c; font-size: 11px; line-height: 1; background: #fff; }
.dsw-checkbox-cancel:hover { border-color: #b91c1c; background: #fdf1f1; }
@media (min-width: 900px) {
    /* The personal code below is a fixed twelve digits, so the column can afford the
       few pixels that stop „Perkelti" and „Pranešta ✓" from crowding their borders. */
    .dsw-card.dsw-slot .dsw-actions { width: 72px; flex: 0 0 72px; }
    .dsw-actions .dsw-act { padding: 0 4px; }
    .dsw-card.dsw-slot .dsw-name { font-size: 12.5px; }
}
/* The weekday is written out in full; at seven columns it needs the small size and
   the whole line to itself (clinic head, 2026-09-23). */
.dsw-head .dsw-date { font-size: 12px; white-space: nowrap; }
.dsw-head .dsw-date strong { font-size: 15px; margin-right: 3px; }
/* ===== DS week card: the name on its own line, controls beneath it =====
   Two columns of controls left the surname about seventy pixels in a seven-day week.
   The card is now two rows: the name across the top, then the marks, the details and
   the two words under it (clinic head, 2026-09-23). */
.dsw-card.dsw-slot { grid-template-rows: auto auto; align-items: start; row-gap: 1px; }
.dsw-card.dsw-slot > .dsw-name { grid-column: 1 / -1; width: 100%; }
.dsw-card.dsw-slot .dsw-marks { grid-column: 1; align-self: start; }
.dsw-card.dsw-slot .dsw-checkbox-gap { grid-column: 1; }
.dsw-card.dsw-slot .dsw-text { grid-column: 2; }
.dsw-card.dsw-slot .dsw-actions { grid-column: 3; align-self: start; }
/* „Visi atvyko": a quiet line under the procedure count, not a button that competes
   with „+ Įtraukti" (clinic head, 2026-09-23). */
.dsw-allform { margin: 0 0 3px; }
.dsw-allbtn { width: 100%; border: 1px solid var(--line-soft); border-radius: 5px; background: #fff;
    font-family: var(--font-family); font-size: 10.5px; line-height: 18px; min-height: 18px; color: var(--ink-3); cursor: pointer; }
.dsw-allbtn:hover { border-color: #1b7f3b; color: #1b7f3b; background: #f1f9f3; }
/* Where the line is not shown its height stays, an invisible twin of the button, so
   the slots of all seven days start level and a press does not move them (clinic
   head, 2026-10-01). Stacked days on a phone keep it only where it can come and go. */
.dsw-allspace { margin: 0 0 3px; visibility: hidden; pointer-events: none; }
/* ===== The calendar toolbar: search, views, places, on one line =====
   The title, the view buttons and the search each had a line of their own, which
   pushed the calendar down a third of the screen (clinic head, 2026-09-23). */
.ds-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 0 0 14px; }
.ds-toolbar-left { margin: 0; }
.ds-toolbar-left.dsw-search { display: flex; gap: 8px; align-items: center; }
.ds-toolbar-mid { justify-self: center; }
.ds-toolbar-right { justify-self: end; }
.ds-views.reg-units { background: transparent; border: none; padding: 0; gap: 4px; border-radius: 0; }
/* ===== Week cards: the two words in a row of their own, under the details =====
   „Perkelti" and „Pranešti" are pressed for nearly every patient, so they get the
   card's width and a proper height instead of a 16px-high strip beside the details
   (clinic head, 2026-09-28: button size matters, they are clicked often). The code
   and the phone get the width the strip took; at 1280px they had shown four
   characters each. The ticks grow with them. Every slot of a day keeps one height,
   so the rows still line up across the week. */
@media (min-width: 900px) {
    /* Border 2 + 4 + name 16 + 1 + ticks 42 + 1 + 3 + buttons 24 + 3. Any shorter
       and the grid squeezes the name's row (its overflow lets it shrink) under the code. */
    .ds-registry .dsw-section > .dsw-slot { height: 96px; }
    .ds-registry .dsw-card.dsw-slot { grid-template-columns: auto minmax(0, 1fr); padding: 4px 6px 3px; }
    .ds-registry .dsw-card.dsw-slot .dsw-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; width: auto; flex: none; gap: 4px; margin: 3px 0 0; }
    .ds-registry .dsw-marks .dsw-form { display: flex; }
    .ds-registry .dsw-actions .dsw-act { min-height: 24px; line-height: 22px; font-size: var(--fs-xs); }
    .ds-registry .dsw-card .dsw-checkbox,
    .ds-registry .dsw-card .dsw-checkbox-gap { width: 20px; height: 20px; }
}
/* ===== Week card: the patient leads, the actions follow (design, 2026-09-28) =====
   The clinic head asked whether the balance was right; it was not: the name was
   the lightest thing on the card (12.5px) and a solid red „Pranešti" the
   heaviest, in four type sizes, with the registering physician's name in
   monospace. Now: the name at 14px/600 in ink; every detail line at one size,
   12px, monospace only for the digits (code, phone), the physician in Plex Sans;
   the two actions always the same width, quiet by default, and coloured only by
   what the visit needs (docs/design-system.md, semantic states). The day hospital
   only for now (clinic head, 2026-09-28); the ward follows as a phase of its own. */
.ds-registry:not(.stac-page) .dsw-card.dsw-slot .dsw-name { font-size: var(--fs-base); font-weight: 600; letter-spacing: -0.005em; color: var(--ink); }
.ds-registry:not(.stac-page) .dsw-card.dsw-slot .dsw-sub { font-size: var(--fs-xs); line-height: 1.2; }
.ds-registry:not(.stac-page) .dsw-card.dsw-slot .dsw-sub.dsw-phone { color: var(--ink); font-weight: 500; }
.ds-registry:not(.stac-page) .dsw-card.dsw-slot .dsw-sub.dsw-phys { font-family: var(--font-family); letter-spacing: 0; color: var(--ink-3); }
/* „PAVARDĖ V." in two parts: one line high, the initial wraps out of sight when the
   surname and it do not both fit, so the surname is never cut for its initial. */
.dsw-sub.dsw-phys:has(> .dsw-phys-ini) { display: flex; flex-wrap: wrap; column-gap: 0.3em; height: 1.2em; overflow: hidden; text-overflow: clip; }
.dsw-phys-sur { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsw-phys-ini { flex: none; white-space: nowrap; }
@media (min-width: 900px) {
    /* Border 2 + 4 + name 18 + 1 + three 12px lines 43 + 1 + 3 + buttons 26 + 3. */
    .ds-registry:not(.stac-page) .dsw-section > .dsw-slot { height: 102px; }
    .ds-registry:not(.stac-page) .dsw-card.dsw-slot .dsw-actions,
    .ds-registry:not(.stac-page) .dsw-card .dsw-actions:has(.dsw-unreachable) { grid-template-columns: 1fr 1fr; }
    .ds-registry:not(.stac-page) .dsw-actions .dsw-act { min-height: 26px; line-height: 24px; font-size: var(--fs-xs); font-weight: 500; }
}
/* Quiet by default: both words in the outline style of an ordinary button. */
.ds-registry:not(.stac-page) .dsw-card .dsw-actions .dsw-act { color: var(--ink-2); border-color: var(--line); background: var(--surface); border-radius: 6px;
    transition: background-color var(--motion) var(--ease), border-color var(--motion) var(--ease), color var(--motion) var(--ease); }
.ds-registry:not(.stac-page) .dsw-card .dsw-actions .dsw-act:hover { background: var(--teal-50); border-color: var(--teal-300); color: var(--teal-800); }
/* Graded urgency for a visit nobody has told: soon (2-10 days) an orange outline,
   urgent (today or tomorrow) solid red. Told stays green, unreachable yellow. */
.ds-registry:not(.stac-page) .dsw-card .dsw-actions .dsw-contact-btn.dsw-due,
.ds-registry:not(.stac-page) .dsw-hit-actions .dsw-contact-btn.dsw-due { background: var(--surface); border: 1px solid var(--soon); color: var(--soon); font-weight: 600; }
.ds-registry:not(.stac-page) .dsw-card .dsw-actions .dsw-contact-btn.dsw-due:hover,
.ds-registry:not(.stac-page) .dsw-hit-actions .dsw-contact-btn.dsw-due:hover { background: var(--soon-bg); }
.ds-registry:not(.stac-page) .dsw-card .dsw-actions .dsw-contact-btn.dsw-due.dsw-urgent,
.ds-registry:not(.stac-page) .dsw-hit-actions .dsw-contact-btn.dsw-due.dsw-urgent { background: var(--urgent); border-color: var(--urgent-strong); color: #fff; }
.ds-registry:not(.stac-page) .dsw-card .dsw-actions .dsw-contact-btn.dsw-due.dsw-urgent:hover,
.ds-registry:not(.stac-page) .dsw-hit-actions .dsw-contact-btn.dsw-due.dsw-urgent:hover { background: var(--urgent-strong); }
/* The states keep their fills over the quiet default: told green, unreachable yellow. */
.ds-registry:not(.stac-page) .dsw-card .dsw-actions .dsw-called-btn.dsw-called-on { background: var(--told); border-color: var(--told-line); color: var(--told-ink); }
.ds-registry:not(.stac-page) .dsw-card .dsw-actions .dsw-contact-btn.dsw-unreachable { background: var(--unreachable); border-color: var(--unreachable-line); color: var(--ink); }
.ds-registry:not(.stac-page) .dsw-card .dsw-actions .dsw-contact-btn.dsw-unreachable:hover { background: var(--unreachable-hover); }
/* ===== The DS week on one sheet of paper =====
   „Spausdinti savaitę" prints the week in view on one A4 page, landscape (clinic
   head, 2026-09-23). On paper: the name, the telephone and who sent the patient,
   never the personal code (2026-09-28). The page's own grid tag says how many
   slots its tallest day has (--dsw-rows), and every slot gets that share of the
   sheet, so a day opened with more places still fits. Controls, the waiting list
   and the cancelled rows stay on the screen. */
.dsw-print-title, .dsw-print-only { display: none; }
/* ===== Double booking, the desk's mark (2026-09-28): „2×" beside a name, a line on the referral card ===== */
/* In the design palette (design, 2026-09-28): a flag for the desk to check, in the
   clinic's teal family, not a colour of its own; red, orange and yellow stay for
   the contact states. */
.ds-double { display: inline-block; flex: none; padding: 0 5px; border: 1px solid var(--teal-300); border-radius: var(--radius-xs); background: var(--teal-100);
    color: var(--teal-900); font-size: var(--fs-xs); font-weight: 700; line-height: 16px; vertical-align: 1px; white-space: nowrap; cursor: help; }
.ds-double-lines { display: flex; flex-direction: column; gap: 6px; margin: -4px 0 14px; }
.ds-double-line { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--teal-200); border-radius: var(--radius-sm);
    background: var(--teal-50); color: var(--teal-900); font-size: 14px; text-decoration: none; }
.ds-double-line .ds-double { cursor: inherit; }
.dsw-name .ds-double { margin-right: 4px; padding: 0 3px; line-height: 14px; }
.dsw-hit .ds-double { position: relative; z-index: 1; }
.ds-double-line:hover { border-color: var(--teal-500); background: var(--teal-100); }
/* ===== DS live search (2026-09-28): up to five lines under the search box, drawn over the calendar ===== */
.ds-toolbar { position: relative; }
.dsl-list { position: absolute; left: 0; z-index: 20; width: max-content; min-width: min(900px, 100%); max-width: 100%; max-height: min(70vh, 540px); overflow-y: auto; padding: 2px 10px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); }
/* The list is as wide as its longest line, never narrower than before and never wider than the toolbar, so a
   name and the physician are read whole on a computer (clinic head, 2026-10-07: „crippled, no full name … although
   there is plenty of space to the right"). Where the toolbar is too narrow for one line (600–950 px), a line wraps
   instead of squeezing the name to nothing. */
@media (min-width: 600px) {
    .dsl-list .dsw-hit { flex-wrap: wrap; }
    .dsl-list .dsw-hit > .dsw-hit-link { flex-shrink: 0; }
    /* A list with nothing to press anywhere (the patient page's box) keeps no empty column for buttons: wrapped
       onto a line of its own on a long line only, it left the dates out of line. */
    .dsl-list:not(:has(.dsw-hit-actions, .dsw-hit > .reg-btn)) .dsw-hit::after { display: none; }
}
.dsl-list[hidden] { display: none; }
.dsl-list.dsl-stale > * { opacity: 0.55; pointer-events: none; }
.dsl-idle { gap: 6px 10px; padding-left: 8px; padding-right: 8px; border-radius: var(--radius-sm); cursor: pointer; }
.dsl-idle:hover { background: var(--surface-2); }
.dsl-idle-name { font-weight: 600; }
.dsl-note { margin: 8px 0; font-size: 14px; color: var(--ink-3); }
.dsl-spin { width: 16px; height: 16px; flex: none; box-sizing: border-box; border: 2px solid var(--line); border-top-color: var(--teal-600); border-radius: 50%; animation: dsl-turn 0.8s linear infinite; }
.dsl-spin[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .dsl-spin { animation-duration: 2.4s; } }
/* ===== The referral card's „Pranešti" and contact state (2026-09-28): the week's colours, on the card ===== */
.ds-card-contact .dsw-contact-btn.dsw-unreachable { background: var(--unreachable); border-color: var(--unreachable-line); color: var(--ink); }
.ds-card-contact .dsw-contact-btn.dsw-unreachable:hover { background: var(--unreachable-hover); border-color: var(--unreachable-hover-line); }
.ds-card-contact .dsw-called-on { background: var(--told); border-color: var(--told-line); color: var(--told-ink); }
.ds-card-contact .dsw-called-on:hover { background: var(--told-hover); border-color: var(--told-hover-line); }
/* The card's „Pranešti" graded as the week's (review-ds C23, kulkardio_2): an orange outline from 2 to 10 days, solid red today and tomorrow. */
.ds-card-contact .dsw-contact-btn.dsw-due:not(.dsw-urgent) { background: var(--surface); border-color: var(--soon); color: var(--soon); font-weight: 600; }
.ds-card-contact .dsw-contact-btn.dsw-due:not(.dsw-urgent):hover { background: var(--soon-bg); }
.ds-card-contact .dsw-contact-btn.dsw-due.dsw-urgent { background: var(--urgent); border-color: var(--urgent-strong); color: #fff; }
.ds-card-contact .dsw-contact-btn.dsw-due.dsw-urgent:hover { background: var(--urgent-strong); }
.ds-card-contact .dsw-contact-btn { position: relative; }
/* ===== The warning bar, second version (kulkardio_3, 2026-09-28): search-result lines (dsSearchHit, bar mode),
   three open, the rest under „Rodyti dar N", the unreachable under a grey „Nepasiekiami". Minimal: kulkardio_1 styles it.
   The first bar's chip rules (.ds-alert-row and its parts) are gone with it. ===== */
.ds-bar-list { display: flex; flex-direction: column; gap: var(--sp-1); }
.ds-alerts .ds-bar-row { background: var(--surface); }
.ds-bar-left { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.ds-bar-left.ds-bar-soon { color: var(--soon); }
.ds-bar-left.ds-bar-urgent { color: var(--urgent-strong); }
/* The telephone sits above the line's link, like the buttons: tapped or copied, not a jump to the week. */
.dsw-hit .dsw-phone { position: relative; z-index: 1; }
.ds-bar-unreachable { margin-top: var(--sp-2); padding-top: var(--sp-2); border-top: 1px solid var(--line-soft); }
.ds-alerts.ds-alerts-quiet { background: var(--surface-2); border-color: var(--line); border-left-color: var(--ink-4); }
.ds-alerts-quiet .ds-bar-unreachable { margin-top: 0; padding-top: 0; border-top: 0; }
/* The week card's ✕ box had lost its border to the .dsw-cancel-btn reset, beside a bordered ✓. */
.dsw-checkbox.dsw-checkbox-cancel { border-style: solid; border-width: 1.5px; }
/* Past days: a tint instead of 60% opacity, which took names to 4.1:1 and the small print to 2.4:1
   on days the desk still marks „Atvyko" / „Neatvyko". */
.dsw-past, .stac-day.stac-past { opacity: 1; background: var(--surface-2); }
.dsw-past .dsw-date, .stac-past .stac-day-num { color: var(--ink-3); }
/* „EIT –" on a closed day was #9fb6b8 on grey (1.9:1). */
.dsw-count.dsw-closed { color: var(--ink-3) !important; }
/* Labels at 12px, the system's floor. */
.dsw-count { font-size: var(--fs-xs); }
.dsw-name .ds-double { font-size: var(--fs-xs); }
/* „Atšaukti", the one destructive action, always last; on a computer apart at the end (walk 11). */
.ds-actions-row > .dsw-cancel-btn { order: 1; }
@media (min-width: 600px) { .ds-actions-row > .dsw-cancel-btn { margin-left: auto; } }
@media (min-width: 900px) {
    .dsw-awaiting-list > .dsw-awaiting-row > .ds-double { grid-column: 3; justify-self: start; }
    .dsw-awaiting-list > .dsw-awaiting-row > .dsw-phone { grid-column: 5; }
    .dsw-awaiting-list > .dsw-awaiting-row > .dsw-filed { grid-column: 7; }
}
/* ===== Moved and cancelled rows say which procedure (control, 2026-09-29) ===== */
.dsw-closed .dsw-closed-type { font-weight: 600; letter-spacing: .02em; }
/* ===== vaa-flags (kulkardio_2, 2026-09-29): the „!" of the five weekday flags, their print, a day they rule out ===== */
.ds-flag { display: inline-block; margin-right: 4px; font-weight: 800; color: var(--urgent-strong); cursor: help; }
.dsw-flags-print b { font-weight: 800; }

/* ===== The patient's history (patient-page, kulkardio_2, 2026-10-01): /patient-history.php, the name links to it, „Istorija" on a search hit ===== */
.pt-name-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.pt-name-link:hover { color: var(--teal-700); text-decoration-color: currentColor; }
.pt-hist-link, .dsw-awaiting-row a.pt-hist-link { position: relative; z-index: 1; font-size: var(--fs-sm); font-weight: 500; color: var(--teal-700); }
.pt-search { position: relative; margin: var(--sp-3) 0; }
.pt-search .dsw-search { display: flex; flex-wrap: nowrap; gap: var(--sp-2); }
.pt-search .dsw-search .reg-input { flex: 1 1 auto; min-width: 0; }
.pt-head .reg-btn { margin-top: var(--sp-2); }
.pt-section { margin-top: var(--sp-5); }
.pt-section-h { margin: 0 0 var(--sp-2); font-size: var(--fs-md); font-weight: 600; color: var(--ink); }
.pt-empty { margin: 0; }
.pt-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.pt-row { position: relative; display: grid; grid-template-columns: 12.5rem minmax(0, 1.3fr) minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--sp-1) var(--sp-3);
    align-items: baseline; padding: var(--sp-3) var(--sp-4); border-top: 1px solid var(--line-soft); font-size: var(--fs-base); }
.pt-row:first-child { border-top: 0; }
.pt-row:hover { background: var(--surface-2); }
.pt-row-link { position: absolute; inset: 0; border-radius: inherit; }
.pt-row-link:focus-visible { outline: 2px solid var(--teal-600); outline-offset: -2px; }
.pt-row-date { font-weight: 600; font-variant-numeric: tabular-nums; }
.pt-row-what { display: flex; gap: var(--sp-2); align-items: baseline; min-width: 0; }
.pt-what { overflow-wrap: anywhere; }
.pt-row-state { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); align-items: baseline; }
.pt-row-by { text-align: right; font-size: var(--fs-sm); }
.pt-off .pt-row-date, .pt-off .pt-what { color: var(--ink-3); }
.reg-badge.pt-unit-stac { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
/* ===== The week print's slot height (csp-styles, kulkardio_4, 2026-10-01) =====
   --dsw-rows from data-rows, 1..Referrals::PRINT_ROWS_MAX (24): one rule per value instead of an inline
   style (CSP style-src 'self', audit A27). DsCssRulesTest pins this ladder and the capacity bars' one. ===== */
.dsw-grid[data-rows="1"] { --dsw-rows: 1; }
.dsw-grid[data-rows="2"] { --dsw-rows: 2; }
.dsw-grid[data-rows="3"] { --dsw-rows: 3; }
.dsw-grid[data-rows="4"] { --dsw-rows: 4; }
.dsw-grid[data-rows="5"] { --dsw-rows: 5; }
.dsw-grid[data-rows="6"] { --dsw-rows: 6; }
.dsw-grid[data-rows="7"] { --dsw-rows: 7; }
.dsw-grid[data-rows="8"] { --dsw-rows: 8; }
.dsw-grid[data-rows="9"] { --dsw-rows: 9; }
.dsw-grid[data-rows="10"] { --dsw-rows: 10; }
.dsw-grid[data-rows="11"] { --dsw-rows: 11; }
.dsw-grid[data-rows="12"] { --dsw-rows: 12; }
.dsw-grid[data-rows="13"] { --dsw-rows: 13; }
.dsw-grid[data-rows="14"] { --dsw-rows: 14; }
.dsw-grid[data-rows="15"] { --dsw-rows: 15; }
.dsw-grid[data-rows="16"] { --dsw-rows: 16; }
.dsw-grid[data-rows="17"] { --dsw-rows: 17; }
.dsw-grid[data-rows="18"] { --dsw-rows: 18; }
.dsw-grid[data-rows="19"] { --dsw-rows: 19; }
.dsw-grid[data-rows="20"] { --dsw-rows: 20; }
.dsw-grid[data-rows="21"] { --dsw-rows: 21; }
.dsw-grid[data-rows="22"] { --dsw-rows: 22; }
.dsw-grid[data-rows="23"] { --dsw-rows: 23; }
.dsw-grid[data-rows="24"] { --dsw-rows: 24; }
/* ===== The red bar's line leads with the visit's date (bar-date-first, kulkardio_2, 2026-10-03; clinic head) ===== */
@media (min-width: 600px) {
    .ds-bar-row.dsw-hit > .ds-bar-date { order: -1; margin-left: 0; min-width: 9.5em; }
    .ds-bar-row.dsw-hit > .dsw-hit-actions { margin-left: auto; }
}
/* ===== week-navigator (kulkardio_1, 2026-10-07): three months beside the DS week, every week one link.
   Two forms (src/views/week-nav.php): a column left of the week from 1760px, where the seven days keep
   a whole name beside it; from 900px to 1759px a panel under „Savaitės kalendorius" in the week's
   navigation row, laid over the week. Phones: neither (the brief). Paper: neither. ===== */
.wn-wrap > .wn, .wn-pop { display: none; }
@media (min-width: 900px) and (max-width: 1759px) {
    .wn-pop { display: block; position: relative; }
    /* Beside „Šiandien", the two together; „Sekanti ›" keeps the far end. */
    .ds-month-nav .dsm-today-btn + .wn-pop { margin-left: var(--sp-2); margin-right: auto; }
}
@media (min-width: 1760px) {
    .wn-wrap { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
    .wn-wrap > .wn { display: flex; position: sticky; top: 80px; }
    /* The week fits here, so the page need not scroll sideways, and sticky follows the window. */
    .ds-registry:has(.wn-wrap) { overflow-x: visible; }
}
.wn-pop-btn { list-style: none; cursor: pointer; gap: 6px; }
.wn-pop-btn::-webkit-details-marker { display: none; }
.wn-pop[open] > .wn-pop-btn { background: var(--teal-50); border-color: var(--teal-600); color: var(--teal-800); }
/* Over the week, like the search list: shadowed, never pushing anything down. */
.wn-pop-panel { position: absolute; z-index: 60; top: calc(100% + 6px); right: 0; width: 232px; }
.wn-pop-panel > .wn { display: flex; box-shadow: var(--shadow-md); }
/* The calendar itself, the same in both forms. */
.wn { flex-direction: column; gap: 10px; padding: 10px 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface); }
.wn-month + .wn-month { padding-top: var(--sp-2); border-top: 1px solid var(--line-soft); }
/* The month's name heads it and opens it: a link that says so. */
.wn-title { display: flex; align-items: center; justify-content: space-between; min-height: 28px; padding: 0 6px; border-radius: var(--radius-xs);
    font-size: var(--fs-sm); font-weight: 600; color: var(--ink); text-decoration: none; }
.wn-title::after { content: '›'; font-size: var(--fs-md); color: var(--ink-3); }
.wn-title:hover { background: var(--teal-50); color: var(--teal-800); text-decoration: underline; text-underline-offset: 2px; }
.wn-title:hover::after { color: var(--teal-700); }
.wn-title:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 1px; }
.wn-wd { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 2px 0 1px; font-size: 11px; font-weight: 600; color: var(--ink-3);
    text-align: center; line-height: 18px; letter-spacing: 0.02em; }
.wn-wd > :nth-child(n+6) { color: var(--ink-4); }
/* A week is one row and one link: the whole band lights up under the pointer. */
.wn-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: 28px; align-items: center; border-radius: 6px;
    color: var(--ink); text-decoration: none; font-size: var(--fs-xs); text-align: center; font-variant-numeric: tabular-nums;
    transition: background-color var(--motion-fast) var(--ease), color var(--motion-fast) var(--ease); }
.wn-week:hover { background: var(--teal-100); color: var(--teal-900); box-shadow: inset 0 0 0 1px var(--teal-300); }
.wn-week:focus-visible { outline: 2px solid var(--teal-600); outline-offset: 1px; }
.wn-d { line-height: 22px; }
.wn-week .wn-d:nth-child(n+6) { color: var(--ink-3); }
.wn-week.wn-past { color: var(--ink-3); }
.wn-week .wn-d.wn-out { color: var(--ink-4); }
/* Today: the gold of today's column in the week. */
.wn-d.wn-today { justify-self: center; width: 22px; border-radius: 50%; background: var(--today); color: var(--today-ink) !important; font-weight: 700; }
/* The week on screen: solid teal, as the view buttons' current one. */
.wn-week.wn-cur { background: var(--teal-600); color: #fff; font-weight: 600; box-shadow: none; }
.wn-week.wn-cur .wn-d:nth-child(n+6) { color: rgba(255, 255, 255, 0.85); }
.wn-week.wn-cur .wn-d.wn-out { color: rgba(255, 255, 255, 0.6); }
@media (prefers-reduced-motion: reduce) { .wn-week { transition: none; } }
/* ===== search-columns (kulkardio_2, 2026-10-07): a search result line in columns (clinic head: „a search line a bit
   better structured, now its an info line with no gaps"). The live list, the classic results and the patient page's
   box; NOT the warning bar's lines (.ds-alerts) and NOT „Laukia datos" (.dsw-awaiting-list). ===== */
.dsl-head { display: none; }
/* Outside the search grid the name's wrapper is no box of its own (the warning bar's lines, the phone, a browser without
   subgrid): the link and „2×" lay out as before, and the rules that named them as the line's own children follow. */
.dsw-hit > .dsw-hit-name { display: contents; font-size: inherit; color: inherit; }
@media (min-width: 600px) {
    .dsw-hit > .dsw-hit-name > .dsw-hit-link { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .dsl-list .dsw-hit > .dsw-hit-name > .dsw-hit-link { flex-shrink: 0; }
}
/* 600–899 px: two tidy lines — badge, name, status; then code, telephone, physician — the date, „Istorija" and the
   buttons on the right of both. */
@media (min-width: 600px) and (max-width: 899px) {
    :is(.dsl-list, .dsw-results) > .dsw-hit:not(.ds-bar-row) { display: grid; align-items: center; column-gap: 14px; row-gap: 2px; padding: 9px 8px;
        grid-template-columns: auto auto auto minmax(0, 1fr) auto auto auto auto; }
    :is(.dsl-list, .dsw-results) > .dsw-hit:not(.ds-bar-row)::after { content: none; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > * { margin: 0; min-width: 0; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .reg-badge:first-child { grid-column: 1; grid-row: 1; justify-self: start; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .dsw-hit-name { display: block; grid-column: 2 / 5; grid-row: 1; font-weight: 600; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .dsw-hit-name > .dsw-hit-link { overflow: visible; white-space: normal; text-overflow: clip; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .reg-badge[class*="ds-badge-"] { grid-column: 5; grid-row: 1; justify-self: start; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .ds-mono { grid-column: 2; grid-row: 2; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .dsw-phone { grid-column: 3; grid-row: 2; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .dsw-hit-phys { grid-column: 4 / 6; grid-row: 2; white-space: normal; overflow: visible; text-overflow: clip; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .dsw-hit-date { grid-column: 6; grid-row: 1 / 3; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .pt-hist-link { grid-column: 7; grid-row: 1 / 3; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > :is(.dsw-hit-actions, .reg-btn) { grid-column: 8; grid-row: 1 / 3; justify-self: end; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > :is(.ds-mono, .dsw-phone, .dsw-hit-phys) { font-size: var(--fs-xs); }
}
/* The same columns down the whole list where subgrid is there (the clinic's Chrome and Edge). */
@supports (grid-template-columns: subgrid) { @media (min-width: 600px) and (max-width: 899px) {
    :is(.dsl-list, .dsw-results):has(> .dsw-hit) { display: grid; column-gap: 14px; align-items: center;
        grid-template-columns: auto auto auto minmax(0, 1fr) auto auto auto auto; }
    :is(.dsl-list, .dsw-results):has(> .dsw-hit) > * { grid-column: 1 / -1; }
    :is(.dsl-list, .dsw-results) > .dsw-hit:not(.ds-bar-row) { grid-template-columns: subgrid; column-gap: 14px; }
} }
/* ≥ 900 px: one grid for the whole list, each line a subgrid of it, so every column lines up down the list. A browser
   without subgrid keeps the flex line above it, readable as before. */
@supports (grid-template-columns: subgrid) { @media (min-width: 900px) {
    :is(.dsl-list, .dsw-results):has(> .dsw-hit) { display: grid; column-gap: 18px; align-items: center;
        grid-template-columns: [badge] auto [name] fit-content(34ch) [code] auto [phone] auto [phys] fit-content(26ch) [status] auto [slack] minmax(0, 1fr) [date] auto [hist] auto [btn] auto [end]; }
    :is(.dsl-list, .dsw-results):has(> .dsw-hit) > * { grid-column: 1 / -1; }
    /* A subgrid line keeps its own gap unless told: the old line's 10 px pushed the name past its 18 px track. */
    :is(.dsl-list, .dsw-results) > .dsw-hit:not(.ds-bar-row) { display: grid; grid-template-columns: subgrid; column-gap: 18px; align-items: center; padding: 10px 8px; }
    :is(.dsl-list, .dsw-results) > .dsw-hit:not(.ds-bar-row)::after { content: none; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > * { grid-row: 1; min-width: 0; margin: 0; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .reg-badge:first-child { grid-column: badge; justify-self: start; }
    /* The name: bold, the widest column, whole — it wraps rather than ends in „…". */
    :is(.dsl-list, .dsw-results) > .dsw-hit > .dsw-hit-name { display: block; grid-column: name; font-weight: 600; color: var(--ink); white-space: normal; overflow-wrap: anywhere; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .dsw-hit-name > .dsw-hit-link { overflow: visible; white-space: normal; text-overflow: clip; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .dsw-hit-name > .ds-double { margin-left: 6px; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .ds-mono { grid-column: code; color: var(--ink-2); font-weight: 400; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .dsw-phone { grid-column: phone; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .dsw-hit-phys { grid-column: phys; font-size: var(--fs-xs); white-space: normal; overflow: visible; text-overflow: clip; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .reg-badge[class*="ds-badge-"] { grid-column: status; justify-self: start; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .dsw-hit-date { grid-column: date; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > .pt-hist-link { grid-column: hist; }
    :is(.dsl-list, .dsw-results) > .dsw-hit > :is(.dsw-hit-actions, .reg-btn) { grid-column: btn; justify-self: end; min-width: 0; }
    /* The live list's header over the columns. */
    :is(.dsl-list, .dsw-results) > .dsl-head { display: grid; grid-template-columns: subgrid; column-gap: 18px; padding: var(--sp-2) var(--sp-2) var(--sp-1); font-size: 11px; font-weight: 600; color: var(--ink-4);
        text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--line-soft); }
    :is(.dsl-list, .dsw-results) > .dsl-head > * { grid-row: 1; }
    .dsl-head-name { grid-column: badge / code; }
    .dsl-head-code { grid-column: code; } .dsl-head-phone { grid-column: phone; } .dsl-head-phys { grid-column: phys; }
    .dsl-head-status { grid-column: status; } .dsl-head-date { grid-column: date; }
    :is(.dsl-list, .dsw-results) > .dsl-head + .dsw-awaiting-row { border-top: 0; }
} }
/* ============================================================================
   Pages: DS calendar — month
   ============================================================================ */
.ds-month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 12px 0 16px; }
.ds-month-nav strong { font-size: 16px; text-align: center; }
/* ===== Date step: calendar with green available days ===== */
.ds-cal-help { margin: 8px 14px 4px; }
.ds-cal { padding: 8px 14px 12px; }
.ds-cal-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.ds-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ds-cal-wd { font-size: 11px; font-weight: 600; color: var(--ink-3); text-align: center; text-transform: uppercase; padding-bottom: 2px; }
/* A month nothing is opened in yet, said beside its title in the date calendar (review-ds walk 10, kulkardio_2). */
.ds-cal-unopened { font-weight: 400; color: var(--ink-3); }
.ds-cal-day { display: flex; align-items: center; justify-content: center; min-height: 40px; border-radius: 8px; font-size: 14px; font-weight: 500; }
/* A closed or full day: plain muted text (4.95:1) rather than a ghost (1.4-1.8:1);
   the open days keep their green (design, 2026-09-28). */
.ds-cal-off, .ds-cal-off.ds-cal-we { color: var(--ink-3); font-weight: 400; }
.ds-cal-ok { position: relative; background: #dcfce7; color: #166534; border: 1px solid #86efac; cursor: pointer; }
.ds-cal-ok input { position: absolute; opacity: 0; width: 0; height: 0; }
.ds-cal-ok:hover { background: #bbf7d0; }
.ds-cal-ok:has(input:checked) { background: var(--teal-600); border-color: var(--teal-600); color: #fff; font-weight: 700; }
.ds-more:has(.ds-cal-ok input:checked) > summary { color: var(--teal-800); }
/* The date step on one line (clinic head, 2026-10-03): the offered day, and beside it
   „Kita data" with a calendar, a labelled outline button; the calendar opens under
   both. The <details> takes no box of its own (display: contents), so its summary
   is the grid's second column; a browser without that keeps the old stacked step. */
.ds-choices:has(> .ds-more-date) { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.ds-choices:has(> .ds-more-date) > * { grid-column: 1 / -1; }
.ds-choices:has(> .ds-more-date) > .ds-choice:first-child { grid-column: 1; grid-row: 1; }
.ds-more-date { display: contents; }
.ds-more-date > summary { grid-column: 2; grid-row: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 18px;
    border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-2); font-size: var(--fs-base); font-weight: 600; white-space: nowrap; }
.ds-more-date > summary:hover { background: var(--teal-50); border-color: var(--teal-300); color: var(--teal-800); }
.ds-more-date > summary::after { content: none; }
.ds-more-date[open] > summary { background: var(--teal-50); border-color: var(--teal-600); color: var(--teal-800); }
.ds-more-date:not([open]) > .ds-more-body { display: none; }
/* The browser wraps a <details>'s content in a box of its own: that box is the grid item. */
.ds-more-date::details-content { grid-column: 1 / -1; }
.ds-more-date > .ds-more-body { grid-column: 1 / -1; padding: 4px 14px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.ds-ico { flex: none; }
@media (min-width: 900px) { .ds-cal-grid { max-width: 420px; } }
.dsm-day { text-decoration: none; color: var(--ink); gap: 4px; }
.dsm-day:hover { box-shadow: var(--shadow-md); }
.dsm-bar-row { display: flex; align-items: center; gap: 6px; }
.dsm-bar-label { font-weight: 700; color: var(--ink-3); }
.dsm-bar-vaa .dsm-bar-label { color: var(--vaa-ink); }
.dsm-bar-eit .dsm-bar-label { color: var(--eit-ink); }
/* ===== DS week cards: one signal per card ===== */
/* ===== Date picker with counts (registrar) ===== */
.ds-cal-ok span { display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.ds-cal-ok small { font-size: 10px; font-weight: 600; opacity: 0.8; }
.dsm-daylink { text-decoration: none; color: inherit; }
.dsm-open { margin-left: auto; font-size: 11px; color: var(--ink-3); }
.dsm-plus { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--teal-600); color: #fff; font-weight: 700; text-decoration: none; font-size: 15px; line-height: 1; flex-shrink: 0; }
.dsm-plus:hover { background: var(--teal-800); color: #fff; }
/* ===== DS registry: month is desktop-only; no week link on weekend cells ===== */
.stac-weekend .dsm-open, .stac-closed .dsm-open { display: none; }
.dsm-bar-label { font-family: var(--font-family); }
.dsm-bar-stac_b .dsm-bar-label { color: var(--teal-800); }
.dsm-bar-stac_ep .dsm-bar-label { color: #3b3f9e; }
.cap-day .dsm-bar-row { flex-wrap: nowrap; white-space: nowrap; }
.dsm-bar-label { font-size: var(--fs-xs); width: auto; min-width: 28px; }
/* ===== DS pages polish, part 3: the month and the waiting lists (design, kulkardio_1, 2026-09-29) ===== */
/* The month on a computer: the whole day head is the link; „savaitė ›" on every tile was noise (2.4:1). */
.ds-registry:not(.stac-page) .dsm-open { display: none; }
.ds-cal-day:has(input[data-weekday-off]), .ds-choice:has(input[data-weekday-off]),
.ds-daypick-day:has(input[data-weekday-off]) { opacity: .35; pointer-events: none; }

/* ===== The month, second version (month-view-2, kulkardio_2, 2026-10-03): free places first, the
   desk's marks, past days' outcome, the unopened month, „Šiandien", the legend ===== */
/* (1) free places: the number in the picker's green, orange when 1–2 are left, grey when full;
   the bar is the FREE share (an empty grey track when full) */
.dsm-month .dsm-bar-row .dsm-free { font-family: var(--font-family); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.dsm-free b { font-size: var(--fs-sm); color: #166534; }
.dsm-free.dsm-free-low b { color: var(--soon); }
.dsm-free.dsm-free-full { color: var(--ink-3); font-weight: 500; }
.dsm-month .dsm-bar-row .stac-fill-bar.dsm-free-ok, .dsm-sw.dsm-free-ok { background: #22a04b; }
.dsm-month .dsm-bar-row .stac-fill-bar.dsm-free-low, .dsm-sw.dsm-free-low { background: var(--soon); }
.dsm-month .dsm-bar-row .stac-fill-bar.dsm-free-full { background: transparent; }
.dsm-sw.dsm-free-full { background: var(--line-strong); }
/* (2) the desk's marks, counts only */
.dsm-marks { display: inline-flex; gap: 4px; margin-left: auto; }
.dsm-mark { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--radius-pill);
    font-size: var(--fs-xs); font-weight: 700; line-height: 1; font-style: normal; }
.dsm-mark-untold { background: var(--urgent); color: #fff; }
.dsm-mark-flag { background: var(--surface); color: var(--urgent-strong); border: 1px solid var(--urgent-line); }
/* (3) a day gone by: booked · no-shows, quietly */
.dsm-past { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.35; }
.dsm-past b { color: var(--ink-2); font-weight: 600; }
/* (4) a month not opened yet */
.ds-card.dsm-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); border-style: dashed; }
.dsm-banner p { margin: 0; color: var(--ink-2); }
/* (5) „Šiandien" beside the arrows */
.ds-month-nav .dsm-today-btn { margin-left: auto; }
.ds-month-nav strong + .dsm-today-btn { margin-left: var(--sp-2); }
/* On a computer each unit is two lines (month-view-polish): the label, the free places right-aligned
   and the „+" on the first, the bar across the whole cell under them, so every bar has the same
   length and the bars line up down the month. Not in edit mode (the month sits in a form there). */
@media (min-width: 900px) {
    .ds-registry:not(.stac-page) > .dsm-month .dsm-bar-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 6px; row-gap: 3px; align-items: center; }
    .ds-registry:not(.stac-page) > .dsm-month .dsm-bar-row > .dsm-free { grid-column: 2; grid-row: 1; justify-self: end; }
    .ds-registry:not(.stac-page) > .dsm-month .dsm-bar-row > .dsm-plus { grid-column: 3; grid-row: 1; }
    .ds-registry:not(.stac-page) > .dsm-month .dsm-bar-row > .stac-fill { grid-column: 1 / -1; grid-row: 2; height: 5px; }
}
/* (6) the waiting list's summary */
.dsm-wait { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 500; margin-left: 10px; }
.dsm-wait b { color: var(--ink); }
/* (7) the legend */
.dsm-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; font-size: var(--fs-xs); color: var(--ink-3); margin: 8px 0 0; }
.dsm-legend > span { display: inline-flex; align-items: center; gap: 6px; }
.dsm-legend .dsm-plus { width: 18px; height: 18px; font-size: 13px; }
.dsm-sw { display: inline-block; width: 18px; height: 6px; border-radius: 3px; }

/* ===== The date calendar: a month nothing is opened in yet, said beside its title (review-ds, kulkardio_2, 2026-10-01; walk 10) ===== */
.ds-cal-unopened { font-weight: 400; color: var(--ink-3); }
/* ===== The date calendar: today's cell once registration for it has closed (same-day-cutoff, kulkardio_2, 2026-10-06) ===== */
.ds-cal-day.ds-cal-closed { flex-direction: column; line-height: 1.05; cursor: not-allowed; }
.ds-cal-day.ds-cal-closed small { font-size: 9px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.01em; }
/* ===== The capacity bars' width (csp-styles, kulkardio_4, 2026-10-01) =====
   From data-fill in steps of five (src/views/ds.php dsFillStep), one rule per value (CSP, audit A27). ===== */
.stac-fill-bar[data-fill="0"] { width: 0%; }
.stac-fill-bar[data-fill="5"] { width: 5%; }
.stac-fill-bar[data-fill="10"] { width: 10%; }
.stac-fill-bar[data-fill="15"] { width: 15%; }
.stac-fill-bar[data-fill="20"] { width: 20%; }
.stac-fill-bar[data-fill="25"] { width: 25%; }
.stac-fill-bar[data-fill="30"] { width: 30%; }
.stac-fill-bar[data-fill="35"] { width: 35%; }
.stac-fill-bar[data-fill="40"] { width: 40%; }
.stac-fill-bar[data-fill="45"] { width: 45%; }
.stac-fill-bar[data-fill="50"] { width: 50%; }
.stac-fill-bar[data-fill="55"] { width: 55%; }
.stac-fill-bar[data-fill="60"] { width: 60%; }
.stac-fill-bar[data-fill="65"] { width: 65%; }
.stac-fill-bar[data-fill="70"] { width: 70%; }
.stac-fill-bar[data-fill="75"] { width: 75%; }
.stac-fill-bar[data-fill="80"] { width: 80%; }
.stac-fill-bar[data-fill="85"] { width: 85%; }
.stac-fill-bar[data-fill="90"] { width: 90%; }
.stac-fill-bar[data-fill="95"] { width: 95%; }
.stac-fill-bar[data-fill="100"] { width: 100%; }
/* ============================================================================
   Pages: referral card, referral forms, patient check
   ============================================================================ */
/* ===== Dienos stacionaras (DS) ===== */
.ds-page { padding-bottom: 32px; }
/* The panel that stops a second registration of the same person, or a name
   being rewritten by accident. Amber, not red: nothing is wrong yet. */
.ds-confirm { border-left: 4px solid #d97706; background: #fffbeb; }
.ds-confirm h3 { margin: 0 0 10px; font-size: 16px; }
/* Belongs with "dialogs"; kept here because it must come after .ds-confirm h3. */
/* ===== Dialog header: what the dialog is, then whom it is about =====
   The title („Vizito atšaukimas", „Pranešimas pacientui", „Paskirti datą") and
   the patient's name were one dark bold block (clinic head, 2026-09-28). The
   title is now a quiet teal label; the name leads, in a tinted strip with a teal
   edge, and the visit's date or procedure line joins the strip where a dialog
   has one. One rule for every .ds-dialog; the markup is unchanged. */
.ds-dialog h3 { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--teal-800); }
.ds-confirm p { margin: 0 0 8px; }
/* Belongs with "unit landing"; kept here because it must come after .ds-confirm p. */
.reg-dash-unit p { color: rgba(255,255,255,0.85); font-size: 15px; margin: 0; }
/* Belongs with "sign-in and enrolment"; kept here because it must come after .reg-dash-unit p. */
.reg-enrol-fold > p { margin-left: 14px; margin-right: 14px; }
/* Belongs with "sign-in and enrolment"; kept here because it must come after .reg-enrol-fold > p. */
.reg-enrol-mobile p { line-height: 1.5; margin: 0 0 16px; }
.ds-actions { margin-top: 20px; }
.ds-actions-col { display: flex; flex-direction: column; gap: 10px; }
.ds-datebox { display: flex; flex-direction: column; align-items: center; border-radius: var(--radius-sm); background: var(--color-primary-light); }
.ds-datebox-date { color: var(--teal-800); line-height: 1.2; }
.ds-datebox-day { font-size: 15px; color: var(--teal-800); }
.ds-datebox-none { background: #fef3c7; }
.ds-facts { margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.ds-facts > div { display: flex; justify-content: space-between; gap: 12px; }
.ds-facts dt { color: var(--ink-3); flex-shrink: 0; }
.ds-facts dd { margin: 0; text-align: right; font-weight: 500; }
.ds-history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; font-size: 14px; }
.ds-history li { display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
@media (max-width: 599px) {
    .reg-form-page { padding-block: 8px 24px; }
}
/* ===== Usage agreement ===== */
.ds-agreement { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.5; }
.ds-agree { align-items: flex-start; }
.ds-agree input { margin-top: 3px; }
/* Belongs with "sign-in and enrolment"; kept here because it must come after .ds-agree input. */
.reg-enrol-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
/* ===== DS: registrar cancel action ===== */
.ds-cancel { font-size: 13px; }
.ds-cancel > summary { cursor: pointer; color: var(--ink-3); padding: 2px 0; }
/* Belongs with "sign-in and enrolment"; kept here because it must come after .ds-cancel > summary. */
.reg-enrol-fold > summary { list-style: none; cursor: pointer; padding: 12px 14px; min-height: 44px; display: flex; align-items: center; font-size: 14px; font-weight: 500; color: var(--teal-600); }
/* Belongs with "DS calendar — toolbar"; kept here because it must come after .reg-enrol-fold > summary. */
.ds-bar-more > summary, .ds-bar-unreachable > summary { cursor: pointer; margin: var(--sp-1) 0; font-size: var(--fs-sm); }
/* Belongs with "DS calendar — toolbar"; kept here because it must come after .reg-enrol-fold > summary. */
.ds-bar-more > summary { color: var(--urgent-strong); }
/* Belongs with "DS calendar — toolbar"; kept here because it must come after .ds-bar-more > summary. */
.ds-bar-unreachable > summary { color: var(--ink-3); font-weight: 600; }
.ds-cancel > summary:hover { color: #991b1b; }
.ds-cancel-form { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ds-dialog h3 .ds-contact-state { text-transform: none; letter-spacing: 0; vertical-align: 1px; }
.ds-dialog .ds-contact-when:not(:empty),
.ds-assign-dialog .ds-dialog-name + .ds-muted { margin: 0 0 16px; padding: 0 14px 10px; border-left: 3px solid var(--teal-600); border-radius: 0 0 8px 0;
    background: var(--surface-2); font-size: 14px; color: var(--ink-2); }
.ds-contact-state { display: inline-block; margin-left: 8px; padding: 1px 8px; border: 1px solid var(--unreachable-line); border-radius: 999px;
    background: var(--unreachable); color: var(--ink); font-size: 13px; font-weight: 600; vertical-align: 2px; }
.ds-contact-state[hidden] { display: none; }
.ds-contact-dialog { width: min(440px, calc(100vw - 32px)); }
.ds-contact-when { margin: 0 0 2px; color: var(--ink-3); }
.ds-contact-phone { display: block; margin: 6px 0 14px; font-size: 22px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink); text-decoration: none; }
.ds-contact-phone:hover { color: var(--teal-600); text-decoration: underline; }
.ds-contact-phone[hidden] { display: none; }
.ds-contact-tried { margin: 0 0 14px; padding: 8px 12px; background: var(--urgent-bg); border-radius: 8px; font-size: 13px; }
.ds-contact-tried-h { margin: 0 0 4px; font-weight: 600; color: var(--urgent-strong); }
.ds-contact-tried ul { margin: 0; padding-left: 18px; }
.ds-contact-count { margin: 6px 0 0; color: var(--urgent-ink); }
.ds-contact-actions { display: grid; gap: 8px; }
.ds-contact-actions .ds-contact-ok { background: var(--told); border: 1.5px solid var(--told-line); color: var(--told-ink); }
.ds-contact-actions .ds-contact-ok:hover { background: var(--told-hover); }
.ds-contact-actions .ds-contact-fail { background: #fff; border: 1.5px solid var(--urgent); color: var(--urgent-strong); }
.ds-contact-actions .ds-contact-fail:hover { background: var(--urgent-bg); }
.ds-contact-actions .ds-contact-sms { background: #f4f6f6; border: 1.5px dashed #d5dcdd; color: #9aa6a8; cursor: not-allowed; }
.ds-contact-sms span { font-size: 13px; }
.ds-row-meta .ds-sep { color: var(--line); }
.pc-head h3 { margin: 0 0 2px; }
.pc-lead { margin: 0 0 12px; font-size: 13px; color: var(--ink-3); }
.pc-block { border: 1px solid #e7d3a8; border-radius: 10px; background: #fff; padding: 10px 12px; margin: 0 0 10px; }
.pc-block-todo { border-color: #d97706; }
.pc-q { margin: 0 0 6px; font-weight: 700; font-size: 14px; }
.pc-todo { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 100px; background: #d97706; color: #fff;
    font-size: 11px; font-weight: 700; letter-spacing: 0.03em; vertical-align: 1px; }
.pc-fact { margin: 0 0 8px; font-size: 13px; color: #92400e; }
.pc-opt { display: block; cursor: pointer; margin-top: 6px; }
.pc-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.pc-opt-face { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 6px 12px; border: 1px solid var(--line);
    border-radius: 8px; background: #fff; font-size: 14px; line-height: 1.3; }
.pc-opt-face::before { content: ""; flex: 0 0 18px; width: 18px; height: 18px; border: 2px solid var(--line); border-radius: 5px; }
.pc-opt input[type="radio"] + .pc-opt-face::before { border-radius: 50%; }
.pc-opt:hover .pc-opt-face { border-color: var(--teal-600); }
.pc-opt input:focus-visible + .pc-opt-face { outline: 2px solid var(--teal-600); outline-offset: 2px; }
.pc-opt input:checked + .pc-opt-face { border-color: #1b7f3b; background: #f1f9f3; color: #14532d; font-weight: 600; }
.pc-opt input:checked + .pc-opt-face::before { border-color: #1b7f3b; background: #1b7f3b;
    box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 10px #1b7f3b; }
.pc-notes { border-top: 1px dashed #e7d3a8; padding-top: 8px; margin-bottom: 8px; color: #92400e; font-size: 13px; }
.pc-notes p { margin: 0 0 4px; }
.pc-back { margin: 0; font-size: 13px; }
.ds-contact-line { display: inline-block; margin-left: 8px; font-size: 13px; vertical-align: 1px; }
.ds-contact-told { color: var(--told-text); font-weight: 600; }
.ds-contact-tried { color: var(--urgent-strong); font-weight: 600; }
/* The date panel: the date in the system's display size. */
.ds-datebox { gap: var(--sp-1); padding: var(--sp-4); margin-bottom: var(--sp-4); }
.ds-datebox-date { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
/* A visit that is over or cancelled: the same panel, grey, one line. */
.ds-dateline { margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm); background: var(--surface-2);
    color: var(--ink-2); font-size: var(--fs-base); text-align: center; font-variant-numeric: tabular-nums; }
/* The facts: label and value side by side on a computer, not 900px apart. */
@media (min-width: 600px) {
    .ds-page .ds-facts > div { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: var(--sp-3); }
    .ds-page .ds-facts dd { text-align: left; }
    .ds-page .ds-facts .ds-contact-line, .ds-page .ds-facts .ds-contact-state { margin-left: 8px; }
}
@media (min-width: 600px) and (max-width: 899px) {
    .ds-page .ds-facts .ds-contact-line, .ds-page .ds-facts .ds-contact-state { margin-left: 0; }
}
.ds-page .ds-facts dt { color: var(--ink-3); }
/* History: one entry per band; the time in a column on a computer; on a phone the time and
   what happened, then the detail, then who, always at the same breaks. */
.ds-history { gap: 0; }
.ds-history li { column-gap: var(--sp-2); row-gap: 2px; padding: var(--sp-2) 0; border-top: 1px solid var(--line-soft); }
.ds-history li:first-child { border-top: none; padding-top: 0; }
/* ===== The „Pranešti" dialog's second number and who answers it (design, kulkardio_1, 2026-09-29) =====
   Under the first number, one size down, as easy to tap; the relation beside it, quiet. */
.ds-contact-phone ~ .ds-contact-phone2 { margin: -10px 0 14px; }
.ds-contact-phone2[hidden] { display: none; }
.ds-contact-phone2-num { display: inline-flex; align-items: center; min-height: 44px; font-size: var(--fs-md); font-weight: 600;
    letter-spacing: 0.02em; color: var(--ink); text-decoration: none; }
.ds-contact-phone2-num:hover { color: var(--teal-700); text-decoration: underline; }
.ds-contact-phone2 .ds-contact-rel { font-size: var(--fs-sm); }

/* ===== The card's „Pranešti" graded as the week's (review-ds C23, kulkardio_2, 2026-10-01) ===== */
/* An orange outline from 2 to 10 days, solid red today and tomorrow. */
.ds-card-contact .dsw-contact-btn.dsw-due:not(.dsw-urgent) { background: var(--surface); border-color: var(--soon); color: var(--soon); font-weight: 600; }
.ds-card-contact .dsw-contact-btn.dsw-due:not(.dsw-urgent):hover { background: var(--soon-bg); }
.ds-card-contact .dsw-contact-btn.dsw-due.dsw-urgent { background: var(--urgent); border-color: var(--urgent-strong); color: #fff; }
.ds-card-contact .dsw-contact-btn.dsw-due.dsw-urgent:hover { background: var(--urgent-strong); }
.ds-card-contact .dsw-contact-btn { position: relative; }
/* ===== The sending physician on the desk's referral form (sender-physician, kulkardio_2, 2026-10-03) ===== */
.ds-sender { border: 1px solid var(--line-soft); border-radius: var(--radius-sm); padding: var(--sp-2) var(--sp-3) var(--sp-3); min-width: 0; }
.ds-sender legend { padding: 0 var(--sp-1); font-weight: 600; }
.ds-sender-row { display: flex; gap: var(--sp-2); }
.ds-sender-row .reg-input { flex: 1 1 auto; min-width: 0; }
.ds-sender-note:empty { display: none; }
.ds-sender-found { margin: var(--sp-2) 0; padding: var(--sp-2) var(--sp-3); background: var(--surface-2); border-left: 3px solid var(--teal-600); border-radius: var(--radius-xs); }
.ds-sender-found p { margin: 0 0 var(--sp-1); }
.ds-sender .reg-checkbox { display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; }
.ds-sender-none { margin-top: var(--sp-2); }
/* ===== A larger rename asked about on /patient.php (physician-corrects-own, kulkardio_2, 2026-10-03) ===== */
.pc-rename { border-left: 4px solid var(--soon); }
.pc-rename p { margin: 0 0 var(--sp-1); }
.pc-rename .reg-checkbox { display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; font-weight: 600; }
/* ============================================================================
   Pages: Stacionaras (ward plan)
   ============================================================================ */
/* ===== Stacionaras (ward admission plan) ===== */
.stac-page { padding-bottom: 96px; }
.stac-weekdays { display: none; }
.stac-month { display: grid; grid-template-columns: 1fr; gap: 8px; }
.stac-pad { display: none; }
.stac-day { background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.stac-weekend { box-shadow: none; padding: 6px 12px; }
.stac-weekend .stac-day-head { opacity: 0.6; }
.stac-past { opacity: 0.6; }
.stac-closed:not(.stac-weekend) { border: 1px dashed var(--line); box-shadow: none; }
.stac-full .stac-fill-bar { background: var(--color-accent); }
.stac-day-head { display: flex; align-items: center; gap: 8px; }
.stac-day-num { font-weight: 700; min-width: 24px; }
.stac-day-wd { font-size: 12px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.04em; min-width: 28px; }
.stac-fill { flex: 1; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.stac-fill-bar { display: block; height: 100%; background: var(--teal-600); }
.stac-count { font-size: 13px; white-space: nowrap; }
.stac-row-off { opacity: 0.55; }
.stac-daylink { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--ink-3); text-decoration: none; }
.stac-fab { position: fixed; right: 16px; bottom: 16px; z-index: 50; box-shadow: var(--shadow-md); border-radius: 100px; }
.stac-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.stac-inline-form { margin: 0; }
.stac-table td, .stac-table th { white-space: nowrap; }
.stac-table .stac-note-row td { white-space: normal; font-size: 12px; border-top: none; padding-top: 0; }
.stac-table .stac-group-row th { text-align: left; background: var(--surface-2); font-size: 13px; padding-top: 10px; }
.stac-print-title { display: block; }
@media (min-width: 900px) {
    .stac-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; font-size: 12px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; padding: 0 4px 4px; }
    .stac-month { grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: start; }
    .stac-pad { display: block; background: transparent; box-shadow: none; }
    .stac-day { min-height: 96px; }
    .stac-day-wd { display: none; }
    .stac-weekend { padding: 10px 12px; }
    .stac-fab { right: 32px; bottom: 32px; }
}
.dsm-bar-row .stac-count { font-size: 12px; }
/* ===== DS registry: use the full desktop width, compress weekend columns ===== */
/* ===== DS registry: VAA blue, EIT amber, everywhere ===== */
.dsm-bar-vaa .stac-fill-bar { background: var(--vaa-ink); }
.dsm-bar-eit .stac-fill-bar { background: #b45309; }
.dsm-bar-row.stac-full .stac-fill-bar { background: var(--color-accent); }
.dsm-daylink:hover .stac-day-num { color: var(--teal-600); }
/* ===== Full width on desktops for the registry, the planner, the ward plan and the header ===== */
@media (min-width: 900px) {
    .reg-header .reg-container, .ds-registry, .stac-page { max-width: none; padding-left: 24px; padding-right: 24px; }
}
/* month grid and planner share the softer card */
.stac-day, .ds-card, .reg-card { border: 1px solid var(--line-soft); box-shadow: none; }
/* ===== Month cells refined (DS registry and ward plan) ===== */
.stac-day { border-radius: 10px; padding: 8px 10px; gap: 5px; }
.stac-today { outline: none; border-color: var(--teal-600); background: #f3fafa; box-shadow: 0 0 0 3px rgba(14,124,134,0.10); }
.stac-day-num { font-size: 18px; letter-spacing: -0.02em; }
.stac-fill { height: 7px; border-color: #dfe7e8; }
.stac-weekend { background: #f6f9f9; border-color: transparent; }
.stac-closed:not(.stac-weekend) { border-style: dashed; border-color: #e3ebec; }
.stac-page .dsw-typeline .dsw-add { margin-left: auto; }
.dsm-bar-stac_b .stac-fill-bar { background: var(--teal-600); }
.dsm-bar-stac_ep .stac-fill-bar { background: #5b5fc7; }
/* ===== Ward rows carry a fourth line (purpose · physician) ===== */
.stac-page .dsw-slot { height: 82px; }
.stac-page .dsw-purpose { color: var(--ink-3); font-family: var(--font-family); font-size: 11px; }
.cap-day .stac-fill { flex: 1; min-width: 24px; }
@media (min-width: 900px) {
    /* The ward plan's card, the same way: four lines of details (code, phone, purpose,
       physician) instead of three. */
    .stac-page .dsw-section > .dsw-slot { height: 110px; }
}
/* ===== DS pages polish, part 1: bugs, contrast, touch targets (design, kulkardio_1, 2026-09-29) =====
   From the DS re-audit on staging. Scoped to the day hospital unless the component is shared
   (.stac-day, .dsw-past also draw the ward, which gains the same fixes). */
/* The calendar's lead-in cells: „.stac-pad { display:none }" lost to the later „.stac-day { display:flex }",
   so a phone month began with empty bars; on a computer they are blank spaces, not empty tiles. */
.stac-day.stac-pad { display: none; }
@media (min-width: 900px) { .stac-day.stac-pad { display: block; border-color: transparent; background: transparent; } }
.stac-past .stac-count { color: var(--ink-2); }
/* The actions: „Atšaukti" apart at the end on a computer; two equal columns of 44px on a phone. */
/* The DS card's actions carry names of their own (review B22): a ward restyle of .stac-actions does not move them. */
.ds-actions-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.ds-inline-form { margin: 0; }
.ds-registry:not(.stac-page) .dsm-daylink:hover .stac-day-num { text-decoration: underline; text-underline-offset: 3px; }

/* ============================================================================
   Pages: administration
   ============================================================================ */
/* Administravimas → Žmonės: search field with its button, filter selects in one row, result count. */
.people-search { display: flex; gap: 8px; align-items: center; }
.people-count { margin: 4px 0 0; }
/* Administravimas: the page links above the people list. */
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
/* The page you are on is a label, not a link back to itself. */
.admin-nav-on { background: var(--teal-600); border-color: var(--teal-600); color: #fff; cursor: default; }
/* How many people are waiting to be let back in, visible from every admin page. */
.admin-nav-badge { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 100px;
    background: #b91c1c; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.admin-nav-on .admin-nav-badge { background: #fff; color: var(--teal-800); }
/* ===== Prašymai padėti prisijungti (admin/help.php) =====
   One block per request rather than a table: a row carries a date, what was
   typed, a note, the account it names and that account's own contact details,
   and five columns of that do not fit a telephone. */
.help-row { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
    padding: 10px 0; border-top: 1px solid var(--line-soft); }
.help-row:first-of-type { border-top: 0; }
.help-row-main { flex: 1 1 260px; min-width: 0; }
.help-row-side { flex: 0 0 auto; }
.help-row-done { opacity: 0.7; }
.help-when { margin: 0 0 2px; font-size: 12px; color: var(--ink-3); }
.help-typed { margin: 0 0 4px; word-break: break-word; }
.help-note { margin: 0 0 4px; font-size: 13px; }
.help-account { margin: 0 0 2px; }
.help-contact { margin: 0; font-size: 13px; }
.help-nocontact, .help-nomatch { margin: 0; }
.help-done summary { cursor: pointer; font-weight: 600; }
.help-state { margin: 2px 0 4px; font-size: 13px; color: var(--ink-3); }
.help-unlock { margin: 0 0 6px; }
.help-more { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.help-more:empty { display: none; }
.help-bulk { margin: 12px 0 0; }
.reg-dashboard:has(.perm-wrap) { max-width: 1240px; } /* the matrix fits on a computer */
.perm-wrap, .reg-table-wrap { scrollbar-width: thin; scrollbar-color: var(--line-strong) var(--surface-2); } /* a table wider than the screen says so */
/* The hidden labels in the cells (.reg-sr-only, absolute) are placed inside the scroll box, not the
   page: they stretched the whole page to 1078px on a phone and to 1326px on a computer. */
.perm-wrap, .reg-table-wrap { position: relative; }
.perm-wrap { overflow: auto; max-height: 72vh; margin: 8px 0 16px; border: 1px solid var(--line-soft); border-radius: var(--radius-sm); }
.perm-table { border-collapse: separate; border-spacing: 0; font-size: 13px; background: var(--surface); }
.perm-table th, .perm-table td { border-bottom: 1px solid var(--line-soft); padding: 7px 8px; text-align: left; }
.perm-table thead th { background: var(--surface-2); position: sticky; z-index: 2; font-weight: 600; color: var(--ink-3); }
.perm-table thead tr:first-child th { top: 0; height: 30px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--teal-800); }
.perm-table thead tr:last-child th { top: 30px; }
.perm-unit { text-align: center; border-left: 1px solid var(--line); }
.perm-col { width: 92px; min-width: 92px; white-space: normal; vertical-align: bottom; font-size: 11px; line-height: 1.25; }
.perm-corner, .perm-role { position: sticky; left: 0; z-index: 3; background: var(--surface); min-width: 176px; white-space: nowrap; font-weight: 500; color: var(--ink); }
.perm-corner { z-index: 4; background: var(--surface-2); }
.perm-cell { text-align: center; }
.perm-box { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 40px; cursor: pointer; margin: 0; }
.perm-box input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--teal-600); cursor: pointer; }
.perm-fixed td, .perm-fixed .perm-role { background: var(--surface-2); }
.perm-fixed .perm-box, .perm-fixed .perm-box input { cursor: default; }
.perm-table tbody tr:hover td, .perm-table tbody tr:hover .perm-role { background: var(--color-primary-light); }
/* Deleting an account is rare and irreversible, so the button is quiet until you
   reach for it, and never the first thing the eye lands on. */
.admin-delete-btn { color: #b91c1c; border-color: #e3bcbc; }
.admin-delete-btn:hover { border-color: #b91c1c; background: #fdf1f1; }
.admin-delete-note { flex-basis: 100%; margin: 4px 0 0; }
/* ===== Roles on the person card, grouped =====
   Eight roles in one flat list read as a wall; grouped by what the person does, they
   read as five short questions (clinic head, 2026-09-23). */
.role-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px 18px; margin-bottom: 12px; }
.role-group { border: 1px solid var(--line-soft); border-radius: 8px; padding: 8px 12px 10px; margin: 0; min-width: 0; }
.role-group legend { padding: 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); }
/* ===== Person card: the name heads their details, the actions line up =====
   The name used to sit above the page navigation, three cards away from the data it
   belongs to, and the actions were inline forms of assorted widths that stepped down
   the page (clinic head, 2026-09-23). */
.person-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.person-head h1 { margin: 0; font-size: 22px; }
.admin-back { margin: 0 0 12px; }
.admin-locked { color: var(--urgent-strong); }
.admin-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; align-items: stretch; }
.admin-actions form { display: flex; margin: 0; }
.admin-actions .admin-delete-note { grid-column: 1 / -1; margin: 2px 0 0; }
/* The action log, a day at a time. */
.audit-day + .audit-day { margin-top: 18px; }
.audit-day h3 { margin: 0 0 6px; font-size: 14px; }
.audit-more { margin: 16px 0 0; text-align: center; }
/* On the person card one column only repeats the person: every row of „Veiksmai,
   kuriuos atliko ši paskyra" was done by them, every row of „Veiksmai su šia
   paskyra" was done to them. */
.audit-same-actor th:nth-child(2), .audit-same-actor td:nth-child(2),
.audit-same-target th:nth-child(5), .audit-same-target td:nth-child(5) { display: none; }
/* The date and the action are short: kept on one line they no longer break in two
   beside a long name. */
.audit-table td:nth-child(1), .audit-table td:nth-child(4) { white-space: nowrap; }
.audit-table a { color: var(--teal-600); }

/* ===== Merging two patient records (patient-merge, kulkardio_2, 2026-10-01): /admin/merge.php, two records side by side, every choice explicit ===== */
.mg-pair { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); align-items: start; margin-top: var(--sp-4); }
.mg-col { margin: 0; min-width: 0; }
.mg-col .pt-section-h { margin-top: var(--sp-4); }
.mg-col .pt-row { grid-template-columns: 1fr auto; padding: var(--sp-3); }
.mg-col .pt-row-date { grid-column: 1; }
.mg-col .pt-row-by { grid-column: 2; grid-row: 1; }
.mg-col .pt-row-what, .mg-col .pt-row-state { grid-column: 1 / -1; }
.mg-form { margin-top: var(--sp-4); }
.mg-choice { border: 1px solid var(--line-soft); border-radius: var(--radius-sm); margin: 0 0 var(--sp-3); padding: var(--sp-2) var(--sp-3); min-width: 0; }
.mg-choice legend { padding: 0 var(--sp-1); font-weight: 600; color: var(--ink); }
.mg-option { display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; overflow-wrap: anywhere; }
.mg-confirm { display: flex; align-items: center; gap: var(--sp-2); min-height: 44px; margin: var(--sp-2) 0 var(--sp-3); font-weight: 600; }
.mg-find { display: flex; gap: var(--sp-2); margin: var(--sp-3) 0; }
.mg-find .reg-input { flex: 1 1 auto; min-width: 0; }
.mg-hit .reg-btn { margin-left: auto; }
/* ============================================================================
   Pages: account, help, info sheet text
   ============================================================================ */
/* ===== Informacinio lapelio tekstas (info-edit.php) =====
   One box per block of the sheet, each with the room it has left underneath.
   The counter is a plain .reg-help line until the text goes over its budget,
   when it turns red — the same moment the server would refuse the save. */
.info-tabs { margin-bottom: 16px; flex-wrap: wrap; }
.info-block { margin-bottom: 18px; }
.info-text { font-family: var(--font-family); font-size: 14px; line-height: 1.5; resize: vertical; }
.info-count { margin-top: 4px; text-align: right; font-variant-numeric: tabular-nums; }
.info-count-over { color: var(--color-accent); font-weight: 600; }

/* ============================================================================
   Print
   ============================================================================ */
@media print {
    .reg-header, .stac-noprint, .ds-back { display: none !important; }
    .reg-card { padding: 0; }
}
/* Belongs with "referral card"; kept here because it must come after .reg-card in print. */
/* ===== The patient check before a registration =====
   One block per question, each with its question line, its facts and its options as
   full-width rows that turn green when chosen. Compulsory ones that are still open
   say so (clinic head, 2026-09-23). */
.pc-panel { padding-top: 14px; }
@media print {
    .reg-badge { border: 1px solid #999; }
    .stac-table a { color: inherit; text-decoration: none; }
}
/* Belongs with "sign-in and enrolment"; kept here because it must come after .stac-table a in print. */
.reg-enrol-steps a { color: var(--teal-600); }
@page dsweek { size: A4 landscape; margin: 6mm; }
@media print {
    .ds-registry:not(.stac-page):has(.dsw-grid) { page: dsweek; }
    html, body, .reg-main { background: #fff !important; min-height: 0 !important; }
    .ds-registry:not(.stac-page) { padding: 0 !important; margin: 0 !important; max-width: none !important; overflow: visible !important; }
    .ds-registry:not(.stac-page) :is(.ds-toolbar, .ds-alerts, .dsw-awaiting, .dsw-results, .ds-month-nav, .reg-alert, .dsw-off-list, .dsw-add,
        .dsw-allform, .dsw-allspace, .dsw-actions, .dsw-marks, .dsw-checkbox-gap, .ds-dialog) { display: none !important; }
    .ds-registry:not(.stac-page) .dsw-print-title { display: block; margin: 0 0 1.5mm; font-size: 10pt; font-weight: 600; color: #000; }
    /* 198mm of page less the title, the day's head and its borders, shared out; the
       three lines of a card take their size from the share (7.5pt at sixteen rows). */
    .ds-registry:not(.stac-page) .dsw-grid { display: grid !important; grid-template-columns: repeat(7, minmax(0, 1fr)) !important; gap: 1mm !important;
        --dsw-slot-h: calc((198mm - 20.5mm - 0.8mm) / var(--dsw-rows, 16) - 0.5mm);
        --dsw-font: min(7.5pt, calc((var(--dsw-slot-h) - 0.8mm) / 3.5)); }
    .ds-registry:not(.stac-page) .dsw-day { padding: 0.8mm !important; gap: 0.6mm !important; border: 0.2mm solid #888 !important; border-radius: 1mm;
        box-shadow: none !important; background: #fff !important; min-height: 0 !important; opacity: 1 !important; outline: none !important; }
    .ds-registry:not(.stac-page) .dsw-today-col .dsw-date { margin: 0; padding: 0; background: none; border: 0; color: #000; }
    /* The date on one line, the counts under it: beside „Pirmadienis" the second count fell off. */
    .ds-registry:not(.stac-page) .dsw-head { flex-direction: row !important; flex-wrap: wrap; align-items: baseline; gap: 0 1.5mm !important;
        margin: 0 !important; height: 7.5mm; overflow: hidden; line-height: 1.2; }
    .ds-registry:not(.stac-page) .dsw-head .dsw-date { flex-basis: 100%; font-size: 8.5pt !important; color: #000; }
    .ds-registry:not(.stac-page) .dsw-head .dsw-date strong { font-size: 9pt !important; }
    .ds-registry:not(.stac-page) .dsw-typeline { display: block !important; min-height: 0 !important; height: auto !important; font-size: 6.5pt; line-height: 1.2 !important; }
    .ds-registry:not(.stac-page) .dsw-count { display: inline !important; font-size: 6.5pt !important; line-height: 1.2 !important; min-height: 0 !important;
        padding: 0 !important; background: none !important; border: 0 !important; color: #000 !important; }
    .ds-registry:not(.stac-page) .dsw-section { gap: 0.5mm !important; padding-left: 0.8mm !important; border-left-width: 0.6mm !important; }
    .ds-registry:not(.stac-page) .dsw-section + .dsw-section { margin-top: 1mm !important; }
    /* The 8 + 4 + 4 air on paper too; its 0.8 mm comes out of the 198 mm shared above. */
    .ds-registry:not(.stac-page) .dsw-section-vaa > .dsw-slot:nth-child(8 of .dsw-slot) { margin-bottom: 0.8mm !important; }
    .ds-registry:not(.stac-page) .dsw-section > .dsw-slot { height: var(--dsw-slot-h) !important; min-height: 0 !important; }
    .ds-registry:not(.stac-page) .dsw-card.dsw-slot { display: block !important; position: relative; padding: 0.3mm 0.8mm !important;
        border: 0.2mm solid #999 !important; border-radius: 0.8mm; background: #fff !important; box-shadow: none !important; overflow: hidden; }
    .ds-registry:not(.stac-page) .dsw-card .dsw-name { display: block; font-size: calc(var(--dsw-font) * 1.07) !important; line-height: 1.15 !important; color: #000 !important;
        text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .ds-registry:not(.stac-page) .dsw-card .dsw-text { display: block !important; line-height: 1.15 !important; }
    /* The first line under the name is the personal code alone: not on paper. */
    .ds-registry:not(.stac-page) .dsw-card .dsw-text > .dsw-sub:not(.dsw-phone):not(.dsw-phys) { display: none !important; }
    .ds-registry:not(.stac-page) .dsw-card .dsw-sub { display: block !important; font-size: var(--dsw-font) !important; line-height: 1.15 !important; color: #000 !important;
        white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .ds-registry:not(.stac-page) .dsw-card .dsw-sub.dsw-phys { font-size: calc(var(--dsw-font) * 0.93) !important; color: #333 !important; font-family: var(--font-family) !important; }
    /* A day that has passed keeps its ✓ or ✕, small, in the corner. */
    .ds-registry:not(.stac-page) .dsw-card > .dsw-form { position: absolute; top: 0.3mm; right: 0.5mm; }
    .ds-registry:not(.stac-page) .dsw-card > .dsw-form .dsw-checkbox { width: 3mm !important; height: 3mm !important; font-size: 6pt !important;
        border: 0.2mm solid #555 !important; border-radius: 0.5mm; background: #fff !important; color: #000 !important; }
    .ds-registry:not(.stac-page) .dsw-card:has(> .dsw-form) .dsw-name { padding-right: 3.5mm; }
    .ds-registry:not(.stac-page) a.dsw-slot-empty { color: transparent !important; border: 0.2mm dashed #bbb !important; background: none !important; }
    .ds-registry:not(.stac-page) .dsw-slot-closed { visibility: hidden; }
    /* „Nepasiekiamas" is the desk's state, not the sheet's: on paper the sender's line, as on every other card. */
    .ds-registry:not(.stac-page) .dsw-card .dsw-print-only { display: inline !important; }
}
@media print { .ds-double, .ds-double-lines { display: none !important; } }
@media print { .dsl-list { display: none !important; } }
/* On paper a card holds three lines: for a flagged patient the flags, bold, take the
   sender's line (the sender stays on screen). */
@media print {
    .ds-registry:not(.stac-page) .dsw-card.dsw-has-flags .dsw-text > .dsw-sub.dsw-flags-print { display: block !important; }
    .ds-registry:not(.stac-page) .dsw-card.dsw-has-flags .dsw-text > .dsw-sub.dsw-phys { display: none !important; }
}
/* A flag must never be cut on paper (design, kulkardio_1, 2026-09-29: „ALERGIJA JODUI, Hemodiali…"
   hid the second). The flags wrap onto as many lines as they need, a touch smaller than the card's
   lines, and a flagged card grows past its slot instead of clipping; the slot's height stays its
   floor. Five flags are three lines in a day's column. */
@media print {
    .ds-registry:not(.stac-page) .dsw-card.dsw-has-flags .dsw-text > .dsw-sub.dsw-flags-print {
        white-space: normal !important; overflow: visible !important; text-overflow: clip !important;
        font-size: calc(var(--dsw-font) * 0.9) !important; line-height: 1.1 !important; overflow-wrap: anywhere;
        font-family: var(--font-family) !important; }
    .ds-registry:not(.stac-page) .dsw-section > .dsw-slot.dsw-has-flags { height: auto !important; min-height: var(--dsw-slot-h) !important; }
    .ds-registry:not(.stac-page) .dsw-card.dsw-slot.dsw-has-flags { overflow: visible !important; }
    /* The page stays one sheet: a week with a flagged card sets aside 12 mm (about five flag lines)
       before sharing the height out, so its tallest day can grow. Every slot gives up under 1 mm. */
    .ds-registry:not(.stac-page) .dsw-grid:has(.dsw-has-flags) {
        --dsw-slot-h: calc((198mm - 20.5mm - 0.8mm - 12mm) / var(--dsw-rows, 16) - 0.5mm) !important; }
}

/* The calendar pair and the week navigator stay off paper. */
@media print { .ds-calpair { display: none !important; } }
@media print { .wn, .wn-pop { display: none !important; } .wn-wrap { display: block !important; } }
/* ============================================================================
   Phone and narrow screens (max-width): LAST, so they win over everything above
   ============================================================================ */
@media (max-width: 899px) { .reg-role { display: none; } }
@media (max-width: 599px) { .reg-btn, .reg-btn-sm { min-height: 44px; } }
@media (max-width: 899px) {
    .reg-form-row, .reg-form-row-3 { grid-template-columns: 1fr; }
    .reg-dash-grid { grid-template-columns: 1fr; }
    .reg-form-actions { flex-direction: column; }
    .reg-form-actions .reg-btn { width: 100%; }
    .reg-user { font-size: 12px; }
    .reg-login-logo h1 { font-size: 24px; }
    .reg-login-wrap { padding: 16px; }
    .reg-checkbox-row { flex-direction: column; align-items: flex-start; gap: 4px; }
    .reg-table { font-size: 12px; }
    .reg-table th, .reg-table td { padding: 8px 6px; } /* prevents iOS zoom on focus */
    select.reg-input { font-size: 16px; }
    textarea.reg-textarea { font-size: 16px; }
    .reg-entry-main { flex-direction: column; gap: 12px; }
    .reg-line { font-size: 12px; }
}
@media (max-width: 599px) {
    .reg-header-inner { height: auto; min-height: 56px; flex-wrap: wrap; padding-block: 8px; }
    .reg-user { display: none; }
    .reg-nav { gap: 6px; flex-wrap: wrap; }
    .reg-dash-grid, .reg-form-row, .reg-form-row-3 { grid-template-columns: 1fr; }
    .reg-form-row-3 { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
    .reg-dashboard { padding-block: 8px 24px; }
    .ds-indent { max-width: 100%; }
    .ds-entry .reg-entry-main { flex-direction: column; gap: 10px; }
    .ds-entry-actions { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
    .ds-month-nav .reg-btn { padding: 6px 10px; font-size: 12px; } .reg-dash-unit { min-height: 120px; padding: 22px 18px; } .reg-dash-unit h2 { font-size: 22px; }
    .reg-header-inner { justify-content: space-between; }
    .reg-unit { flex: 1; justify-content: center; }
}
@media (max-width: 1100px) { .reg-user { display: none; } }
/* Home page: the unit cards are the unit choice; below 900px the pills would sit on their own row above the same names. */
@media (max-width: 899px) { .reg-header-home .reg-units { display: none; } }
@media (max-width: 899px) {
    .dsw-grid { grid-template-columns: 1fr; }
    .dsw-weekend:empty { display: none; }
    .ds-views { width: 100%; }
    .ds-views .reg-unit { flex: 1; justify-content: center; }
}
@media (max-width: 899px) { .dsm-open { display: none; } }
@media (max-width: 899px) { .ds-views a[href*="view=month"] { display: none; } }
@media (max-width: 899px) { .dsw-card { padding: 6px 8px; } .dsw-name { font-size: 14px; } .dsw-form .reg-btn { height: 28px; min-height: 28px; }
}
@media (max-width: 599px) {
    .dsw-hit { flex-wrap: wrap; column-gap: 8px; row-gap: 3px; padding-top: 8px; padding-bottom: 8px; }
    .dsw-hit::after { content: ''; order: 1; flex-basis: 100%; height: 0; }
    /* The name may take two lines: beside the 44px buttons that costs no height, and a
       double surname cut to „DANOAITĖ-…" at 360px no longer says who it is. */
    .dsw-hit > .dsw-hit-link { flex: 1 1 0; min-width: 0; overflow: hidden; font-size: var(--fs-base); color: var(--ink);
        display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
    .dsw-hit > .dsw-hit-actions, .dsw-hit > .reg-btn { margin-left: auto; flex: none; }
    .dsw-hit > .dsw-hit-actions .reg-btn { min-width: 72px; min-height: 44px; height: 44px; padding: 0 10px; }
    .dsw-hit > .dsw-phone { order: 2; color: var(--ink); font-weight: 500; }
    /* Basis 0: the sender never pushes the date to a third line, it shortens instead. */
    .dsw-hit > .ds-muted { order: 3; flex: 1 1 0; min-width: 3em; overflow: hidden; text-overflow: ellipsis; }
    .dsw-hit > .dsw-hit-date { order: 4; margin-left: 0; color: var(--ink-2); font-weight: 600; }
    .dsw-hit > .reg-badge:not(:first-child) { order: 5; }
    .dsw-hit > .ds-mono { order: 6; }
    /* The live list and the bar carry only what to act on: no status or code line. */
    .dsl-list .dsw-hit > .ds-mono, .dsl-list .dsw-hit > .reg-badge:not(:first-child),
    .ds-bar-row.dsw-hit > .ds-mono, .ds-bar-row.dsw-hit > .reg-badge:not(:first-child) { display: none; }
}
@media (max-width: 380px) { .dsw-hit > .ds-mono { display: none; } }
@media (max-width: 899px) { .dsw-search { flex-wrap: wrap; } .dsw-actions { flex-direction: row; gap: 8px; } .dsw-actions .dsw-link { font-size: 13px; min-height: 28px; line-height: 28px; }
}
@media (max-width: 899px) { .dsw-slot { height: 68px; } }
@media (max-width: 899px) { .stac-page .dsw-slot { height: 90px; } }
@media (max-width: 899px) { .dsw-typeline .cap-num { width: 64px; min-height: 32px; font-size: 14px; } }
@media (max-width: 899px) { .ds-views-row { width: 100%; } .ds-views-row .ds-views { flex: 1; }
}
/* ===== Phone week views: only booked cards =====
   Days stack below 900px, so the empty/closed slot boxes would make a week thousands of pixels
   tall. The day head already carries the counts and the "+ Įtraukti"/"+ Pridėti" links, so only
   booked cards are drawn; a section with no card collapses entirely. Kept last: .dsw-slot-empty
   gets display:flex earlier in this file. */
@media (max-width: 899px) {
    .dsw-slot-empty, .dsw-slot-closed { display: none; }
    .dsw-section:not(:has(.dsw-card)) { display: none; }
}
/* Phone: every login-card button is full width and comfortably tappable. */
@media (max-width: 899px) {
    .reg-login-card .reg-btn { width: 100%; min-height: 44px; }
}
@media (max-width: 599px) { .reg-enrol-kind { flex-direction: column; } }
@media (max-width: 899px) { .ds-registry .dsw-card .dsw-actions .dsw-called-btn.dsw-called-on { padding: 0 8px; } }
@media (max-width: 899px) { .ds-registry .dsw-card .dsw-actions .dsw-contact-btn:is(.dsw-due, .dsw-unreachable) { padding: 0 8px; } }
/* ===== The DS calendar on a phone: one row for the search, one line per nav button, real buttons =====
   From control's live check at 390px (2026-09-28): the search box stopped short of
   the edge with „Ieškoti" wrapped under it, „‹ Ankstesnė" broke over two lines, and
   „Perkelti" was bare text beside a filled „Pranešta ✓" or red „Pranešti". */
@media (max-width: 899px) {
    .ds-toolbar-left.dsw-search { flex-wrap: nowrap; width: 100%; }
    .ds-toolbar-left.dsw-search .reg-input { flex: 1 1 auto; min-width: 0; max-width: none; }
    .ds-toolbar-left.dsw-search .reg-btn { flex: 0 0 auto; }
    .ds-month-nav { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; }
    .ds-month-nav .reg-btn { white-space: nowrap; }
    .ds-month-nav strong { font-size: 15px; line-height: 1.3; }
    .ds-registry .dsw-card .dsw-actions { gap: 6px; }
}
@media (max-width: 599px) { .ds-alerts .ds-alerts-note { font-size: 12px; } }
@media (max-width: 599px) { .people-filter .reg-form-row-3 { grid-template-columns: 1fr; gap: 0; } }
@media (max-width: 599px) { .help-row-side, .help-row-side .reg-btn { width: 100%; } }
@media (max-width: 599px) {
    /* Two lines, and only two: the name holds the first, everything else shares the
       second. Both are flex items that may shrink, or a long date pushes the page
       sideways instead of wrapping. */
    .ds-rows .ds-row-name { flex: 1 1 100%; min-width: 0; }
    .ds-row-meta { flex: 1 1 100%; min-width: 0; }
}
@media (max-width: 599px) {
    .ds-row-wrap { flex-wrap: wrap; }
    .ds-row-wrap .ds-row { flex: 1 1 100%; }
    .ds-row-sheet { flex: 1 1 auto; justify-content: center; margin-bottom: 10px; }
}
@media (max-width: 899px) { .dsw-allspace:not(.dsw-allspace-recent) { display: none; } }
@media (max-width: 899px) {
    .ds-toolbar { grid-template-columns: 1fr; gap: 8px; }
    .ds-toolbar-mid { justify-self: stretch; }
    .ds-toolbar .ds-views { width: 100%; }
    .ds-toolbar .ds-views .reg-unit { flex: 1; justify-content: center; padding: 7px 10px; }
    /* Places are planned at a desk, not on a phone: a week of number fields on a
       390px screen is a mistake waiting to happen (clinic head, 2026-09-23). */
    .ds-toolbar-right { display: none; }
}
/* ===== DS week card on a phone: marks a finger can hit =====
   The arrival tick and the cancel cross were 18px boxes 2px apart, stacked, on the
   busiest phone screen: reaching for one pressed the other, and the tick files an
   arrival at once (audit F125). Below 900px they stand side by side, 36px each with
   12px between, and each takes a 44px press (the ::after reaches 4px round it). The
   card grows to fit instead of clipping. The day hospital only: the ward's card has
   no cross beside its box. */
@media (max-width: 899px) {
    .ds-registry:not(.stac-page) .dsw-card.dsw-slot:not(.dsw-closed) { height: auto; min-height: 68px; row-gap: 6px; padding-bottom: 8px; }
    .ds-registry:not(.stac-page) .dsw-marks { flex-direction: row; gap: 12px; align-items: center; }
    .ds-registry:not(.stac-page) .dsw-marks .dsw-form { display: flex; }
    .ds-registry:not(.stac-page) .dsw-card .dsw-checkbox,
    .ds-registry:not(.stac-page) .dsw-marks .dsw-checkbox-gap,
    .ds-registry:not(.stac-page) .dsw-card:not(.dsw-closed) > .dsw-checkbox-gap { width: 36px; height: 36px; border-radius: 8px; font-size: 16px; }
    .ds-registry:not(.stac-page) .dsw-card .dsw-checkbox { position: relative; }
    .ds-registry:not(.stac-page) .dsw-card button.dsw-checkbox::after { content: ""; position: absolute; inset: -4px; }
}
/* On a phone the days stand one under another, so no row has to line up with its
   neighbour's: the ward card takes the height its name line and details need. */
@media (max-width: 899px) {
    .stac-page .dsw-section > .dsw-card.dsw-slot { height: auto; min-height: 90px; }
}
/* On a phone the two words sit side by side at one width. */
@media (max-width: 899px) { .ds-registry:not(.stac-page) .dsw-card .dsw-actions .dsw-act { min-width: 72px; padding: 0 8px; justify-content: center; } }
@media (max-width: 380px) {
    .ds-registry:not(.stac-page) .dsw-card .dsw-actions { gap: 4px; }
    .ds-registry:not(.stac-page) .dsw-card .dsw-actions .dsw-act { min-width: 60px; padding: 0 6px; font-size: var(--fs-xs); }
}
@media (max-width: 899px) { .dsl-list { width: 100%; padding: 2px 6px; } }
@media (max-width: 899px) { .ds-contact-line, .ds-facts .ds-contact-state { display: block; margin: 4px 0 0; width: fit-content; margin-left: auto; } }
/* Touch targets on a phone: 44px, grown invisibly where a bigger box would push the layout. */
@media (max-width: 599px) {
    /* The patient's name on a week card: taller hit area over the card's own padding and the line under it. */
    .ds-registry:not(.stac-page) .dsw-card .dsw-name { position: relative; z-index: 1; padding-block: 13px; margin-block: -13px; }
    .ds-registry .dsw-typeline .dsw-add { position: relative; min-height: 32px; }
    .ds-registry .dsw-typeline .dsw-add::after { content: ''; position: absolute; inset: -6px -2px; }
    .ds-registry:not(.stac-page) .dsw-card .dsw-actions .dsw-act { position: relative; }
    .ds-registry:not(.stac-page) .dsw-card .dsw-actions .dsw-act::after { content: ''; position: absolute; inset: -4px 0; }
    .ds-alerts details > summary { padding-block: 12px; margin-block: 0; } /* stays a list-item: flex would drop the ▶ marker */
    .ds-awaiting-link, .ds-month-nav .dsw-today { display: inline-flex; align-items: center; min-height: 44px; margin-block: -12px; }
}
@media (max-width: 599px) { .ds-card-name { font-size: var(--fs-lg); } }
@media (max-width: 599px) {
    /* Two to a row, a lone last one across; „Atšaukti" always on a row of its own, last. */
    .ds-actions-row > * { flex: 1 1 calc(50% - var(--sp-2) / 2); }
    .ds-actions-row > .dsw-cancel-btn { flex-basis: 100%; }
    .ds-actions-row .reg-btn { width: 100%; min-height: 44px; }
    .ds-actions-row > .ds-inline-form { display: flex; }
    .ds-history li > .ds-muted:first-child { min-width: 0; }
    .ds-history li > span:not(.ds-muted), .ds-history li > .ds-muted:last-child:not(:first-child) { flex-basis: 100%; }
    .ds-history li > .ds-muted:last-child:not(:first-child) { font-size: var(--fs-xs); }
}
/* „‹ Kalendorius" and „Į pradžią": 44px on a phone. */
@media (max-width: 599px) { .ds-page .ds-back { min-height: 44px; } }
/* The month on a phone or a tablet (below 900px): a compact seven-column calendar instead of 31
   stacked tiles (4,980px at 390). A cell shows the day and each procedure's booked/places, with a thin
   fill under it; the whole cell opens that week, where „+ Įtraukti" adds a patient. The editor
   (places, inside form.cap-edit) and the ward keep their own layout: these rules need the month as a
   direct child of the DS page. */
@media (max-width: 899px) {
    .ds-registry:not(.stac-page) > .stac-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px;
        padding: 0 0 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-3); text-align: center; text-transform: uppercase; letter-spacing: 0.04em; }
    .ds-registry:not(.stac-page) > .dsm-month { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
    .ds-registry:not(.stac-page) > .dsm-month > .stac-day.stac-pad { display: block; border-color: transparent; background: transparent; }
    .ds-registry:not(.stac-page) > .dsm-month > .dsm-day { position: relative; min-height: 64px; padding: 4px 3px 5px; gap: 3px; border-radius: var(--radius-sm); }
    .ds-registry:not(.stac-page) > .dsm-month .dsm-daylink { gap: 0; }
    /* The day number is the link, stretched over the whole cell. */
    .ds-registry:not(.stac-page) > .dsm-month .dsm-daylink::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
    .ds-registry:not(.stac-page) > .dsm-month .stac-day-num { font-size: var(--fs-base); min-width: 0; line-height: 1.2; }
    .ds-registry:not(.stac-page) > .dsm-month .stac-day-wd,
    .ds-registry:not(.stac-page) > .dsm-month .dsm-bar-label,
    .ds-registry:not(.stac-page) > .dsm-month .dsm-plus { display: none; }
    /* One procedure: its count, coloured by the procedure, over a 3px fill. */
    .ds-registry:not(.stac-page) > .dsm-month .dsm-bar-row { display: grid; grid-template-columns: 1fr; gap: 1px; }
    .ds-registry:not(.stac-page) > .dsm-month .dsm-bar-row .stac-count { order: -1; line-height: 1.1; text-align: left; }
    .ds-registry:not(.stac-page) > .dsm-month .dsm-bar-vaa .stac-count { color: var(--vaa-ink); }
    .ds-registry:not(.stac-page) > .dsm-month .dsm-bar-eit .stac-count { color: var(--eit-ink); }
    .ds-registry:not(.stac-page) > .dsm-month .stac-fill { height: 3px; border: none; }
    .ds-registry:not(.stac-page) > .dsm-month .stac-past .stac-count { color: var(--ink-2); }
    .ds-registry:not(.stac-page) > .dsm-month .stac-today { box-shadow: 0 0 0 2px var(--teal-600); }
    /* The month is reachable on a phone again (it was hidden while it was 31 tiles). */
    .ds-registry:not(.stac-page) .ds-views a[href*="view=month"] { display: inline-flex; }
}
/* On a phone: the search row's two lines. Line 1 the procedure, the name and „Paskirti datą";
   line 2 the small print. */
@media (max-width: 599px) {
    .dsw-awaiting-list > .dsw-awaiting-row { column-gap: 8px; row-gap: 3px; }
    .dsw-awaiting-list > .dsw-awaiting-row::after { content: ''; order: 1; flex-basis: 100%; height: 0; }
    .dsw-awaiting-list > .dsw-awaiting-row > * { order: 2; font-size: var(--fs-xs); color: var(--ink-3); }
    .dsw-awaiting-list > .dsw-awaiting-row > :is(.reg-badge:first-child, a:not(.reg-btn), .ds-double, .reg-btn) { order: 0; font-size: inherit; color: inherit; }
    .dsw-awaiting-list > .dsw-awaiting-row > a:not(.reg-btn) { flex: 1 1 0; min-width: 0; overflow-wrap: anywhere; font-size: var(--fs-base); color: var(--ink);
        padding-block: 11px; margin-block: -11px; }
    .dsw-awaiting-list > .dsw-awaiting-row > .reg-btn { margin-left: auto; min-height: 44px; }
    .dsw-awaiting-list > .dsw-awaiting-row > .dsw-phone { color: var(--ink); font-weight: 500; }
    .dsw-awaiting-list > .dsw-awaiting-row > .ds-muted { min-width: 0; }
}
/* The phone month shows no „+": its help line says only what a press does. */
@media (max-width: 899px) { .ds-registry:not(.stac-page) .dsm-help-plus { display: none; } }
/* The phone month's counts at 12px, the system's floor; „12/12" is 36px in a 43px cell. */
@media (max-width: 899px) {
    .ds-registry:not(.stac-page) > .dsm-month .dsm-bar-row .stac-count { font-size: var(--fs-xs); letter-spacing: 0; }
}
/* One column (phone, narrow tablet): Mikrocirkuliacija right under VAA, as on a computer. */
@media (max-width: 899px) {
    .reg-dash-grid > .ds-card-new-vaa { order: 0; }
    .reg-dash-grid > .ds-soon-mikro { order: 1; }
    .reg-dash-grid > .ds-card-new:not(.ds-card-new-vaa):not(.ds-soon-mikro) { order: 2; }
}
/* The ward week's floating „+ Naujas" covered the cards once the days stacked; there each
   day has its own „+ Pridėti", as the DS week does (walk 2, 2026-10-01). */
@media (max-width: 899px) { .stac-fab { display: none; } }
@media (max-width: 599px) { .dsw-search > .dsw-link { min-height: 44px; display: inline-flex; align-items: center; } }
/* The month on a phone (month-view-2): the number without its word, a red dot for „nepranešta", no „!" */
@media (max-width: 899px) {
    .ds-registry:not(.stac-page) > .dsm-month .dsm-marks { position: absolute; top: 4px; right: 4px; margin: 0; }
    .ds-registry:not(.stac-page) > .dsm-month .dsm-mark-untold { min-width: 8px; width: 8px; height: 8px; padding: 0; font-size: 0; }
    .ds-registry:not(.stac-page) > .dsm-month .dsm-mark-flag { display: none; }
    .ds-registry:not(.stac-page) > .dsm-month .dsm-word { display: none; }
    .ds-registry:not(.stac-page) > .dsm-month .dsm-free { font-size: 11px; }
    .ds-registry:not(.stac-page) > .dsm-month .dsm-free b { font-size: 12px; }
    .ds-registry:not(.stac-page) > .dsm-month .dsm-free-ok b { color: inherit; }
    .ds-registry:not(.stac-page) > .dsm-month .dsm-bar-vaa .dsm-free-ok { color: var(--vaa-ink); }
    .ds-registry:not(.stac-page) > .dsm-month .dsm-bar-eit .dsm-free-ok { color: var(--eit-ink); }
    .dsm-wait { display: block; margin: 2px 0 0; }
    /* the legend as the phone draws the marks: a dot, and no „!" */
    .dsm-legend .dsm-mark-untold { min-width: 8px; width: 8px; height: 8px; padding: 0; font-size: 0; }
    .dsm-legend > span:has(.dsm-mark-flag) { display: none; }
}
/* The week's and the month's navigation on a phone (month-view-polish): the title on a row of its own,
   the three buttons under it in one row, the words kept („‹ Ankstesnė", „Šiandien", „Sekanti ›"). */
@media (max-width: 899px) {
    .ds-month-nav:has(> .dsm-today-btn) { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); row-gap: 8px; }
    .ds-month-nav:has(> .dsm-today-btn) > strong { grid-column: 1 / -1; grid-row: 1; }
    .ds-month-nav:has(> .dsm-today-btn) > a:first-child { grid-row: 2; grid-column: 1; justify-self: start; }
    .ds-month-nav:has(> .dsm-today-btn) > .dsm-today-btn { grid-row: 2; grid-column: 2; margin: 0; }
    .ds-month-nav:has(> .dsm-today-btn) > a:last-child { grid-row: 2; grid-column: 3; justify-self: end; }
    /* „Laukia datos" stays on one line; the per-unit counts and the oldest wait go under it. */
    .ds-awaiting > summary:has(.dsm-wait) { flex-wrap: wrap; }
    .ds-awaiting > summary .dsm-wait { order: 3; flex-basis: 100%; margin: 4px 0 0; }
}
/* The patient's history (patient-page). */
@media (max-width: 767px) {
    /* A 44 px target on a phone without making the search row taller. */
    .dsw-awaiting-row a.pt-hist-link { padding: 13px 6px; margin: -13px -6px; }
    .pt-row { grid-template-columns: 1fr auto; padding: var(--sp-3); min-height: 44px; }
    .pt-row-date { grid-column: 1; }
    .pt-row-by { grid-column: 2; grid-row: 1; }
    .pt-row-what, .pt-row-state { grid-column: 1 / -1; }
}
/* Merging two patient records (patient-merge). */
@media (max-width: 767px) {
    .mg-pair { grid-template-columns: 1fr; }
}
/* The red bar's date line (bar-date-first). */
@media (max-width: 599px) {
    /* A line of its own above the name: the date and how far off it is, in the line's full size. */
    .ds-bar-row.dsw-hit > .ds-bar-date { order: -1; flex: 0 0 100%; margin-left: 0; font-size: var(--fs-sm); color: var(--ink); }
}
/* The date step on a phone (sender-physician): „Kita data" under the offered day, the width of it, 44px. */
@media (max-width: 599px) {
    .ds-choices:has(> .ds-more-date) { grid-template-columns: minmax(0, 1fr); }
    .ds-more-date > summary { grid-column: 1; grid-row: 2; min-height: 44px; }
}
/* Today's closed cell (same-day-cutoff): a phone cell is too narrow for the word: the day is struck through, the title says why. */
@media (max-width: 599px) {
    .ds-cal-day.ds-cal-closed small { display: none; }
    .ds-cal-day.ds-cal-closed { text-decoration: line-through; text-decoration-thickness: 1.5px; }
}
/* „Pasiūlymas" on a phone: the pencil alone (suggestion-box). */
@media (max-width: 599px) {
    .reg-suggest-btn .reg-suggest-label { display: none; }
    .reg-suggest-btn .reg-suggest-icon { display: inline; }
}
/* Search result lines on a phone (search-columns). */
@media (max-width: 599px) {
    .dsw-hit > .dsw-hit-name > :is(.dsw-hit-link, .ds-double) { order: 0; font-size: inherit; color: inherit; }
    .dsw-hit > .dsw-hit-name > .dsw-hit-link { flex: 1 1 0; min-width: 0; overflow: hidden; font-size: var(--fs-base); color: var(--ink);
        display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; white-space: normal; overflow-wrap: anywhere; line-height: 1.25; }
}
/* Phone targets of at least 44 px (tap-targets, kulkardio_1, 2026-10-13). */
@media (max-width: 599px) {
    /* „Pasiūlymas" as the pencil alone is 39 px wide. A wider button pushed the header's second row
       down at 599 px, so the target grows instead: 3 px either side, into the gaps, nothing moves. */
    .reg-suggest-btn { position: relative; }
    .reg-suggest-btn::after { content: ''; position: absolute; inset: -1px -3px; }
    /* The patient's name, a link to their history: padding above and below an inline link widens what
       a finger can hit without moving a line (the card's 20 px heading 27 → 45, the ward's 15 px line 19 → 45). */
    .ds-card-name .pt-name-link { padding-block: 9px; }
    dd .pt-name-link { padding-block: 13px; }
    /* The date calendar's days were 40 px tall. Their width stays the seventh of the grid: 31 px at 360,
       35 px at 390 inside the card's, the panel's and the calendar's padding. */
    .ds-cal-day { min-height: 44px; }
}
/* ===== Tables on a phone: .reg-table-stack (table-stack, kulkardio_1, 2026-10-13) =====
   A table wider than a phone scrolled sideways, its last columns out of sight. With .reg-table-stack the
   header goes and each row becomes a small block: the cell marked .rts-lead first and bold, then every
   other cell with its column's name before it (data-label). Two layouts:
   - lines (the default): one value per line — Žmonės, trusted devices, new accounts;
   - .rts-flow: the values run on as text and wrap — the logs and the tables of numbers.
   A table may then arrange its own cells (order, line breaks) in its block below. Screen only: a printed
   list keeps its columns. Desktop is untouched. */
@media screen and (max-width: 599px) {
    .reg-table-stack thead { display: none; }
    .reg-table-stack, .reg-table-stack tbody { display: block; }
    .reg-table-stack tr { display: flex; flex-direction: column; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
    .reg-table-stack td, .reg-table-stack tbody th { display: block; padding: 1px 0; border: 0; }
    .reg-table-stack tr:hover td { background: none; }
    .reg-table-stack .rts-lead { order: -1; font-size: var(--fs-base); font-weight: 600; padding-bottom: var(--sp-1); }
    /* The label in the body font, also before a value set in mono (a personal code, a phone number). */
    .reg-table-stack td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-3); font-family: var(--font-family); }
    .reg-table-stack.rts-flow tr { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 2px var(--sp-2); padding: var(--sp-2) 0; }
    .reg-table-stack.rts-flow td { padding: 0; font-size: var(--fs-sm); min-width: 0; overflow-wrap: anywhere; }
    .reg-table-stack.rts-flow td:empty { display: none; }
    .reg-table-stack.rts-flow .rts-lead { flex-basis: 100%; padding-bottom: 0; }

    /* The action log (audit page, person card): when and what on the first line, then who, the target and
       the address, then the details. Columns: 1 time, 2 who, 3 address, 4 action, 5 target, 6 details. */
    .audit-table td:nth-child(1) { order: 1; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
    .audit-table td:nth-child(4) { order: 2; flex: 1 0 50%; font-weight: 600; white-space: normal; }
    .audit-table td:nth-child(2) { order: 3; }
    .audit-table td:nth-child(5) { order: 4; }
    .audit-table td:nth-child(5)::before { content: "→ "; color: var(--ink-3); }
    .audit-table td:nth-child(3) { order: 5; color: var(--ink-3); font-size: 12px; }
    .audit-table td:nth-child(6) { order: 6; flex-basis: 100%; color: var(--ink-3); font-size: 12px; }

    /* „Mano paskyra" › Veiksmų istorija: when, what and on what; under it, small, who and from where.
       Columns: 1 time, 2 action, 3 object, 4 who, 5 address. */
    .acct-hist tr::after { content: ''; order: 3; flex-basis: 100%; height: 0; }
    .acct-hist td:nth-child(1) { order: 1; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
    .acct-hist td:nth-child(2) { order: 2; font-weight: 600; }
    .acct-hist td:nth-child(3) { order: 2; }
    .acct-hist td:nth-child(4), .acct-hist td:nth-child(5) { order: 4; color: var(--ink-3); font-size: var(--fs-xs); }
    .acct-hist td:nth-child(4)::before { content: "Atliko: "; }
    .acct-hist td:nth-child(5)::before { content: "iš "; }

    /* Statistika › Kas kiek registruoja: the account, then a line of referral counts, a line of ward
       counts, and the dates. Columns: 1 account, 2–5 referrals, 6–9 ward, 10 created, 11 last sign-in. */
    [data-stats="accounts"] tr::before, [data-stats="accounts"] tr::after { content: ''; flex-basis: 100%; height: 0; }
    [data-stats="accounts"] td:nth-child(n+2):nth-child(-n+5) { order: 1; }
    [data-stats="accounts"] tr::before { order: 2; }
    [data-stats="accounts"] td:nth-child(n+6):nth-child(-n+9) { order: 3; }
    [data-stats="accounts"] tr::after { order: 4; }
    [data-stats="accounts"] td:nth-child(n+10) { order: 5; color: var(--ink-3); }

    /* Stacionaras › Dienos sąrašas: the patient, then the rest; a note stays with its patient. */
    .stac-table.reg-table-stack .stac-group-row { padding: var(--sp-3) 0 var(--sp-1); }
    /* The first heading starts at the card's own padding (the wrapper's u-mt-0 takes its margin). */
    .stac-table.reg-table-stack .stac-group-row:first-child { padding-top: 0; }
    .stac-table.reg-table-stack .stac-group-row th { background: none; padding: 0; }
    .stac-table.reg-table-stack td { white-space: normal; }
    .stac-table.reg-table-stack tr:has(+ .stac-note-row) { border-bottom: 0; }
    .stac-table.reg-table-stack .stac-note-row { padding-top: 0; }
}
/* Rolės ir teisės on a phone: the role's column stays put while the matrix scrolls (it is sticky at every
   width), but at 176 px it left room for one permission beside it. Narrower, the names wrap: three show. */
@media (max-width: 599px) {
    .perm-corner, .perm-role { min-width: 0; width: 112px; white-space: normal; }
}
/* „Visas žurnalas ›" under the person card's logs (person-logs, kulkardio_1, 2026-10-13): padding above
   and below the inline link makes a 44 px target without moving the line. */
@media (max-width: 599px) {
    .person-log-more a { padding-block: 12px; }
}
/* ===== feature: ds-search-filters (kulkardio_2, 2026-10-13): the search results' filters — one quiet row above
   the results, the labels small above their fields; wraps on a narrow screen, each field full width on a phone. ===== */
.dsf-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; padding-bottom: 12px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.dsf-field { display: flex; flex-direction: column; gap: 4px; margin: 0; min-width: 0; }
.dsf-label { font-size: var(--fs-sm); color: var(--ink-3); }
.dsf-input { min-height: 36px; padding: 6px 10px; }
.dsf-field-phys { flex: 0 1 240px; }
.dsf-actions { display: flex; align-items: center; gap: 12px; min-height: 36px; }
/* „Išvalyti" as the search's own (.dsw-search > .dsw-link). */
.dsf-actions > .dsw-link { font-size: var(--fs-sm); font-weight: 500; color: var(--teal-700); text-decoration: underline; text-underline-offset: 2px; min-height: 36px; }
@media (max-width: 599px) {
    /* The two lists side by side, the physician and the buttons a row each. */
    .dsf-field { flex: 1 1 calc(50% - 6px); }
    .dsf-field-phys { flex: 1 1 100%; }
    .dsf-input, .dsf-actions .reg-btn, .dsf-actions > .dsw-link { min-height: 44px; }
}
/* ===== feature: vaa-indications-2 (kulkardio_2, 2026-10-13): „Kita" under the VAA indications opens its text box — by CSS, following the tick ===== */
.ds-ind-kita > .ds-ind-kita-box { display: none; margin-top: 6px; }
.ds-ind-kita:has(> .reg-checkbox-label input:checked) > .ds-ind-kita-box { display: block; }
/* ===== feature: return-to-waiting (kulkardio_2, 2026-10-13): „Laukiama paciento sprendimo iki …" on a waiting referral, red once the day has passed ===== */
.ds-decision { display: inline-block; padding: 1px 8px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-sm); white-space: nowrap; }
.ds-decision-late { color: var(--urgent); font-weight: 600; }
.ds-datebox > .ds-decision { margin-top: 6px; white-space: normal; }
.dsw-awaiting-row .ds-muted > .ds-decision { margin-right: 8px; }
