/*
  SpitalCo design system stylesheet. Load it after Syncfusion's theme:
    <link rel="stylesheet" href="_content/Syncfusion.Blazor.Themes/bootstrap5.css" />
    <link rel="stylesheet" href="_content/SpitalCo.Shared.UI/css/spitalco.css" />

  The design it implements is in docs/design (README.md and the five artboards). Values come from
  spitalco-tokens.css; the fonts from spitalco-fonts.css; the restyling of Syncfusion's grid, pager, scheduler
  and buttons is in spitalco-syncfusion.css.

  Right-to-left: only logical properties are used (inline-start/end, block-start/end), never left/right, so the
  whole layout mirrors when SpitalCoRoot sets dir="rtl". Do not add physical left/right rules here.

  Tablet-first: the base rules describe the landscape tablet and desktop layout (navigation rail, top bar, two
  columns). Two adjustments follow each block where needed:
    max-width 1023.98px  a portrait tablet: still the rail, but one column (a side panel moves under the content,
                         the queue becomes the card list);
    max-width 767.98px   a phone: no rail, the navigation at the bottom.

  Class prefix: sc-. One block per component, in the order: base, shell, page, buttons, badges and banners,
  cards and lists, queue, patient file, states, forms, sign-in gate.
*/
@import url("spitalco-tokens.css");
@import url("spitalco-fonts.css");
@import url("spitalco-syncfusion.css");
@import url("spitalco-slip.css");

/* ---------- Base ---------- */

html,
body {
    height: 100%;
    margin: 0;
    background: var(--sc-color-bg);
    color: var(--sc-color-text);
    font-family: var(--sc-font-family);
    font-size: var(--sc-font-size-body);
    line-height: var(--sc-line-body);
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

.sc-root {
    height: 100%;
    color: var(--sc-color-text);
    font-family: var(--sc-font-family);
    font-size: var(--sc-font-size-body);
    line-height: var(--sc-line-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Arabic text is set in the Arabic family first; digits and Latin letters still come from Inter. */
.sc-root[lang="ar"],
.sc-root [lang="ar"] {
    font-family: var(--sc-font-family-arabic);
}

.sc-root [lang]:not([lang="ar"]) {
    font-family: var(--sc-font-family);
}

.sc-root *,
.sc-root *::before,
.sc-root *::after {
    box-sizing: border-box;
}

.sc-root a {
    color: var(--sc-color-primary-strong);
}

.sc-root a:hover {
    color: var(--sc-color-primary-pressed);
}

.sc-root :focus-visible {
    outline: var(--sc-focus-width) solid var(--sc-focus-color);
    outline-offset: var(--sc-focus-offset);
}

.sc-root h1,
.sc-root h2,
.sc-root h3,
.sc-root p {
    margin: 0;
}

.sc-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sc-icon {
    flex: none;
    vertical-align: middle;
    stroke-width: var(--sc-icon-stroke);          /* one stroke weight for the whole icon family, whatever the markup says */
}

/* Icons that follow the reading direction point the other way in right-to-left languages. */
[dir="rtl"] .sc-icon--directional {
    transform: scaleX(-1);
}

.sc-muted {
    color: var(--sc-color-text-muted);
}

/* Clinical values, times, dates, money and file numbers: Western digits with tabular figures. */
.sc-num {
    font-variant-numeric: tabular-nums;
}

/* Numbers, phone numbers and codes keep their left-to-right order inside Arabic text. */
.sc-ltr {
    direction: ltr;
    unicode-bidi: isolate;
    font-variant-numeric: tabular-nums;
}

/* A left-to-right value that fills a line of a right-to-left page still starts at the page's start edge. */
[dir="rtl"] .sc-ltr {
    text-align: end;
}

/* The SpitalCo app icon (brand guidelines, "Icon only"): the SC monogram on a navy rounded square. */
.sc-brand-mark {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: var(--sc-radius-md);
    background: var(--sc-brand-navy);
    color: var(--sc-color-on-dark);
}

.sc-brand-mark__svg {
    display: block;
    width: 74%;
    height: auto;
    overflow: visible;
}

/* The logo lock-up (monogram and word mark), drawn inline so it follows the tokens. */
.sc-brand-logo {
    display: inline-flex;
    align-items: center;
    color: var(--sc-color-text);
    line-height: 0;
}

.sc-brand-logo svg {
    display: block;
    height: var(--sc-brand-logo-height, 32px);
    width: auto;
}

.sc-brand-logo--on-dark {
    color: var(--sc-color-on-dark);
}

.sc-avatar {
    display: inline-grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex: none;
    border-radius: var(--sc-radius-pill);
    background: var(--sc-color-primary-soft);
    color: var(--sc-color-primary-strong);
    font-size: var(--sc-font-size-label);
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
}

.sc-avatar--sm {
    width: 24px;
    height: 24px;
    font-size: var(--sc-font-size-caption);
}

.sc-avatar--lg {
    width: 40px;
    height: 40px;
    font-size: var(--sc-font-size-body);
}

.sc-avatar--xl {
    width: 48px;
    height: 48px;
    font-size: var(--sc-font-size-subtitle);
}

.sc-avatar--info {
    background: var(--sc-color-info-soft);
    color: var(--sc-color-info);
}

/* ---------- Shell ---------- */

.sc-shell {
    --sc-main-pad-block: 24px;
    --sc-main-pad-inline: 32px;
    display: grid;
    grid-template-columns: var(--sc-sidenav-rail-width) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
        "nav top"
        "nav banner"
        "nav main";
    height: 100vh;
    height: 100dvh;
    background: var(--sc-color-bg);
}

/* Navigation rail: icon above label, the selected item on the primary tint. */
.sc-sidenav {
    grid-area: nav;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sc-space-1);
    min-height: 0;
    padding-block: calc(var(--sc-space-3) + env(safe-area-inset-top, 0px)) var(--sc-space-3);
    background: var(--sc-color-dark-bg);
    border-inline-end: 1px solid var(--sc-color-dark-border);
    overflow-y: auto;
    --sc-focus-color: var(--sc-focus-color-on-dark);
}

.sc-sidenav__brand {
    display: flex;
    flex: none;
    margin-block-end: var(--sc-space-3);
}

.sc-sidenav__list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sc-space-1);
    margin: 0;
    padding: 0;
    list-style: none;
}

.sc-sidenav__list--end {
    margin-block-start: auto;
    padding-block-start: var(--sc-space-2);
}

.sc-sidenav__footer {
    padding-block-start: var(--sc-space-2);
    color: var(--sc-color-on-dark-muted);
    font-size: var(--sc-font-size-caption);
    text-align: center;
}

.sc-root a.sc-navlink {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--sc-space-1);
    width: 76px;
    min-height: 56px;
    padding: var(--sc-space-2) 2px;
    border-radius: var(--sc-radius-nav);
    color: var(--sc-color-on-dark-muted);
    font-size: var(--sc-font-size-nav);
    font-weight: 500;
    line-height: 16px;
    transition: background-color var(--sc-motion-fast) ease-out, color var(--sc-motion-fast) ease-out;
    text-align: center;
    text-decoration: none;
}

.sc-root a.sc-navlink:hover {
    background: var(--sc-color-dark-surface);
    color: var(--sc-color-on-dark);
}

/* Selected: white label, an accent icon, a quiet step of ground and a bar at the start edge (shape as well as colour). */
.sc-root a.sc-navlink.active {
    background: var(--sc-color-dark-selected);
    color: var(--sc-color-on-dark);
    font-weight: 600;
}

.sc-root a.sc-navlink.active .sc-icon {
    color: var(--sc-color-on-dark-accent);
}

.sc-root a.sc-navlink.active::before {
    content: "";
    position: absolute;
    inset-block: var(--sc-space-3);
    inset-inline-start: -6px;
    width: 3px;
    border-radius: var(--sc-radius-pill);
    background: var(--sc-brand-cyan);
}

.sc-navlink__text {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-navlink__offline {
    position: absolute;
    inset-block-start: var(--sc-space-1);
    inset-inline-end: var(--sc-space-2);
    color: var(--sc-color-warning-on-dark);
}

/* Top bar: facility name and sample chip at the start; sync chip, language and user at the end. */
.sc-topbar {
    grid-area: top;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sc-space-4);
    min-height: calc(var(--sc-topbar-height) + env(safe-area-inset-top, 0px));
    padding-block: env(safe-area-inset-top, 0px) 0;
    padding-inline: var(--sc-main-pad-inline);
    background: var(--sc-color-surface);
    border-block-end: 1px solid var(--sc-color-border);
}

.sc-topbar__context {
    display: flex;
    align-items: center;
    gap: var(--sc-space-3);
    min-width: 0;
}

.sc-topbar__brand {
    display: none;
}

.sc-topbar__title {
    min-width: 0;
    overflow: hidden;
    font-size: var(--sc-font-size-body);
    font-weight: 600;
    line-height: var(--sc-line-body);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-topbar__actions {
    display: flex;
    align-items: center;
    gap: var(--sc-space-3);
    flex: none;
}

.sc-root a.sc-topbar__user {
    display: inline-flex;
    border-radius: var(--sc-radius-pill);
    text-decoration: none;
}

.sc-offline-banner {
    grid-area: banner;
    padding: var(--sc-space-3) var(--sc-main-pad-inline) 0;
}

.sc-main {
    grid-area: main;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: var(--sc-main-pad-block, 20px) var(--sc-main-pad-inline, 24px);
    -webkit-overflow-scrolling: touch;
}

.sc-main > * {
    max-width: var(--sc-content-max);
    margin-inline: auto;
}

.sc-bottomnav {
    display: none;
}

/* On tablet and desktop the sample-data chip is in the top bar, so the one in a page header is not repeated. */
@media (min-width: 768px) {
    .sc-shell .sc-main .sc-sample-badge {
        display: none;
    }
}

/* Phone: no rail; a compact top bar and the navigation at the bottom, within thumb reach. */
@media (max-width: 767.98px) {
    .sc-shell {
        --sc-main-pad-block: 16px;
        --sc-main-pad-inline: 16px;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto minmax(0, 1fr) auto;
        grid-template-areas:
            "top"
            "banner"
            "main"
            "bottom";
    }

    .sc-sidenav {
        display: none;
    }

    .sc-topbar {
        gap: var(--sc-space-3);
        padding-block: calc(12px + env(safe-area-inset-top, 0px)) 12px;
        padding-inline: 16px;
    }

    .sc-topbar__context {
        gap: 12px;
    }

    .sc-topbar__brand {
        display: inline-grid;
        width: 36px;
        height: 36px;
        border-radius: var(--sc-radius-md);
    }

    .sc-topbar__brand .sc-icon {
        width: 18px;
        height: 18px;
    }

    .sc-topbar .sc-topbar__sample,
    .sc-topbar .sc-lang-select,
    .sc-root a.sc-topbar__user {
        display: none;
    }

    .sc-bottomnav {
        grid-area: bottom;
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(0, 1fr);
        align-items: center;
        min-height: var(--sc-bottomnav-height);
        padding-block: 0 env(safe-area-inset-bottom, 0px);
        padding-inline: 4px;
        background: var(--sc-color-surface);
        border-block-start: 1px solid var(--sc-color-border);
    }

    .sc-root a.sc-bottomnav__link {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        min-width: 0;
        height: 56px;
        padding-inline: 4px;
        border-radius: var(--sc-radius-nav);
        color: var(--sc-color-text-muted);
        font-size: var(--sc-font-size-nav-phone);
        font-weight: 500;
        line-height: 18px;
        text-decoration: none;
    }

    .sc-root a.sc-bottomnav__link.active {
        background: var(--sc-color-primary-soft);
        color: var(--sc-color-primary-strong);
        font-weight: 600;
    }

    .sc-bottomnav__text {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ---------- Sync chip and language button ---------- */

.sc-sync,
.sc-root a.sc-sync {
    display: inline-flex;
    align-items: center;
    gap: var(--sc-space-2);
    height: var(--sc-control-height-sm);
    padding-inline: var(--sc-space-3);
    border-radius: var(--sc-radius-md);
    background: var(--sc-color-neutral-soft);
    color: var(--sc-color-neutral);
    font-size: var(--sc-font-size-label);
    font-weight: 500;
    line-height: var(--sc-line-label);
    text-decoration: none;
    white-space: nowrap;
}

.sc-sync--ok,
.sc-root a.sc-sync--ok {
    background: var(--sc-color-success-soft);
    color: var(--sc-color-success);
}

.sc-sync--offline,
.sc-root a.sc-sync--offline {
    background: var(--sc-color-warning-soft);
    color: var(--sc-color-warning);
}

.sc-sync--pending,
.sc-root a.sc-sync--pending,
.sc-sync--syncing,
.sc-root a.sc-sync--syncing {
    background: var(--sc-color-info-soft);
    color: var(--sc-color-info);
}

.sc-sync--review,
.sc-root a.sc-sync--review {
    background: var(--sc-color-danger-soft);
    color: var(--sc-color-danger);
}

.sc-sync .sc-icon {
    width: 16px;
    height: 16px;
}

@media (max-width: 767.98px) {
    .sc-sync,
    .sc-root a.sc-sync {
        gap: var(--sc-space-1);
        height: var(--sc-control-height-sm);
        padding-inline: var(--sc-space-2);
        font-size: var(--sc-font-size-caption);
    }

    /* The sentence does not fit: show the short form from data-short instead. */
    .sc-sync__label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .sc-sync[data-short]:not([data-short=""])::after {
        content: attr(data-short);
    }
}

.sc-lang-select {
    display: inline-flex;
    align-items: center;
}

.sc-lang-select__control {
    height: var(--sc-control-height-sm);
    padding-inline: var(--sc-space-3);
    appearance: none;
    -webkit-appearance: none;
    text-align: center;
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-md);
    background: var(--sc-color-surface);
    color: var(--sc-color-text);
    font-family: inherit;
    font-size: var(--sc-font-size-label);
    font-weight: 500;
    line-height: var(--sc-line-label);
    cursor: pointer;
    transition: border-color var(--sc-motion-fast) ease-out;
}

.sc-lang-select__control:hover {
    border-color: var(--sc-color-border-strong);
}

.sc-lang-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sc-space-2);
}

.sc-lang-button {
    min-height: var(--sc-control-height);
    padding-inline: var(--sc-space-4);
    border: 1px solid var(--sc-color-border-strong);
    border-radius: var(--sc-radius-md);
    background: var(--sc-color-surface);
    color: var(--sc-color-text);
    font-family: inherit;
    font-size: var(--sc-font-size-body);
    font-weight: 500;
    line-height: var(--sc-line-body);
    cursor: pointer;
    transition: background-color var(--sc-motion-fast) ease-out;
}

.sc-lang-button:hover {
    background: var(--sc-color-surface-alt);
}

.sc-lang-button--current,
.sc-lang-button--current:hover {
    border-color: var(--sc-color-primary);
    background: var(--sc-color-primary-soft);
    color: var(--sc-color-primary-strong);
    font-weight: 600;
}

/* The theme control: Light | Dark, an icon and a word on each part, one part pressed. A segmented control, not two buttons. */
.sc-theme {
    display: inline-flex;
    align-items: stretch;
    padding: 2px;
    border: 1px solid var(--sc-color-border-button);
    border-radius: var(--sc-radius-md);
    background: var(--sc-color-surface);
}

.sc-theme__option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sc-space-2);
    min-height: calc(var(--sc-control-height) - 6px);
    padding-inline: var(--sc-space-4);
    border: 0;
    border-radius: var(--sc-radius-sm);
    background: transparent;
    color: var(--sc-color-text-muted);
    font-family: inherit;
    font-size: var(--sc-font-size-body);
    font-weight: 500;
    line-height: var(--sc-line-body);
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--sc-motion-fast) ease-out, color var(--sc-motion-fast) ease-out;
}

.sc-theme__option:hover {
    background: var(--sc-color-surface-alt);
    color: var(--sc-color-text);
}

/* The chosen part follows the theme of the page itself (data-theme on the root element), so the control is right before the app has started and
   after a reload; the component's own state (aria-pressed) agrees with it. */
:root:not([data-theme="dark"]) .sc-theme__option[data-theme-value="light"],
:root:not([data-theme="dark"]) .sc-theme__option[data-theme-value="light"]:hover,
:root[data-theme="dark"] .sc-theme__option[data-theme-value="dark"],
:root[data-theme="dark"] .sc-theme__option[data-theme-value="dark"]:hover {
    background: var(--sc-color-primary-soft);
    color: var(--sc-color-primary-strong);
    font-weight: 600;
}

/* In the top bar: the same control, one step smaller, to sit beside the language button */
.sc-theme--compact .sc-theme__option {
    min-height: calc(var(--sc-control-height-sm) - 6px);
    padding-inline: var(--sc-space-3);
    font-size: var(--sc-font-size-label);
}

.sc-theme--compact .sc-icon {
    width: 16px;
    height: 16px;
}

/* Phone: the top bar has no room for it; it is on the More and Profile page. */
@media (max-width: 767.98px) {
    .sc-topbar .sc-theme {
        display: none;
    }
}

/* ---------- Page ---------- */

/* A page that fills the screen and scrolls inside its own panels (queue, calendar) instead of as a whole. */
.sc-page--fill {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

/* A page that uses the full width, whatever the content maximum is. */
.sc-main > .sc-page--wide {
    max-width: none;
}

.sc-fill {
    flex: 1 1 auto;
    min-height: 0;
}

.sc-page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--sc-space-4);
    margin-block-end: var(--sc-space-5);
}

.sc-page-header__text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--sc-space-1);
    min-width: 0;
}

.sc-page-header__title {
    margin: 0;
    font-size: var(--sc-font-size-page-title);
    font-weight: var(--sc-font-weight-h1);
    line-height: var(--sc-line-page-title);
}

.sc-page-header__subtitle {
    margin: 0;
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-body-sm);
    line-height: var(--sc-line-body-sm);
}

.sc-page-header__actions {
    display: flex;
    flex: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--sc-space-2);
}

.sc-root a.sc-page-header__back,
.sc-root a.sc-back {
    display: inline-grid;
    place-items: center;
    align-self: center;
    width: var(--sc-control-height);
    height: var(--sc-control-height);
    flex: none;
    border: 1px solid var(--sc-color-border-strong);
    border-radius: var(--sc-radius-md);
    background: var(--sc-color-surface);
    color: var(--sc-color-text);
}

.sc-root a.sc-page-header__back:hover,
.sc-root a.sc-back:hover {
    background: var(--sc-color-surface-alt);
}

/* A list with a detail panel beside it (queue), or content with a summary column (patient file). */
.sc-split {
    display: flex;
    align-items: stretch;
    gap: var(--sc-space-5);
    min-height: 0;
}

.sc-split__main {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.sc-split__aside {
    display: flex;
    flex: none;
    flex-direction: column;
    gap: var(--sc-space-4);
    width: var(--sc-side-panel-width);
    min-height: 0;
}

.sc-split__aside > .sc-card,
.sc-split__main > .sc-card:last-child {
    margin-block-end: 0;
}

@media (max-width: 767.98px) {
    .sc-page--fill {
        display: block;
        height: auto;
    }

    .sc-page-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--sc-space-3);
        margin-block-end: var(--sc-space-4);
    }

    .sc-page-header__actions {
        justify-content: flex-start;
    }

    /* The one primary action of the page is a full-width button under the title. */
    .sc-root .sc-page-header__actions > .e-btn.e-primary {
        order: 1;
        width: 100%;
        min-height: var(--sc-touch);
    }

}

/* Portrait tablet and phone: one column; the side panel follows the content. */
@media (max-width: 1023.98px) {
    .sc-split {
        display: block;
    }

    .sc-split__aside {
        width: auto;
        margin-block-start: var(--sc-space-4);
    }
}

/* ---------- Buttons ---------- */

/*
  There is no button class of our own: every button is a Syncfusion SfButton (a link-button is an anchor with
  Syncfusion's e-btn class), restyled to the design in spitalco-syncfusion.css. Five kinds, all 48 px high:
  primary (e-primary, one per screen), secondary (default / e-outline), quiet (e-flat), destructive (e-danger,
  outlined in red, always asks for confirmation) and disabled (says why next to it).
*/

/* The tallest button: the next action of a detail panel. */
.sc-root .e-btn.sc-visit-panel__next {
    min-height: var(--sc-control-height);
}

/* The reason a button is disabled, written next to it. */
.sc-btn-reason {
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-caption);
    line-height: var(--sc-line-caption);
}

/* ---------- Badges, chips and banners ---------- */

/* Status badge: a dot and a label on the tint of the tone. The dot is a ring or filled: shape, not only colour. */
.sc-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--sc-space-2);
    height: 24px;
    padding-inline: var(--sc-space-2);
    flex: none;
    border-radius: var(--sc-radius-xs);
    background: var(--sc-color-neutral-soft);
    color: var(--sc-color-neutral);
    font-size: var(--sc-font-size-label);
    font-weight: 500;
    line-height: var(--sc-line-label);
    white-space: nowrap;
}

.sc-badge__dot {
    width: 8px;
    height: 8px;
    flex: none;
    border: 1.5px solid currentColor;
    border-radius: var(--sc-radius-pill);
    background: currentColor;
}

.sc-badge__dot--hollow {
    background: transparent;
}

.sc-badge--sm {
    gap: var(--sc-space-1);
    height: 20px;
    padding-inline: 8px;
    font-size: var(--sc-font-size-caption);
}

/* Tone chip: a short label on the tint of the tone, without a dot. */
.sc-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--sc-space-1);
    min-height: 20px;
    padding-inline: 8px;
    flex: none;
    border-radius: var(--sc-radius-xs);
    background: var(--sc-color-neutral-soft);
    color: var(--sc-color-neutral);
    font-size: var(--sc-font-size-caption);
    font-weight: 500;
    line-height: var(--sc-line-caption);
    white-space: nowrap;
}

/* The larger chip of a header ("Identity linked"), the same height as a status badge. */
.sc-chip--lg {
    gap: var(--sc-space-2);
    min-height: 24px;
    padding-inline: var(--sc-space-2);
    font-size: var(--sc-font-size-label);
}

/* In a list row a type or a source is secondary text, not a coloured tag on every row: only a warning or an alert keeps its tint. */
.sc-list__item .sc-chip:not(.sc-chip--warning):not(.sc-chip--danger) {
    min-height: 0;
    padding-inline: 0;
    background: transparent;
    color: var(--sc-color-text-muted);
    font-weight: 400;
}

.sc-badge--info,
.sc-chip--info {
    background: var(--sc-color-info-soft);
    color: var(--sc-color-info);
}

.sc-badge--progress,
.sc-chip--progress {
    background: var(--sc-color-progress-soft);
    color: var(--sc-color-progress);
}

.sc-badge--warning,
.sc-chip--warning {
    background: var(--sc-color-warning-soft);
    color: var(--sc-color-warning);
}

.sc-badge--success,
.sc-chip--success {
    background: var(--sc-color-success-soft);
    color: var(--sc-color-success);
}

.sc-badge--danger,
.sc-chip--danger {
    background: var(--sc-color-danger-soft);
    color: var(--sc-color-danger);
}

.sc-sample-badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding-inline: 8px;
    flex: none;
    border: 1px dashed var(--sc-color-border-strong);   /* a dashed edge: it is not real data, in every theme */
    border-radius: var(--sc-radius-xs);
    background: transparent;
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-caption);
    font-weight: 500;
    line-height: var(--sc-line-caption);
    white-space: nowrap;
}

/* System-state banner: offline (warning), waiting to sync (info), clinical alert (danger), sample data (neutral). */
.sc-banner,
.sc-note {
    display: flex;
    align-items: center;
    gap: var(--sc-space-3);
    padding: var(--sc-space-3) var(--sc-space-4);
    border-radius: var(--sc-radius-md);
    background: var(--sc-color-neutral-soft);
    color: var(--sc-color-neutral);
    font-size: var(--sc-font-size-body);
    font-weight: 400;
    line-height: var(--sc-line-body);
}

.sc-banner__text {
    min-width: 0;
}

.sc-banner--warning {
    background: var(--sc-color-warning-soft);
    color: var(--sc-color-warning);
}

.sc-banner--info,
.sc-banner--progress {
    background: var(--sc-color-info-soft);
    color: var(--sc-color-info);
}

/* A note on a page (what the screen is for, why it is read only): quiet, on the inset ground, a line at the start edge. Not a system state, so no colour. */
.sc-note {
    border-inline-start: 2px solid var(--sc-color-border-strong);
    border-radius: var(--sc-radius-sm);
    background: var(--sc-color-surface-alt);
    color: var(--sc-color-text-muted);
}

.sc-banner--success {
    background: var(--sc-color-success-soft);
    color: var(--sc-color-success);
}

/* A clinical alert stays on every screen of the patient and is set heavier than the other banners. */
.sc-banner--danger {
    padding: var(--sc-space-3) var(--sc-space-4);
    background: var(--sc-color-danger-soft);
    color: var(--sc-color-danger);
    font-weight: 600;
}

.sc-banner--compact {
    gap: var(--sc-space-2);
    padding: var(--sc-space-2) var(--sc-space-3);
    font-size: var(--sc-font-size-label);
    line-height: var(--sc-line-label);
}

.sc-root p.sc-note {
    margin-block-end: var(--sc-space-4);
}

.sc-banner-stack {
    display: flex;
    flex-direction: column;
    gap: var(--sc-space-2);
}

/* The alert band of a patient on a page that is not the patient file (the encounter note). */
.sc-patient-alerts--page {
    margin-block-end: var(--sc-space-4);
}

/* ---------- Cards and lists ---------- */

/* Card: 1 px border, no shadow. Only dialogs and menus are raised (--sc-shadow-2). */
.sc-card {
    margin-block-end: var(--sc-space-4);
    background: var(--sc-color-surface);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-lg);
    box-shadow: var(--sc-shadow-1);
}

.sc-card__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--sc-space-3);
    padding: var(--sc-space-4) var(--sc-space-4) 0;
}

.sc-card__title {
    margin: 0;
    font-size: var(--sc-font-size-body);
    font-weight: 600;
    line-height: var(--sc-line-body);
}

.sc-card__aside {
    color: var(--sc-color-text-subtle);
    font-size: var(--sc-font-size-caption);
    line-height: var(--sc-line-caption);
    font-variant-numeric: tabular-nums;
}

.sc-card__body {
    display: flow-root;
    padding: var(--sc-space-4);
}

.sc-card__header + .sc-card__body {
    padding-block-start: var(--sc-space-3);
}

.sc-card__body > :last-child {
    margin-block-end: 0;
}

/* The main card of a page ("Visits"): a larger title and wider padding. */
.sc-card--main > .sc-card__header {
    align-items: center;
    padding: var(--sc-space-4) var(--sc-space-5) 0;
}

.sc-card--main > .sc-card__header .sc-card__title {
    font-size: var(--sc-font-size-subtitle);
    line-height: var(--sc-line-subtitle);
}

.sc-card--main > .sc-card__body {
    padding: var(--sc-space-3) var(--sc-space-5) var(--sc-space-4);
}

.sc-card__text {
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-label);
    line-height: var(--sc-line-label);
}

.sc-list {
    display: flex;
    flex-direction: column;
    margin: calc(-1 * var(--sc-space-1)) 0;
    padding: 0;
    list-style: none;
}

.sc-list__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sc-space-3);
    min-height: 52px;
    padding: var(--sc-space-3) 0;
    border-block-end: 1px solid var(--sc-color-border);
}

.sc-list__item:last-child {
    border-block-end: 0;
}

.sc-list__item > .sc-icon {
    color: var(--sc-color-text-muted);
}

/* A row reads from its first line: the icon sits level with the title, not in the middle of a tall row; what is a single control stays centred. */
.sc-list__item {
    align-items: flex-start;
}

.sc-list__item > .sc-icon {
    margin-block-start: 2px;
}

.sc-list__item > .e-btn,
.sc-list__item > a.e-btn,
.sc-list__item > .sc-chip,
.sc-list__item > .sc-badge,
.sc-list__item > .sc-ticket,
.sc-list__item > .sc-list__number,
.sc-list__item > .sc-avatar,
.sc-list__item > .sc-list__aside {
    align-self: center;
}

.sc-list__main {
    display: flex;
    flex: 1 1 200px;
    flex-direction: column;
    gap: 0;
    min-width: 0;
}

.sc-list__title {
    margin: 0;
    font-size: var(--sc-font-size-body);
    font-weight: 600;
    line-height: var(--sc-line-body);
}

.sc-list__meta {
    margin: 0;
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-label);
    line-height: var(--sc-line-label);
    font-variant-numeric: tabular-nums;
}

.sc-root a.sc-list__link {
    color: inherit;
    text-decoration: none;
}

.sc-root a.sc-list__link:hover {
    color: var(--sc-color-primary-strong);
}

/* Ticket: a queue number, receipt number or other short code in a small inset tile. */
.sc-ticket,
.sc-list__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    height: 32px;
    padding-inline: var(--sc-space-2);
    flex: none;
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-sm);
    background: var(--sc-color-surface-alt);
    color: var(--sc-color-text);
    font-size: var(--sc-font-size-body);
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
    direction: ltr;
}

/* Facts: a short name over its value, two columns in a side panel. */
.sc-facts,
.sc-definition {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sc-space-2);
    margin: 0;
}

.sc-definition {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: var(--sc-space-4) var(--sc-space-5);
}

.sc-facts > div {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: baseline;
    gap: var(--sc-space-3);
    min-width: 0;
}

.sc-definition > div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sc-facts dt,
.sc-definition dt,
.sc-fact-label {
    color: var(--sc-color-text-subtle);
    font-size: var(--sc-font-size-caption);
    line-height: var(--sc-line-caption);
}

.sc-facts dd,
.sc-definition dd {
    margin: 0;
    font-size: var(--sc-font-size-body);
    font-weight: 500;
    line-height: var(--sc-line-body);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.sc-divider {
    height: 1px;
    flex: none;
    margin: 0;
    border: 0;
    background: var(--sc-color-border);
}

.sc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sc-space-3);
    margin-block-end: var(--sc-space-4);
}

.sc-toolbar__grow {
    flex: 1 1 220px;
    min-width: 0;
}

/* ---------- Queue ---------- */

/* Tablet and desktop: one row per visit in a card; the selected row is on the primary tint with a start edge. */
.sc-queue-list {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    margin-block-end: 0;
    overflow: hidden auto;
}

.sc-queue-row {
    display: flex;
    align-items: center;
    gap: var(--sc-space-4);
    width: 100%;
    min-height: 72px;
    flex: none;
    padding: var(--sc-space-3) var(--sc-space-4);
    border: 0;
    border-inline-start: 4px solid transparent;
    border-block-end: 1px solid var(--sc-color-border);
    background: var(--sc-color-surface);
    color: var(--sc-color-text);
    font-family: inherit;
    text-align: start;
    cursor: pointer;
}

.sc-queue-row:last-child {
    border-block-end: 0;
}

.sc-queue-row:hover {
    background: var(--sc-color-surface-alt);
}

.sc-queue-row[aria-pressed="true"] {
    border-inline-start-color: var(--sc-color-primary);
    background: var(--sc-color-primary-soft);
}

.sc-queue-row:focus-visible {
    outline-offset: -3px;
}

.sc-queue-row__main {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sc-queue-row__name {
    overflow: hidden;
    font-size: var(--sc-font-size-body);
    font-weight: 600;
    line-height: var(--sc-line-body);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-queue-row__meta {
    overflow: hidden;
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-label);
    line-height: var(--sc-line-label);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-queue-row__wait {
    min-width: 96px;
    flex: none;
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-label);
    line-height: var(--sc-line-label);
    font-variant-numeric: tabular-nums;
    text-align: end;
}

/* Phone: one card per visit; a tap opens the patient file. */
.sc-queue-cards {
    display: none;
}

/* A card: the ticket at the start over two rows; the name and the doctor on the first, the status and the wait on the second.
   A button since 28 Nov 2026 (it opens the visit's panel), so the button look is reset. */
.sc-root .sc-queue-card {
    width: 100%;
    font: inherit;
    text-align: start;
    cursor: pointer;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: var(--sc-space-3);
    row-gap: var(--sc-space-2);
    min-height: 76px;
    padding: var(--sc-space-3) 16px;
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-lg);
    background: var(--sc-color-surface);
    color: var(--sc-color-text);
    text-decoration: none;
}

.sc-queue-card .sc-ticket {
    grid-row: 1 / span 2;
    align-self: start;
    min-width: 52px;
}

.sc-queue-card__main {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sc-queue-card__name {
    font-size: var(--sc-font-size-body);
    font-weight: 600;
    line-height: var(--sc-line-body);
}

.sc-queue-card__meta {
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-caption);
    line-height: var(--sc-line-caption);
}

.sc-queue-card__end {
    display: flex;
    grid-column: 2;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sc-space-1) var(--sc-space-3);
}

.sc-queue-card__wait {
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-caption);
    line-height: var(--sc-line-caption);
    font-variant-numeric: tabular-nums;
}

/* Detail panel of the selected visit: who, the alert, the facts, the status, and one clear next action. */
.sc-visit-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: var(--sc-space-4);
    min-height: 0;
    margin-block-end: 0;
    padding: 20px;
    overflow-y: auto;
}

.sc-visit-panel__head {
    display: flex;
    align-items: center;
    gap: var(--sc-space-3);
}

.sc-visit-panel__who {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sc-visit-panel__name {
    font-size: var(--sc-font-size-subtitle);
    font-weight: 600;
    line-height: var(--sc-line-subtitle);
    overflow-wrap: anywhere;
}

.sc-visit-panel__meta {
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-label);
    line-height: var(--sc-line-label);
    font-variant-numeric: tabular-nums;
}

.sc-visit-panel__status {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.sc-visit-panel__spacer {
    flex: 1 1 0;
    min-height: 0;
}

.sc-visit-panel__actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sc-visit-panel__row {
    display: flex;
    gap: 12px;
}

.sc-visit-panel__row > * {
    flex: 1 1 0;
}

/* ---------- Printing settings (More > Printing) ---------- */

.sc-printing > .sc-card__body {
    display: flex;
    flex-direction: column;
    gap: var(--sc-space-5);
}

.sc-printing__group {
    display: flex;
    flex-direction: column;
    gap: var(--sc-space-2);
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.sc-printing__legend {
    float: none;
    width: auto;
    margin-block-end: var(--sc-space-1);
    padding: 0;
    font-size: var(--sc-font-size-body);
    font-weight: 600;
    line-height: var(--sc-line-body);
}

.sc-printing__row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sc-space-5);
}

.sc-printing .sc-form-actions {
    margin-block-start: 0;
}

.sc-printing .sc-field__help {
    margin: 0;
}

/* The queue ticket button of a visit (a thermal slip with the number): beside the row of the list and beside the phone's card. */
.sc-queue-line {
    display: flex;
    flex: none;
    align-items: stretch;
    border-block-end: 1px solid var(--sc-color-border);
    background: var(--sc-color-surface);
}

.sc-queue-line:last-child {
    border-block-end: 0;
}

.sc-queue-line > .sc-queue-row {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    border-block-end: 0;
}

.sc-queue-line__print,
.sc-queue-cardline__print {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: var(--sc-touch);
    border: 0;
    background: transparent;
    color: var(--sc-color-primary-strong, var(--sc-color-primary));
    cursor: pointer;
}

.sc-queue-line__print:hover:not(:disabled),
.sc-queue-cardline__print:hover:not(:disabled) {
    background: var(--sc-color-surface-alt);
}

.sc-queue-line__print:focus-visible,
.sc-queue-cardline__print:focus-visible {
    outline-offset: -3px;
}

.sc-queue-line__print:disabled,
.sc-queue-cardline__print:disabled {
    color: var(--sc-color-text-muted);
    cursor: default;
}

.sc-queue-line:has(.sc-queue-row[aria-pressed="true"]) .sc-queue-line__print {
    background: var(--sc-color-primary-soft);
}

.sc-queue-cardline {
    display: flex;
    align-items: stretch;
    gap: var(--sc-space-2);
}

.sc-queue-cardline > .sc-queue-card {
    flex: 1 1 auto;
    min-width: 0;
}

.sc-queue-cardline__print {
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-lg);
    background: var(--sc-color-surface);
}

.sc-queue__print-message {
    margin-block: var(--sc-space-2);
}

/* Portrait tablet and phone: no room for the list and the panel side by side, so the queue is the card list. */
@media (max-width: 1023.98px) {
    .sc-queue.sc-page--fill {
        display: block;
        height: auto;
    }

    .sc-queue-list,
    .sc-queue .sc-split__aside {
        display: none;
    }

    .sc-queue-cards {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    /* The visit's panel over the whole screen, above the bottom bar, after a tap on a card. */
    .sc-queue .sc-split__aside.sc-queue-sheet--open {
        display: flex;
        flex-direction: column;
        gap: var(--sc-space-3);
        position: fixed;
        inset: 0;
        width: auto;
        z-index: 1100;
        overflow-y: auto;
        padding: var(--sc-space-4) 16px calc(var(--sc-space-4) + env(safe-area-inset-bottom, 0px));
        background: var(--sc-color-bg);
    }

    /* One scroll for the whole sheet, not a second one inside the panel. */
    .sc-queue .sc-queue-sheet--open > .sc-card {
        flex: none;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .sc-queue .sc-queue-sheet__back {
        display: inline-flex;
        align-items: center;
        gap: var(--sc-space-2);
        align-self: flex-start;
        min-height: 44px;
        text-decoration: none;
        font-weight: 600;
    }
}

/* On a wide screen the panel is always beside the list: nothing to close. */
.sc-queue-sheet__back {
    display: none;
}

/* ---------- Patient file ---------- */

/* Header band of a patient: full width under the top bar, on the surface colour, ending in the section tabs. */
.sc-patient-header {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-block: calc(-1 * var(--sc-main-pad-block)) 20px;
    margin-inline: calc(-1 * var(--sc-main-pad-inline));
    padding: var(--sc-space-4) var(--sc-main-pad-inline) 0;
    background: var(--sc-color-surface);
    border-block-end: 1px solid var(--sc-color-border);
}

.sc-patient-header__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sc-space-4);
}

.sc-patient-header__identity {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.sc-patient-header__who {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sc-patient-header__names {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: var(--sc-space-3);
}

.sc-patient-header__name {
    margin: 0;
    font-size: var(--sc-font-size-title);
    font-weight: 600;
    line-height: var(--sc-line-title);
}

.sc-patient-header__other-name {
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-subtitle);
    line-height: var(--sc-line-title);
}

.sc-patient-header__meta {
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-label);
    line-height: var(--sc-line-label);
    font-variant-numeric: tabular-nums;
}

.sc-patient-header__actions {
    display: flex;
    flex: none;
    align-items: center;
    gap: 12px;
}

/* Visit timeline: date at the start, a dot on a line, then what happened. Newest first. */
.sc-timeline {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sc-timeline__item {
    display: flex;
    gap: var(--sc-space-4);
}

.sc-timeline__date {
    width: 88px;
    flex: none;
    padding-block-start: 4px;
    text-align: end;
    font-variant-numeric: tabular-nums;
}

/* Arabic month names are not abbreviated: the date column is wider. */
[lang="ar"] .sc-timeline__date {
    width: 124px;
}

.sc-timeline__day {
    display: block;
    font-size: var(--sc-font-size-body-sm);
    font-weight: 600;
    line-height: var(--sc-line-body-sm);
}

.sc-timeline__year {
    display: block;
    color: var(--sc-color-text-subtle);
    font-size: var(--sc-font-size-caption);
    line-height: var(--sc-line-caption);
}

.sc-timeline__rail {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    width: 16px;
}

.sc-timeline__dot {
    width: 12px;
    height: 12px;
    flex: none;
    margin-block-start: 8px;
    border: 2px solid var(--sc-color-primary);
    border-radius: var(--sc-radius-pill);
    background: var(--sc-color-surface);
}

.sc-timeline__item:first-child .sc-timeline__dot {
    background: var(--sc-color-primary);
}

.sc-timeline__line {
    width: 2px;
    flex: 1 1 auto;
    margin-block-start: 4px;
    background: var(--sc-color-border);
}

.sc-timeline__item:last-child .sc-timeline__line {
    background: transparent;
}

.sc-timeline__body {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    padding-block-end: 20px;
}

.sc-timeline__item:last-child .sc-timeline__body {
    padding-block-end: 0;
}

.sc-timeline__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.sc-timeline__title,
.sc-root a.sc-timeline__title {
    color: var(--sc-color-text);
    font-size: var(--sc-font-size-body);
    font-weight: 600;
    line-height: var(--sc-line-body);
    text-decoration: none;
}

.sc-root a.sc-timeline__title:hover {
    color: var(--sc-color-primary-strong);
}

.sc-timeline__who {
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-label);
    line-height: var(--sc-line-label);
}

.sc-timeline__note {
    font-size: var(--sc-font-size-body-sm);
    line-height: var(--sc-line-body-sm);
}

/* Vitals: one inset tile per measurement, the value large and tabular. */
.sc-vitals {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sc-space-3);
}

.sc-vital {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px var(--sc-space-3);
    border-radius: var(--sc-radius-md);
    background: var(--sc-color-surface-alt);
}

.sc-vital__label {
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-caption);
    line-height: var(--sc-line-caption);
}

.sc-vital__reading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 8px;
}

.sc-vital__value {
    font-size: var(--sc-font-size-title);
    font-weight: 600;
    line-height: var(--sc-line-title);
    font-variant-numeric: tabular-nums;
    direction: ltr;
    unicode-bidi: isolate;
}

.sc-vital__unit {
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-caption);
    line-height: var(--sc-line-caption);
}

/* Rows inside a side card (medication): a line above each row, name over detail. */
.sc-rows {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sc-rows__item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-block: var(--sc-space-2);
    border-block-start: 1px solid var(--sc-color-border);
}

.sc-rows__item:last-child {
    padding-block-end: 0;
}

.sc-rows__title {
    font-size: var(--sc-font-size-body-sm);
    font-weight: 600;
    line-height: var(--sc-line-body-sm);
}

.sc-rows__meta {
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-label);
    line-height: var(--sc-line-label);
    font-variant-numeric: tabular-nums;
}

.sc-card__stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (max-width: 767.98px) {
    .sc-patient-header__row {
        flex-direction: column;
        align-items: stretch;
        gap: var(--sc-space-3);
    }

    .sc-patient-header__actions {
        flex-wrap: wrap;
    }

    .sc-root .sc-patient-header__actions > .e-btn.e-primary {
        order: 1;
        width: 100%;
    }

    .sc-timeline__date {
        width: 64px;
    }

    .sc-card--main > .sc-card__header {
        padding: 20px 16px 0;
    }

    .sc-card--main > .sc-card__body {
        padding: 16px 16px 20px;
    }
}

/* ---------- States ---------- */

.sc-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sc-space-2);
    padding: var(--sc-space-7) var(--sc-space-4);
    text-align: center;
}

.sc-card .sc-state {
    padding-block: var(--sc-space-5);
}

.sc-state__icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    margin-block-end: var(--sc-space-2);
    border-radius: var(--sc-radius-pill);
    background: var(--sc-color-neutral-soft);
    color: var(--sc-color-neutral);
}

.sc-state--error .sc-state__icon {
    background: var(--sc-color-danger-soft);
    color: var(--sc-color-danger);
}

.sc-state--offline .sc-state__icon {
    background: var(--sc-color-warning-soft);
    color: var(--sc-color-warning);
}

.sc-state__title {
    margin: 0;
    font-size: var(--sc-font-size-subtitle);
    font-weight: 600;
    line-height: var(--sc-line-subtitle);
}

.sc-state__message,
.sc-state__hint {
    max-width: 46ch;
    margin: 0;
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-body-sm);
    line-height: var(--sc-line-body-sm);
}

.sc-state__hint {
    font-size: var(--sc-font-size-label);
    line-height: var(--sc-line-label);
}

.sc-state__actions {
    margin-block-start: var(--sc-space-3);
}

.sc-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--sc-color-border);
    border-block-start-color: var(--sc-color-primary);
    border-radius: 50%;
    animation: sc-spin 0.9s linear infinite;
}

@keyframes sc-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Nothing moves for a person who asked for less motion: the spinner turns slowly, every transition is instant. */
@media (prefers-reduced-motion: reduce) {
    .sc-spinner {
        animation-duration: 3s;
    }

    .sc-root *,
    .sc-root *::before,
    .sc-root *::after {
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Forms ---------- */

.sc-form-section {
    min-width: 0;
    max-width: 960px;
    margin: 0 0 var(--sc-space-5);
    padding: 0;
    border: 0;
}

.sc-form-section__title {
    padding: 0;
    margin-block-end: var(--sc-space-2);
    font-size: var(--sc-font-size-subtitle);
    font-weight: 600;
    line-height: var(--sc-line-subtitle);
}

.sc-form-section__description {
    margin: 0 0 var(--sc-space-3);
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-label);
    line-height: var(--sc-line-label);
}

.sc-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

@media (min-width: 768px) {
    .sc-form-grid--2,
    .sc-form-grid--3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .sc-form-grid--3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.sc-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.sc-field--wide {
    grid-column: 1 / -1;
}

.sc-field__label {
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-label);
    font-weight: 500;
    line-height: var(--sc-line-label);
}

.sc-required {
    color: var(--sc-color-danger);
}

.sc-field__static {
    margin: 0;
    min-height: var(--sc-control-height, 48px);
    display: flex;
    align-items: center;
    font-weight: 500;
}

.sc-checks {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sc-space-4);
    padding-block: var(--sc-space-2);
}

.sc-field__help {
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-caption);
    line-height: var(--sc-line-caption);
}

.sc-field__error,
.sc-field__error .validation-message {
    color: var(--sc-color-danger);
    font-size: var(--sc-font-size-caption);
    font-weight: 500;
    line-height: var(--sc-line-caption);
}

/*
  Native text field: 48 px high, 10 px corners. Focus is a 2 px primary border; an error a 2 px red one. Only the inputs the
  design keeps native use it (the date input, the language rows of MultiLanguageInput); every other text field is a Syncfusion
  text box, restyled in spitalco-syncfusion.css.
*/
.sc-input {
    width: 100%;
    height: var(--sc-control-height);
    padding: 0 16px;
    border: 1px solid var(--sc-color-border-strong);
    border-radius: var(--sc-radius-md);
    background: var(--sc-color-surface);
    color: var(--sc-color-text);
    font-family: inherit;
    font-size: var(--sc-font-size-body);
    line-height: var(--sc-line-body);
    font-variant-numeric: tabular-nums;
}

.sc-input::placeholder {
    color: var(--sc-color-text-subtle);
    opacity: 1;
}

.sc-root .sc-input:focus,
.sc-root .sc-input:focus-visible {
    border-color: var(--sc-color-primary);
    box-shadow: inset 0 0 0 1px var(--sc-color-primary);
    outline: none;
}

.sc-input:disabled {
    border-color: var(--sc-color-border);
    background: var(--sc-color-disabled-bg);
    color: var(--sc-color-disabled-text);
}

.sc-field--invalid .sc-input,
.sc-root .sc-field--invalid .sc-input:focus {
    border-color: var(--sc-color-danger);
    box-shadow: inset 0 0 0 1px var(--sc-color-danger);
}

.sc-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sc-space-3);
    margin-block-start: var(--sc-space-4);
}

/*
  Multi-language input: one bordered group, one row per language, a language tag at the start of each row.
  The group is the control: it carries the border, the focus and the error state.
*/
.sc-mli__rows {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--sc-color-border-strong);
    border-radius: var(--sc-radius-md);
    background: var(--sc-color-surface);
    overflow: hidden;
}

.sc-mli__row {
    display: flex;
    align-items: center;
    height: 46px;
}

.sc-mli__row + .sc-mli__row {
    border-block-start: 1px solid var(--sc-color-border);
}

.sc-mli__lang {
    display: grid;
    place-items: center;
    align-self: stretch;
    width: 44px;
    flex: none;
    border-inline-end: 1px solid var(--sc-color-border);
    color: var(--sc-color-text-muted);
    font-family: var(--sc-font-family);
    font-size: var(--sc-font-size-caption);
    font-weight: 600;
    line-height: var(--sc-line-caption);
    text-align: center;
}

.sc-mli__rows .sc-mli__input {
    flex: 1 1 0;
    min-width: 0;
    height: 46px;
    padding: 0 var(--sc-space-3);
    border: 0;
    border-radius: 0;
    background: var(--sc-color-surface);
}

/* Focus: the group takes the 2 px primary border, and the tag of the row being typed in turns primary. */
.sc-root .sc-mli__rows .sc-mli__input:focus,
.sc-root .sc-mli__rows .sc-mli__input:focus-visible {
    box-shadow: none;
    outline: none;
}

.sc-mli__rows:focus-within {
    border-color: var(--sc-color-primary);
    box-shadow: 0 0 0 1px var(--sc-color-primary);
}

.sc-mli__row:focus-within .sc-mli__lang {
    background: var(--sc-color-primary-soft);
    color: var(--sc-color-primary-strong);
}

.sc-field--invalid .sc-mli__rows {
    border-color: var(--sc-color-danger);
    box-shadow: 0 0 0 1px var(--sc-color-danger);
}

.sc-field--invalid .sc-mli__rows .sc-mli__input {
    box-shadow: none;
}

/* ---------- Sign-in and unlock gate ---------- */

/* Syncfusion's theme colours a flat button with a long :not() chain (grey, 4.7:1 on white and 3.2:1 on the dark surface): this repeats the chain, so that the gate's
   quiet buttons ("Sign out", "Later") use the accent text of the theme. */
.sc-root .sc-gate .e-btn.e-flat:not([disabled]):not(.e-success):not(.e-danger):not(.e-warning):not(.e-info) {
    color: var(--sc-color-primary-strong);
}

.sc-root .sc-gate .e-btn.e-flat:not([disabled]):not(.e-success):not(.e-danger):not(.e-warning):not(.e-info):hover,
.sc-root .sc-gate .e-btn.e-flat:not([disabled]):not(.e-success):not(.e-danger):not(.e-warning):not(.e-info):focus {
    background: var(--sc-color-primary-soft);
    color: var(--sc-color-primary-strong);
}

.sc-gate {
    display: grid;
    place-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: calc(var(--sc-space-4) + env(safe-area-inset-top, 0px)) var(--sc-space-4) calc(var(--sc-space-4) + env(safe-area-inset-bottom, 0px));
    /* Brand guidelines, "Launch": the navy ground with the wave motif behind the white card (sign-in, unlock, clinic choice). */
    background: var(--sc-brand-navy) url("../brand/spitalco-cover-wave.svg") center bottom / cover no-repeat;
}

.sc-gate__card {
    display: flex;
    flex-direction: column;
    gap: var(--sc-space-4);
    width: min(100%, 420px);
    padding: var(--sc-space-5);
    background: var(--sc-color-surface);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-lg);
}

.sc-gate__brand {
    display: flex;
    align-items: center;
    gap: var(--sc-space-3);
    font-size: var(--sc-font-size-subtitle);
    font-weight: 600;
}

.sc-gate__brand .sc-brand-mark {
    width: 40px;
    height: 40px;
    border-radius: var(--sc-radius-md);
}

.sc-gate__title {
    margin: 0;
    font-size: var(--sc-font-size-title);
    font-weight: 600;
    line-height: var(--sc-line-title);
}

.sc-gate__message,
.sc-gate__note,
.sc-gate__warning,
.sc-gate__error {
    margin: 0;
}

.sc-gate__title + .sc-gate__message {
    margin-block-start: calc(-1 * var(--sc-space-3));
}

.sc-gate__message {
    color: var(--sc-color-text-muted);
}

.sc-gate__note {
    padding: var(--sc-space-3) var(--sc-space-4);
    border-radius: var(--sc-radius-md);
    background: var(--sc-color-neutral-soft);
    color: var(--sc-color-neutral);
    font-size: var(--sc-font-size-label);
    font-weight: 500;
    line-height: var(--sc-line-label);
}

.sc-gate__warning {
    display: flex;
    align-items: center;
    gap: var(--sc-space-2);
    padding: var(--sc-space-3) var(--sc-space-4);
    border-radius: var(--sc-radius-md);
    background: var(--sc-color-warning-soft);
    color: var(--sc-color-warning);
    font-size: var(--sc-font-size-label);
    font-weight: 500;
    line-height: var(--sc-line-label);
}

.sc-gate__error {
    color: var(--sc-color-danger);
    font-size: var(--sc-font-size-label);
    font-weight: 500;
    line-height: var(--sc-line-label);
}

.sc-root .sc-gate__button.e-btn {
    width: 100%;
}

.sc-clinic-list {
    display: flex;
    flex-direction: column;
    gap: var(--sc-space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.sc-clinic-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sc-space-3);
    padding: var(--sc-space-3) var(--sc-space-4);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-md);
}

.sc-clinic-list__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sc-clinic-list__name {
    font-weight: 600;
    overflow-wrap: anywhere;
}

.sc-clinic-list__roles,
.sc-clinic-list__hint {
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-label);
    line-height: var(--sc-line-label);
}

.sc-gate__language {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sc-space-3);
    padding-block-start: var(--sc-space-4);
    border-block-start: 1px solid var(--sc-color-border);
}

/* ---------- Clinic: steps of a record (appointment, lab order, dispensary) ----------
   Built from existing tokens and parts (not drawn in the artboards): a card with a row of buttons, a plain results table,
   and small chips next to a name. */

.sc-appt-actions,
.sc-lab-steps,
.sc-lab-test {
    margin-block-end: var(--sc-space-4);
}

.sc-appt-actions__head,
.sc-dispensary-rx__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sc-space-3);
    margin-block-end: var(--sc-space-3);
}

.sc-appt-actions__who {
    flex: 1 1 auto;
    min-width: 0;
}

.sc-appt-actions__name,
.sc-dispensary-rx__patient {
    font-size: var(--sc-font-size-md);
    font-weight: 600;
    color: var(--sc-color-text);
}

.sc-appt-actions__meta {
    font-size: var(--sc-font-size-sm);
    color: var(--sc-color-text-muted);
}

.sc-appt-actions__steps,
.sc-lab-steps__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sc-space-2);
    margin-block: var(--sc-space-3);
}

.sc-appt-actions__cancel,
.sc-lab-steps__reject,
.sc-dispensary-find {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--sc-space-3);
}

.sc-appt-actions__cancel > .sc-field,
.sc-lab-steps__reject > .sc-field,
.sc-dispensary-find > .sc-field {
    flex: 1 1 240px;
}

.sc-lab-results {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--sc-font-size-body-sm);
}

.sc-lab-results th,
.sc-lab-results td {
    padding-block: var(--sc-space-2);
    padding-inline: var(--sc-space-2);
    text-align: start;
    vertical-align: middle;
    border-block-end: 1px solid var(--sc-color-border-subtle);
}

.sc-lab-results th {
    font-size: var(--sc-font-size-label);
    font-weight: 600;
    color: var(--sc-color-text-muted);
}

.sc-lab-results td .sc-chip {
    margin-inline-start: var(--sc-space-2);
}

.sc-lab-results__row--critical td {
    background: var(--sc-color-danger-soft);
}

.sc-lab-row__flag {
    margin-inline-start: var(--sc-space-2);
}

.sc-lab-entry {
    margin-block-start: var(--sc-space-4);
    padding-block-start: var(--sc-space-4);
    border-block-start: 1px solid var(--sc-color-border);
}

.sc-lab-entry__critical {
    display: flex;
    align-items: center;
    gap: var(--sc-space-2);
    margin-block: var(--sc-space-2) var(--sc-space-4);
}

.sc-dispensary-rx {
    margin-block-start: var(--sc-space-4);
}

@media (max-width: 767.98px) {
    .sc-lab-results {
        font-size: var(--sc-font-size-caption);
    }
}


/* ---------- Cash desk, identity, shifts, facility profile (19 Nov 2026) ---------- */

.sc-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sc-space-2);
    margin-block-start: var(--sc-space-3);
}

.sc-desk-panel {
    margin-block-start: var(--sc-space-4);
}

.sc-desk-panel > .sc-card + .sc-card,
.sc-desk-panel .sc-card + .sc-card {
    margin-block-start: var(--sc-space-4);
}

/* A receipt or invoice as printed: the server's text, kept exactly as it was rendered. */
.sc-print-view__text {
    margin: 0;
    padding: var(--sc-space-3);
    background: var(--sc-color-surface-alt);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-sm);
    font-family: var(--sc-font-family);
    font-size: var(--sc-font-size-label);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    text-align: start;
}

/* A name that selects an item of a list: looks like a link, is a button. */
.sc-link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--sc-color-primary-strong);
    font: inherit;
    text-align: start;
    text-decoration: underline;
    cursor: pointer;
}

.sc-list__item--selected {
    background: var(--sc-color-primary-soft);
}

.sc-invoice-totals {
    margin-block-start: var(--sc-space-4);
}

.sc-hours__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: var(--sc-space-3);
    padding-block: var(--sc-space-2);
    border-block-end: 1px solid var(--sc-color-border);
}

.sc-hours__row > .sc-field {
    flex: 1 1 140px;
}

.sc-modules {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sc-space-2);
}

/* ---------- Clinic registration (ClinicRegistrationFlow) ---------- */

.sc-gate__card--wide {
    width: min(100%, 760px);
}

.sc-reg {
    display: flex;
    flex-direction: column;
    gap: var(--sc-space-4);
}

.sc-reg__section {
    display: flex;
    flex-direction: column;
    gap: var(--sc-space-3);
}

.sc-reg__title {
    font-size: var(--sc-font-size-subtitle);
    font-weight: var(--sc-font-weight-h3);
    line-height: var(--sc-line-subtitle);
}

.sc-reg__text,
.sc-reg__state-text,
.sc-reg__note {
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-label);
    line-height: var(--sc-line-label);
}

.sc-reg__list {
    display: flex;
    flex-direction: column;
    gap: var(--sc-space-2);
    margin: 0;
    padding: 0;
    list-style: none;
}

.sc-reg__item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sc-space-3);
    padding: var(--sc-space-3) var(--sc-space-4);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-md);
    background: var(--sc-color-surface);
}

.sc-reg__item-text {
    display: flex;
    flex: 1 1 220px;
    flex-direction: column;
    min-width: 0;
}

.sc-reg__name {
    font-weight: 600;
}

.sc-reg__identifier {
    color: var(--sc-color-text-subtle);
    font-size: var(--sc-font-size-caption);
}

.sc-reg__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sc-space-2);
}

.sc-reg__form {
    display: flex;
    flex-direction: column;
    gap: var(--sc-space-4);
}

.sc-reg__hint {
    margin-block-start: var(--sc-space-1);
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-caption);
    line-height: var(--sc-line-caption);
}

.sc-reg__checks {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sc-space-4);
}

.sc-reg__check {
    display: inline-flex;
    align-items: center;
    gap: var(--sc-space-2);
    min-height: var(--sc-touch);
}

/* ---------- Sign-in security (AccountSecurityPanel) ---------- */

.sc-security {
    display: flex;
    flex-direction: column;
    gap: var(--sc-space-4);
    max-width: 820px;
}

.sc-security__options {
    display: flex;
    flex-direction: column;
    gap: var(--sc-space-3);
    margin: 0;
    padding: 0;
    list-style: none;
}

.sc-security__option {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: var(--sc-space-4);
    padding: var(--sc-space-4);
    border: 1px solid var(--sc-color-border);
    border-radius: var(--sc-radius-lg);
    background: var(--sc-color-surface);
}

.sc-security__icon {
    color: var(--sc-color-primary);
}

.sc-security__text {
    display: flex;
    flex: 1 1 260px;
    flex-direction: column;
    gap: var(--sc-space-1);
    color: var(--sc-color-text-muted);
}

.sc-security__title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--sc-space-2);
    color: var(--sc-color-text);
    font-size: var(--sc-font-size-subtitle);
    font-weight: var(--sc-font-weight-h3);
    line-height: var(--sc-line-subtitle);
}

.sc-security__action {
    align-self: center;
}

.sc-security__clinics {
    margin: var(--sc-space-1) 0 0;
    padding-inline-start: var(--sc-space-5);
}

.sc-security__note {
    color: var(--sc-color-text-muted);
    font-size: var(--sc-font-size-label);
}

/* The gate's own loading state sits on the navy ground: light text (10.98:1). */
.sc-gate > .sc-state,
.sc-gate > .sc-state .sc-state__message {
    color: var(--sc-color-on-dark-muted);
}

/* ========== Clinic screens, second round (19 Nov 2026): front desk, clinical, lab and dispensary. Appended in one block by clinic agent A. ========== */
/* Front desk (19 Nov 2026): booking on a doctor's slots, triage values, referral. */
.sc-booking {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-3);
}

.sc-booking__slots {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sc-space-2);
}

.sc-booking__slot {
  font-variant-numeric: tabular-nums;
}

.sc-booking__taken {
  color: var(--sc-color-text-muted);
}

.sc-triage,
.sc-referral {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-2);
}

.sc-triage__values {
  font-variant-numeric: tabular-nums;
}

/* Clinical area: chart, prescriptions, lab orders from the encounter, clinical history (19 Nov 2026). Tokens and logical properties only. */
.sc-chart__section,
.sc-chart__form,
.sc-rx__form,
.sc-lab-ordering__form {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-3);
  padding-block: var(--sc-space-3);
}

.sc-chart__form,
.sc-rx__form,
.sc-lab-ordering__form {
  border-block-start: 1px solid var(--sc-color-border);
}

.sc-chart__diagnosis,
.sc-rx__line {
  margin: 0;
  padding: var(--sc-space-3);
  border: 1px solid var(--sc-color-border);
  border-radius: var(--sc-radius-md);
}

.sc-chart__steps,
.sc-rx__steps {
  flex-wrap: wrap;
  gap: var(--sc-space-2);
}

.sc-chart__versions {
  margin-block-start: var(--sc-space-2);
  padding-inline-start: var(--sc-space-4);
}

.sc-refusal__code {
  color: var(--sc-color-text-muted);
}

/* Lab and dispensary desk (LabDispensary area, 19 Nov 2026): the actions cell of a result row, the inbox, a dispensing act. */
.sc-lab-result-actions,
.sc-lab-inbox__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sc-space-2);
}

.sc-lab-critical-ack,
.sc-lab-amended {
  display: block;
  inline-size: 100%;
}

.sc-lab-amend,
.sc-lab-history,
.sc-lab-cancel {
  margin-block-start: var(--sc-space-4);
}

.sc-dispense-sub {
  margin-block-start: var(--sc-space-2);
}

.sc-dispense-open {
  margin-block-start: var(--sc-space-3);
}
/* ========== end of the clinic second-round block ========== */

/* ========== Patient app: record steps, sharing, erasure, family (20 Nov 2026) ========== */
/* A panel opened under one row of a list (privacy class of an item, a family member's records). Logical properties only (RTL). */
.sc-list__panel {
  padding-block: var(--sc-space-3);
  padding-inline-start: var(--sc-space-4);
  border-block-end: 1px solid var(--sc-color-border);
  border-inline-start: 3px solid var(--sc-color-primary);
  background: var(--sc-color-surface-alt);
}

.sc-records__panel,
.sc-records__add,
.sc-sharing__grant,
.sc-sharing__send,
.sc-erasure {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-3);
}

.sc-sharing__categories,
.sc-sharing__items {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-2);
}

/* The consent text the patient agrees to: set apart, never hidden behind a link (SRS 8C). */
.sc-consent-text {
  padding: var(--sc-space-3) var(--sc-space-4);
  border: 1px solid var(--sc-color-border);
  border-inline-start: 3px solid var(--sc-color-primary);
  border-radius: var(--sc-radius-md);
  background: var(--sc-color-primary-soft);
  color: var(--sc-color-text);
}

.sc-consent-text p {
  margin: 0;
}

.sc-consent-text p + p {
  margin-block-start: var(--sc-space-2);
}

/* The separate confirmation of sensitive records reads as a warning, with its text (not colour alone). */
.sc-sharing__confirm {
  padding: var(--sc-space-2) var(--sc-space-3);
  border-radius: var(--sc-radius-md);
  background: var(--sc-color-warning-soft);
}

.sc-family__record-list {
  margin: 0;
}

.sc-family__record {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-block: var(--sc-space-2);
}
/* ========== end of the patient app block ========== */

/* ========== Patient app, third batch (20 Nov 2026): directory, files, opened item, family codes, health card, export ========== */
/* Tokens only; logical properties only (the layout mirrors in right-to-left). */

/* Choosing a clinic: the chosen clinic, the clinics the patient knows, the search results. */
.sc-recipient {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-3);
}

.sc-recipient__chosen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sc-space-3);
  padding: var(--sc-space-3) var(--sc-space-4);
  border: 1px solid var(--sc-color-border);
  border-inline-start: 3px solid var(--sc-color-primary);
  border-radius: var(--sc-radius-md);
  background: var(--sc-color-primary-soft);
}

.sc-recipient__known {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sc-space-2);
}

.sc-recipient__known > .sc-field__label {
  flex: 1 0 100%;
}

.sc-recipient__results {
  margin: 0;
}

/* A photo or PDF chosen and not sent yet. */
.sc-files__picked,
.sc-item__file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sc-space-3);
  padding: var(--sc-space-3) var(--sc-space-4);
  border: 1px solid var(--sc-color-border);
  border-radius: var(--sc-radius-md);
  background: var(--sc-color-surface-alt);
}

.sc-files__add {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-3);
}

/* The consent text changed after the screen was opened: said next to the new text. */
.sc-consent-text__updated {
  margin-block-start: var(--sc-space-2);
  color: var(--sc-color-warning);
  font-weight: 600;
}

/* An opened item: the meta line, the chips, and the readable parts of a note in the patient's own order. */
.sc-item__meta {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-2);
}

.sc-item__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sc-space-2);
}

.sc-item__sections {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-4);
}

.sc-item__section-title {
  margin: 0 0 var(--sc-space-1);
  color: var(--sc-color-primary-strong);
  font-size: var(--sc-font-size-subtitle);
  font-weight: var(--sc-font-weight-h3);
  line-height: var(--sc-line-subtitle);
}

.sc-item__section-text {
  margin: 0;
  font-size: var(--sc-font-size-body);
  line-height: var(--sc-line-body);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Family codes: the code is shown ONCE, large and clear. */
.sc-family__codes,
.sc-family__enter,
.sc-export,
.sc-card-form {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-3);
}

.sc-family__codes-title {
  margin: var(--sc-space-3) 0 0;
  font-size: var(--sc-font-size-subtitle);
  font-weight: var(--sc-font-weight-h3);
}

.sc-invite-code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sc-space-2);
  padding: var(--sc-space-5) var(--sc-space-4);
  border: 2px solid var(--sc-color-primary);
  border-radius: var(--sc-radius-lg);
  background: var(--sc-color-primary-soft);
  text-align: center;
}

.sc-invite-code__label,
.sc-invite-code__valid,
.sc-invite-code__once {
  margin: 0;
  color: var(--sc-color-primary-strong);
  font-size: var(--sc-font-size-body);
  line-height: var(--sc-line-body);
}

.sc-invite-code__once {
  font-weight: 600;
}

.sc-invite-code__value {
  margin: 0;
  color: var(--sc-color-text);
  font-size: 44px;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  user-select: all;
}

.sc-invite-code .sc-form-actions {
  justify-content: center;
}

.sc-family__accepted {
  margin: 0;
  padding: var(--sc-space-3) var(--sc-space-4);
  border-radius: var(--sc-radius-md);
  background: var(--sc-color-success-soft);
  color: var(--sc-color-success);
  font-weight: 600;
}

/* The profile's large tiles: what a patient with little technology knowledge looks for, one tap away. */
.sc-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sc-space-3);
}

.sc-root a.sc-tile {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-2);
  min-height: 120px;
  padding: var(--sc-space-4);
  border: 1px solid var(--sc-color-border);
  border-radius: var(--sc-radius-lg);
  background: var(--sc-color-surface);
  color: var(--sc-color-text);
  text-decoration: none;
}

.sc-root a.sc-tile:hover {
  border-color: var(--sc-color-primary);
  background: var(--sc-color-primary-soft);
}

.sc-tile > .sc-icon {
  color: var(--sc-color-primary);
}

.sc-tile__title {
  font-size: var(--sc-font-size-subtitle);
  font-weight: 600;
  line-height: var(--sc-line-subtitle);
}

.sc-tile__text {
  color: var(--sc-color-text-muted);
  font-size: var(--sc-font-size-body-sm);
  line-height: var(--sc-line-body-sm);
}

/* Download my record. */
.sc-export__lead {
  margin: 0;
  font-weight: 600;
}

.sc-export__list {
  margin: 0;
  padding-inline-start: var(--sc-space-5);
}

.sc-export__done {
  margin: 0;
  color: var(--sc-color-success);
  font-weight: 600;
}

/* "Show to a doctor": the health card full screen, very large type, white on the brand navy (16.8:1), no editing controls. */
.sc-card-show {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-5);
  padding: var(--sc-space-5);
  overflow-y: auto;
  background: var(--sc-color-dark-bg);
  color: var(--sc-color-on-dark);
}

.sc-card-show__stated {
  margin: 0;
  color: var(--sc-color-on-dark-muted);
  font-size: var(--sc-font-size-body);
  line-height: var(--sc-line-body);
}

.sc-card-show__block {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-1);
  padding-block-end: var(--sc-space-4);
  border-block-end: 1px solid var(--sc-color-dark-border);
}

.sc-card-show__label {
  margin: 0;
  color: var(--sc-color-on-dark-accent);
  font-size: var(--sc-font-size-title);
  font-weight: var(--sc-font-weight-h2);
  line-height: var(--sc-line-title);
}

.sc-card-show__blood {
  margin: 0;
  font-size: 96px;
  font-weight: 600;
  line-height: 1.1;
}

.sc-card-show__text {
  margin: 0;
  font-size: 36px;
  font-weight: 600;
  line-height: 1.3;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.sc-card-show__phone {
  display: block;
  font-variant-numeric: tabular-nums;
}

.sc-card-show__loading,
.sc-card-show__error {
  margin: 0;
  font-size: var(--sc-font-size-title);
}

.sc-root a.e-btn.sc-card-show__close,
.sc-root .e-btn.sc-card-show__retry {
  align-self: flex-start;
  min-height: 56px;
  padding-inline: var(--sc-space-6);
  border-color: var(--sc-color-on-dark);
  background: var(--sc-color-on-dark);
  color: var(--sc-color-dark-bg);
  font-size: var(--sc-font-size-subtitle);
  font-weight: 600;
}

.sc-root a.e-btn.sc-card-show__close:hover,
.sc-root a.e-btn.sc-card-show__close:focus,
.sc-root .e-btn.sc-card-show__retry:hover,
.sc-root .e-btn.sc-card-show__retry:focus {
  border-color: var(--sc-color-on-dark-accent);
  background: var(--sc-color-on-dark-accent);
  color: var(--sc-color-dark-bg);
}

@media (max-width: 767.98px) {
  .sc-card-show__blood {
    font-size: 80px;
  }

  .sc-card-show__text {
    font-size: 30px;
  }

  .sc-invite-code__value {
    font-size: 36px;
  }
}

/* A code is read out and typed: it must never break across two lines, even inside a card inside a panel on a 360 px phone (21 Nov 2026). */
.sc-invite-code__value {
  white-space: nowrap;
}

@media (max-width: 400px) {
  .sc-invite-code__value {
    font-size: 30px;
    letter-spacing: 0.08em;
  }
}

/* ========== The staff page and invitation codes (28 Nov 2026): adding a staff member, the code shown once, "I have an invitation code" ========== */
/* Tokens only; logical properties only. A staff invitation code is 43 letters and digits: it is copied and pasted, not read out, so it is smaller and may
   wrap anywhere (the short codes above never break). */
.sc-invite-code__value.sc-invite-code__value--long {
  max-width: 100%;
  font-size: var(--sc-font-size-subtitle);
  letter-spacing: 0.02em;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
}

.sc-invite-form {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-3);
}

.sc-invite-roles,
.sc-invite-channel {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.sc-invite-role {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-1);
  padding-block: var(--sc-space-2);
}

.sc-invite-role__help {
  margin: 0;
  padding-inline-start: var(--sc-space-6);
}

.sc-invite-form__again {
  margin: 0;
  font-weight: 600;
}

.sc-invite-result {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-3);
}

.sc-invite-result__steps {
  margin: 0;
  padding-inline-start: var(--sc-space-5);
  line-height: var(--sc-line-body);
}

.sc-invite-result__steps li + li {
  margin-block-start: var(--sc-space-2);
}

.sc-invite-result__sent {
  margin: 0;
}

.sc-staff__intro {
  margin: 0;
  color: var(--sc-color-text-muted);
}

.sc-staff__notice {
  margin-block: 0 var(--sc-space-3);
  padding: var(--sc-space-3) var(--sc-space-4);
  border-radius: var(--sc-radius-md);
  background: var(--sc-color-success-soft);
  color: var(--sc-color-text);
}

.sc-staff-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sc-space-2);
}

.sc-staff-invitations {
  margin-block-start: var(--sc-space-4);
}

.sc-staff-invitation {
  flex-wrap: wrap;
  align-items: flex-start;
}

.sc-staff-invitation__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sc-space-2);
}

.sc-staff-invitation__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sc-space-2);
}

/* "I have an invitation code" on the clinic choice. */
.sc-invite-accept {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-2);
  padding-block-start: var(--sc-space-3);
  border-block-start: 1px solid var(--sc-color-border);
}

.sc-invite-accept__help {
  margin: 0;
}

.sc-invite-accept__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sc-space-2);
}

@media (max-width: 767px) {
  .sc-staff-invitation__side {
    align-items: flex-start;
  }

  .sc-staff-invitation__actions {
    justify-content: flex-start;
  }
}
/* ========== end of the staff page and invitation codes block ========== */

/* ========== People I look after (20 Nov 2026): children the patient made a record for ========== */
/* Tokens only; logical properties only. The desk code reuses .sc-invite-code (shown once, large). */
.sc-dependants,
.sc-dependant__add,
.sc-dependant__carers,
.sc-dependant__carer-code,
.sc-family__enter-carer,
.sc-dependant__login-panel,
.sc-dependant__second,
.sc-dependant-desk,
.sc-dependant-desk__record,
.sc-dependant-desk__paper,
.sc-dependant-desk__result {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-3);
}

.sc-dependant__actions {
  flex-wrap: wrap;
}

.sc-dependant__second {
  padding-inline-start: var(--sc-space-3);
  border-inline-start: 2px solid var(--sc-color-border);
}

.sc-dependant__ended {
  color: var(--sc-color-text-muted);
}

/* The access ends within 90 days (21 Nov 2026): one plain sentence in a soft warning band, not an alarm. */
.sc-dependant__ending {
  margin: 0;
  padding: var(--sc-space-3);
  border-radius: var(--sc-radius-md);
  background: var(--sc-color-warning-soft);
  color: var(--sc-color-warning);
  font-size: var(--sc-font-size-body);
  line-height: var(--sc-line-body);
}

.sc-dependant__carer-me {
  color: var(--sc-color-text-muted);
  font-weight: 400;
}

/* The one-time login link is long: it breaks anywhere, left to right, and can be selected whole. */
.sc-dependant__link {
  margin: 0;
  max-inline-size: 100%;
  color: var(--sc-color-text);
  font-size: var(--sc-font-size-body);
  line-height: var(--sc-line-body);
  overflow-wrap: anywhere;
  word-break: break-all;
  user-select: all;
}

/* The receptionist's confirmation of a child's family link: what the parent stated, the clinic's record, the paper. */
.sc-dependant-desk__result {
  align-items: flex-start;
  padding: var(--sc-space-4);
  border: 1px solid var(--sc-color-border);
  border-radius: var(--sc-radius-lg);
  background: var(--sc-color-success-soft);
}

.sc-dependant-desk__born {
  margin: 0;
  font-size: var(--sc-font-size-subtitle);
  font-weight: var(--sc-font-weight-h3);
}

.sc-dependants__notes {
  margin: 0;
  padding-inline-start: var(--sc-space-5);
  color: var(--sc-color-text-muted);
  font-size: var(--sc-font-size-body);
  line-height: var(--sc-line-body);
}

/* ========== The carer acts for the child (21 Nov 2026) ========== */
/* The band that always says whose record a shared screen shows. Logical properties and tokens only. */
.sc-acting {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sc-space-3);
  margin-block-end: var(--sc-space-4);
  padding: var(--sc-space-3) var(--sc-space-4);
  border: 1px solid var(--sc-color-primary);
  border-inline-start-width: 6px;
  border-radius: var(--sc-radius-lg);
  background: var(--sc-color-primary-soft);
  color: var(--sc-color-primary-strong);
}

.sc-acting__main {
  display: flex;
  flex: 1 1 12rem;
  flex-direction: column;
  min-inline-size: 0;
}

.sc-acting__label {
  margin: 0;
  font-size: var(--sc-font-size-body);
  line-height: var(--sc-line-body);
}

.sc-acting__title {
  margin: 0;
  font-size: var(--sc-font-size-subtitle);
  font-weight: var(--sc-font-weight-h3);
  line-height: var(--sc-line-body);
  overflow-wrap: anywhere;
}

/* The way back may be a long sentence in French or Arabic: it wraps inside the band (never clipped, never a sideways scroll). */
.sc-acting__back.e-btn {
  max-inline-size: 100%;
  height: auto;
  min-block-size: 44px;
  line-height: var(--sc-line-body);
  text-align: start;
  white-space: normal;
}

.sc-acting__unavailable {
  margin: 0;
  font-size: var(--sc-font-size-body);
  line-height: var(--sc-line-body);
}

/* The entry points on a child's card: full-width buttons, one under the other, the child's name in each (never two side by side on a phone). */
.sc-dependant__do {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-2);
  margin: var(--sc-space-2) 0 var(--sc-space-1);
  padding: 0;
  list-style: none;
}

.sc-dependant__do .e-btn {
  display: flex;
  inline-size: 100%;
  min-block-size: 44px;
  height: auto;
  justify-content: flex-start;
  padding-block: var(--sc-space-2);
  line-height: var(--sc-line-body);
  text-align: start;
  white-space: normal;
}

.sc-card-show__whose {
  margin: 0;
  color: var(--sc-color-on-dark);
  font-size: var(--sc-font-size-title);
  font-weight: var(--sc-font-weight-h3);
  overflow-wrap: anywhere;
}

.sc-sharing__giving-for,
.sc-sharing__no-sensitive,
.sc-records__no-sensitive {
  margin: 0;
}
/* ========== end of the patient app third-batch block ========== */


/* ---------- Clinic reports and the patient's health summary (21 Nov 2026) ---------- */

.sc-report {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-4);
  min-inline-size: 0;
}

.sc-report__presets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sc-space-2);
  margin-block-end: var(--sc-space-3);
}

.sc-report__now {
  margin: 0;
}

.sc-report__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: var(--sc-space-4);
  row-gap: var(--sc-space-1);
}

.sc-report__title {
  margin: 0;
  font-size: var(--sc-font-size-subtitle);
  line-height: var(--sc-line-subtitle);
  font-weight: var(--sc-font-weight-h3);
}

.sc-report__period,
.sc-report__generated {
  margin: 0;
  font-size: var(--sc-font-size-label);
  line-height: var(--sc-line-label);
}

.sc-report__figures {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--sc-space-3);
  margin: var(--sc-space-4) 0;
}

.sc-report__figure {
  min-inline-size: 0;
  padding: var(--sc-space-3) var(--sc-space-4);
  background: var(--sc-color-surface-alt);
  border: 1px solid var(--sc-color-border);
  border-radius: var(--sc-radius-md);
}

.sc-report__figure-label {
  margin: 0;
  color: var(--sc-color-text-subtle);
  font-size: var(--sc-font-size-caption);
  line-height: var(--sc-line-caption);
  font-weight: 500;
}

.sc-report__figure-value {
  margin: var(--sc-space-1) 0 0;
  color: var(--sc-color-text);
  font-size: var(--sc-font-size-subtitle);
  line-height: var(--sc-line-subtitle);
  font-weight: var(--sc-font-weight-h3);
  overflow-wrap: anywhere;
}

/* A money figure lists one line per currency: never added across them. */
.sc-report__money {
  display: block;
  font-size: var(--sc-font-size-body-sm);
  line-height: var(--sc-line-body-sm);
  font-variant-numeric: tabular-nums;
}

.sc-report__truncated {
  margin-block-end: var(--sc-space-3);
}

.sc-report__rows-count,
.sc-report__no-rows {
  margin: 0 0 var(--sc-space-2);
  font-size: var(--sc-font-size-label);
}

/* The grid scrolls sideways inside its card; the page never does. */
.sc-report__grid {
  max-inline-size: 100%;
  overflow-x: auto;
}

.sc-report__unavailable .sc-state__actions {
  margin-block-start: var(--sc-space-3);
}

.sc-report-print-head {
  margin-block-end: var(--sc-space-4);
  font-family: var(--sc-font-family);
}

.sc-report-print-head h2 {
  margin: 0 0 var(--sc-space-2);
  font-size: 20px;
}

.sc-report-print-head p {
  margin: 0 0 var(--sc-space-1);
  font-size: 13px;
}

@media (max-width: 767px) {
  .sc-report__figures {
    grid-template-columns: 1fr 1fr;
  }

  .sc-report__preset {
    flex: 1 1 calc(50% - var(--sc-space-2));
  }
}

/* ========== end of the reports block ========== */

/* ---------- My health summary (patient app, 21 Nov 2026) ---------- */

.sc-summary {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-4);
  margin-block-end: var(--sc-space-4);
}

.sc-summary__title {
  margin: 0 0 var(--sc-space-3);
  font-size: var(--sc-font-size-title);
  line-height: var(--sc-line-title);
  font-weight: var(--sc-font-weight-h2);
}

.sc-summary__name {
  font-size: var(--sc-font-size-subtitle);
  font-weight: 600;
}

/* The line that says this is a summary and not a medical record: boxed so that nobody misses it. */
.sc-summary__disclaimer {
  margin: var(--sc-space-3) 0 0;
  padding: var(--sc-space-3);
  border: 1px solid var(--sc-color-border-strong);
  border-radius: var(--sc-radius-md);
  background: var(--sc-color-surface-alt);
  color: var(--sc-color-text);
  font-size: var(--sc-font-size-body-sm);
  line-height: var(--sc-line-body-sm);
}

.sc-summary__hidden {
  margin: var(--sc-space-2) 0 0;
  font-size: var(--sc-font-size-label);
}

.sc-summary__lines {
  margin: 0;
  padding-inline-start: var(--sc-space-5);
}

.sc-summary__lines li {
  margin-block-end: var(--sc-space-1);
  overflow-wrap: anywhere;
}

.sc-summary__actions {
  margin-block-start: 0;
}

/* Ctrl+P on a desktop browser prints the summary alone: no navigation, no buttons. */
@media print {
  .sc-sidenav,
  .sc-topbar,
  .sc-bottomnav,
  .sc-page-header,
  .sc-summary__actions,
  .sc-summary__print-hint,
  .sc-summary__done,
  .sc-banner-stack {
    display: none !important;
  }

  .sc-shell,
  .sc-main {
    display: block !important;
    padding: 0 !important;
    background: var(--sc-slip-paper) !important;
  }

  .sc-summary .sc-card {
    break-inside: avoid;
    border-color: var(--sc-color-border);
  }
}

/* ========== end of the health summary block ========== */

/* ========== The waiting-room display (21 Nov 2026): the mode page, the TV screens, the "number only" tick ========== */
/* Tokens only; logical properties only. A pairing code reuses .sc-invite-code (shown once, large). */
.sc-display-modes__group {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-3);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.sc-display-modes__legend {
  margin-block-end: var(--sc-space-1);
  padding: 0;
  font-size: var(--sc-font-size-body);
  font-weight: 600;
  line-height: var(--sc-line-body);
}

.sc-display-mode {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sc-space-3) var(--sc-space-4);
  padding: var(--sc-space-3) var(--sc-space-4);
  border: 1px solid var(--sc-color-border);
  border-radius: var(--sc-radius-lg);
  background: var(--sc-color-surface);
}

.sc-display-mode--selected {
  border-color: var(--sc-color-primary-strong);
  background: var(--sc-color-primary-soft);
}

/* The example row: a made-up patient, shown the way the TV shows one. It is labelled "Example" so nobody takes it for a real person. */
.sc-display-example {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sc-space-2);
  min-width: 0;
}

.sc-display-example__tag {
  color: var(--sc-color-text-muted);
  font-size: var(--sc-font-size-caption);
  line-height: var(--sc-line-caption);
}

.sc-display-example__name {
  font-size: var(--sc-font-size-body);
  font-weight: 600;
  line-height: var(--sc-line-body);
}

.sc-display-warning,
.sc-display-note,
.sc-display-readonly,
.sc-display-saved {
  margin-block-start: var(--sc-space-3);
}

.sc-display-screens-link {
  margin-block: var(--sc-space-4) 0;
}

/* The tick of a check-in, a referral and a waiting visit: the line under it says why it may be switched off. */
.sc-number-only {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-1);
  margin-block: var(--sc-space-3);
}

/* A tick that cannot be used says so by its look too (a clinic that shows numbers only): the label and the frame grey out. */
.sc-number-only--off .e-checkbox-wrapper .e-label {
  color: var(--sc-color-disabled-text);
}

.sc-number-only--off .e-checkbox-wrapper .e-frame {
  border-color: var(--sc-color-border);
  background: var(--sc-color-disabled-bg);
}

.sc-number-only--off .e-checkbox-wrapper .e-frame.e-check {
  border-color: var(--sc-color-disabled-text);
  background: var(--sc-color-disabled-text);
}

.sc-number-only__note {
  margin: 0;
  padding-inline-start: var(--sc-space-6);
}

.sc-number-only-mark {
  display: inline-flex;
  align-items: center;
  gap: var(--sc-space-1);
  margin-inline-end: var(--sc-space-2);
  color: var(--sc-color-primary-strong);
  font-weight: 600;
  white-space: nowrap;
}

/* On a phone card the marker has a line of its own: the reason and the doctor follow it without a break in the middle. */
.sc-queue-card__meta .sc-number-only-mark {
  display: flex;
  margin-inline-end: 0;
}

.sc-visit-panel__screen {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-1);
}

/* The list of TV screens. */
.sc-screen {
  flex-wrap: wrap;
  align-items: flex-start;
}

.sc-screen__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--sc-space-2);
}

.sc-screen__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sc-space-2);
}

.sc-screen-limits {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-3);
}

.sc-screen-limits__group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* The pairing dialog: the address and the code are read out and typed on a TV, so they are large and never break inside the code. */
.sc-pairing {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-3);
}

.sc-pairing__step {
  margin: 0;
  font-size: var(--sc-font-size-body);
  font-weight: 600;
  line-height: var(--sc-line-body);
}

.sc-pairing__address,
.sc-pairing__address-unknown {
  margin: 0;
  padding: var(--sc-space-3) var(--sc-space-4);
  border: 1px solid var(--sc-color-border);
  border-radius: var(--sc-radius-md);
  background: var(--sc-color-surface-alt);
  font-size: var(--sc-font-size-subtitle);
  font-weight: 600;
  line-height: var(--sc-line-subtitle);
  overflow-wrap: anywhere;
  user-select: all;
}

.sc-pairing__address-unknown {
  font-size: var(--sc-font-size-body);
  font-weight: 500;
  user-select: auto;
}

.sc-pairing .sc-form-actions {
  justify-content: center;
}

@media (max-width: 480px) {
  .sc-pairing__address {
    font-size: var(--sc-font-size-body-sm);
    letter-spacing: -0.01em;
  }
}

@media (max-width: 767px) {
  .sc-screen__side {
    align-items: flex-start;
    inline-size: 100%;
  }

  .sc-screen__actions {
    justify-content: flex-start;
  }
}
/* ========== end of the waiting-room display block ========== */

/* ========== The facility structure and the rooms of the doctors (21 Nov 2026) ========== */
/* Tokens only; logical properties only. The tree grid is Syncfusion's, restyled with the grid in spitalco-syncfusion.css. */
.sc-structure-count {
  display: inline-flex;
  align-items: center;
  padding: var(--sc-space-1) var(--sc-space-3);
  border-radius: var(--sc-radius-pill);
  background: var(--sc-color-neutral-soft);
  color: var(--sc-color-neutral);
  font-size: var(--sc-font-size-label);
  font-weight: 600;
  line-height: var(--sc-line-label);
  white-space: nowrap;
}

.sc-structure-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sc-space-2);
  margin-block-end: var(--sc-space-3);
}

.sc-structure-toolbar .e-btn .sc-icon {
  margin-inline-end: var(--sc-space-2);
}

.sc-structure-filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sc-space-3) var(--sc-space-5);
  margin-block-end: var(--sc-space-3);
}

.sc-structure-filter,
.sc-structure-search {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-1);
  min-width: 0;
}

.sc-structure-search {
  flex: 1 1 240px;
  max-inline-size: 420px;
}

.sc-structure-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sc-space-2);
}

/* The chosen category: a filled chip (the state is also in aria-pressed, never colour alone). */
.sc-root .e-btn.sc-structure-chip {
  min-height: 40px;
  border-radius: var(--sc-radius-pill);
}

.sc-root .e-btn.sc-structure-chip.sc-structure-chip--active {
  border-color: var(--sc-color-primary);
  background: var(--sc-color-primary-soft);
  color: var(--sc-color-primary-strong);
  font-weight: 600;
}

.sc-structure-selected {
  margin: 0 0 var(--sc-space-3);
  color: var(--sc-color-text-muted);
  font-size: var(--sc-font-size-label);
  line-height: var(--sc-line-label);
}

.sc-structure-readonly,
.sc-structure-add-hint {
  margin-block: 0 var(--sc-space-3);
}

.sc-structure-grid {
  max-inline-size: 100%;
  overflow-x: auto;
}

/* One cell of the tree column: the type's icon, the name, and the code beneath it. Syncfusion sets "display: inline-block" on every span of the tree column
   (.e-treegrid .e-treecolumn-container span), so these rules repeat the grid's selector to win. */
.sc-root .e-treegrid .sc-node-cell,
.sc-node-cell {
  display: inline-flex;
  align-items: center;
  gap: var(--sc-space-3);
  min-width: 0;
}

.sc-root .e-treegrid .sc-node-cell__icon,
.sc-node-cell__icon {
  display: inline-flex;
  flex: none;
  color: var(--sc-color-primary);
}

.sc-root .e-treegrid .sc-node-cell__lines,
.sc-node-cell__lines {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sc-node-cell__name {
  font-weight: 600;
  line-height: var(--sc-line-body-sm);
  overflow-wrap: anywhere;
}

.sc-node-cell__code {
  color: var(--sc-color-text-muted);
  font-size: var(--sc-font-size-caption);
  line-height: var(--sc-line-caption);
}

.sc-node-period {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* A node that has ended is dimmed; it is shown only while "show ended" is on. */
.sc-root .e-treegrid .e-row.sc-row-ended .e-rowcell {
  color: var(--sc-color-text-muted);
}

.sc-root .e-treegrid .e-row.sc-row-ended .sc-node-cell__icon,
.sc-root .e-treegrid .e-row.sc-row-ended .e-chip,
.sc-root .e-treegrid .e-row.sc-row-ended .sc-chip {
  opacity: 0.6;
}

.sc-root .e-treegrid .e-row.sc-row-ended .sc-node-cell__name {
  font-weight: 500;
}

/* The form sits in a modal dialog (outside the app's root) with the root class on it: it takes the height of its fields, not the whole page. */
.sc-structure-form.sc-root {
  height: auto;
}

.sc-structure-form__parent {
  margin-block: 0 var(--sc-space-3);
}

.sc-structure-form__checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sc-space-2) var(--sc-space-5);
}

/* The map point picker (Forms/MapPointPicker.razor): a Leaflet map with an address search bar, the point under it. */
.sc-map-picker {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-2);
  min-width: 0;
}

.sc-map-picker__map {
  height: 280px;
  border: 1px solid var(--sc-color-border-strong);
  border-radius: var(--sc-radius-md);
  background: var(--sc-color-surface-alt);
  overflow: hidden;
  z-index: 0;   /* Leaflet's panes use z-index up to 1000: keep them under the dialog's own layers. */
}

.sc-map-picker__map:focus-visible {
  outline: 2px solid var(--sc-focus-color);
  outline-offset: 2px;
}

.sc-map-picker__map .leaflet-control-geosearch.bar {
  margin: 10px auto 0;
  width: calc(100% - 100px);
  max-width: 420px;
}

.sc-map-picker__map .leaflet-control-geosearch form input {
  font-family: inherit;
  font-size: var(--sc-font-size-sm);
}

.sc-map-picker__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sc-space-2) var(--sc-space-4);
  font-size: var(--sc-font-size-sm);
}

.sc-map-picker__point {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sc-space-2);
  color: var(--sc-color-text);
}

.sc-map-picker__pin {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--sc-color-primary-strong);
}

.sc-map-picker__numbers,
.sc-map-picker__empty {
  color: var(--sc-color-text-muted);
}

@media (max-width: 480px) {
  .sc-map-picker__map {
    height: 220px;
  }
}

/* The dialog scrolls inside itself on a short screen; its buttons stay in reach. */
.sc-structure-dialog .e-dlg-content {
  overflow-y: auto;
}

/* The rooms of the doctors. */
.sc-doctor-room {
  flex-wrap: wrap;
  align-items: flex-start;
}

.sc-doctor-room__main {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-2);
  flex: 1 1 320px;
  min-width: 0;
}

.sc-doctor-room__side {
  display: flex;
  align-items: flex-start;
}

.sc-doctor-room__set {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-1);
  max-inline-size: 640px;
}

.sc-doctor-room__control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sc-space-2);
}

.sc-doctor-room__control .e-ddl {
  flex: 1 1 220px;
  min-width: 0;
}

.sc-doctor-room__none {
  color: var(--sc-color-text-muted);
}

/* The room next to a doctor's name (the queue, the visit panel, the rooms page): a small label, never the only carrier of the room (its text is there). */
.sc-room-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sc-space-1);
  margin-inline-start: var(--sc-space-3);
  padding: 0;
  color: var(--sc-color-text-muted);
  font-size: inherit;
  font-weight: 400;
  line-height: inherit;
  max-inline-size: 100%;
  vertical-align: middle;
}

.sc-room-tag .sc-icon {
  width: 14px;
  height: 14px;
}

/* On a phone's card the room has the line to itself under the doctor, whole. */
.sc-queue-card__meta .sc-room-tag {
  display: flex;
  margin-inline-start: 0;
  margin-block-start: var(--sc-space-1);
}

.sc-room-tag__text {
  overflow-wrap: anywhere;
}

/* A queue row keeps its two lines and cuts a long line with an ellipsis; when the doctor has a room the line may wrap instead, so that the room is never the part that is cut. */
.sc-queue-row__meta:has(.sc-room-tag) {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

/* In the visit panel's facts the label has the line to itself (the column is narrow). */
.sc-facts dd .sc-room-tag {
  display: flex;
  inline-size: fit-content;
  margin-inline-start: 0;
  margin-block-start: var(--sc-space-1);
}

.sc-doctor-room__room {
  margin-inline-start: 0;
  font-size: var(--sc-font-size-label);
  line-height: var(--sc-line-label);
}

/* "I am in room ..." at the top of the queue. */
.sc-my-room {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-2);
  margin-block-end: var(--sc-space-4);
  padding: var(--sc-space-4);
  border-color: var(--sc-color-primary);
}

.sc-my-room__title {
  margin: 0;
  font-size: var(--sc-font-size-subtitle);
  line-height: var(--sc-line-subtitle);
}

.sc-my-room__help {
  margin: 0;
}

.sc-my-room__choices {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sc-space-2);
}

.sc-my-room__pick {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-1);
  max-inline-size: 420px;
}

.sc-my-room__done {
  margin: 0 0 var(--sc-space-3);
  color: var(--sc-color-success);
  font-weight: 600;
}

@media (max-width: 767px) {
  .sc-structure-search {
    flex-basis: 100%;
    max-inline-size: none;
  }

  .sc-doctor-room__side {
    order: -1;
    inline-size: 100%;
  }
}
/* ========== end of the structure and doctors' rooms block ========== */

/* ---------- ABP's cookie banner in the web host (dark theme) ---------- */

/* The banner belongs to ABP (the web host's footer layer) and takes LeptonX's primary, which is the token primary: a light teal in the dark theme, under white text.
   It follows the theme like a raised layer instead. The light theme keeps LeptonX's own (white on teal-700, 5.96:1). */
:root[data-theme="dark"] .abp-cookie-consent,
:root[data-theme="dark"] .abp-cookie-consent .row,
:root[data-theme="dark"] .abp-cookie-consent .col-12,
:root[data-theme="dark"] .abp-cookie-consent .bg-primary {
    background: var(--sc-color-surface-raised) !important;
    border-block-start: 1px solid var(--sc-color-border);
    color: var(--sc-color-text) !important;
}

:root[data-theme="dark"] .abp-cookie-consent .text-white {
    color: var(--sc-color-text) !important;
}

:root[data-theme="dark"] .abp-cookie-consent a,
:root[data-theme="dark"] .abp-cookie-consent a.text-white {
    color: var(--sc-color-primary-strong) !important;
}

:root[data-theme="dark"] .abp-cookie-consent .btn-info,
:root[data-theme="dark"] .abp-cookie-consent .btn-info:hover,
:root[data-theme="dark"] .abp-cookie-consent .btn-info:focus-visible {
    color: var(--sc-color-on-primary) !important;
    background-color: var(--sc-color-primary) !important;
    border-color: var(--sc-color-primary) !important;
}

:root[data-theme="dark"] .abp-cookie-consent .btn-info:hover {
    background-color: var(--sc-color-primary-pressed) !important;
    border-color: var(--sc-color-primary-pressed) !important;
}

:root[data-theme="dark"] .abp-cookie-consent .btn-info:focus-visible {
    outline-color: var(--sc-color-primary-strong);
}

/* ---------- My code, requests from clinics, claim a record, add a patient by code (25 Nov 2026) ---------- */

.sc-my-code__code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sc-space-1);
  padding: var(--sc-space-4);
  border: 2px solid var(--sc-color-primary);
  border-radius: var(--sc-radius-lg);
  background: var(--sc-color-primary-soft);
  text-align: center;
}

.sc-my-code__label {
  margin: 0;
  color: var(--sc-color-primary-strong);
  font-size: var(--sc-font-size-body);
}

.sc-my-code__value {
  margin: 0;
  color: var(--sc-color-text);
  font-size: clamp(22px, 7.5vw, 44px); /* one line on a phone: the dash must not end a line (checked at 390 px) */
  white-space: nowrap;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  unicode-bidi: isolate;
  user-select: all;
}

.sc-my-code__qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sc-space-2);
  margin: var(--sc-space-4) 0 0;
}

/* A QR is read dark on light in both themes: the white of the printed slip, whatever the theme. */
.sc-my-code__qr-box {
  padding: var(--sc-space-3);
  border: 1px solid var(--sc-color-border);
  border-radius: var(--sc-radius-md);
  background: var(--sc-slip-paper);
  line-height: 0;
}

.sc-my-code__note {
  margin: var(--sc-space-3) 0 0;
  font-weight: 600;
}

.sc-requests__share-title {
  margin: var(--sc-space-2) 0 0;
  font-weight: 600;
}

.sc-requests__share {
  display: grid;
  gap: var(--sc-space-1);
  margin: var(--sc-space-1) 0;
  padding: 0;
  list-style: none;
}

.sc-requests__share li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sc-space-2);
}

.sc-requests__share-kind {
  color: var(--sc-color-text-muted);
}

.sc-requests__share-value {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.sc-tile__count {
  align-self: flex-start;
}

/* The clinic's "Add a patient by code": the code in large left-to-right digits, the answer, and the list of the clinic's requests. */
.sc-link-code {
  max-inline-size: 28rem;
}

.sc-link-code .sc-input,
.sc-link-code .e-input-group {
  font-size: 24px;
  letter-spacing: 0.08em;
  direction: ltr;
}

.sc-link-code__sent {
  margin: 0;
  padding: var(--sc-space-3) var(--sc-space-4);
  border-radius: var(--sc-radius-md);
  background: var(--sc-color-success-soft);
  color: var(--sc-color-success);
  font-weight: 600;
}

.sc-link-requests__code {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

.sc-ask-by-code {
  display: flex;
  flex-direction: column;
  gap: var(--sc-space-2);
  margin-block: var(--sc-space-3);
}

/* Requests to a claimed patient (26 Nov 2026). Clinic: what a request proposes, field by field (the national number is named, never shown), and the state after a save.
   Patient: every proposed field with today's value next to the proposed one; on a phone (360 px) the two values stack under the field's name. */
.sc-correction-fields {
  display: grid;
  gap: var(--sc-space-1);
  margin: var(--sc-space-1) 0;
  padding: 0;
  list-style: none;
}

.sc-correction-fields li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sc-space-2);
}

.sc-correction-fields__name {
  color: var(--sc-color-text-muted);
}

.sc-correction-fields__value {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.sc-correction-outcome {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sc-space-2);
  margin: 0 0 var(--sc-space-4);
  padding: var(--sc-space-3) var(--sc-space-4);
  border: 1px solid var(--sc-color-border);
  border-radius: var(--sc-radius-md);
  background: var(--sc-color-surface);
}

.sc-correction-outcome__detail {
  margin: 0;
}

.sc-changes {
  display: grid;
  gap: var(--sc-space-2);
  margin: var(--sc-space-2) 0;
  padding: 0;
  list-style: none;
}

.sc-changes__row {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sc-space-1) var(--sc-space-3);
  padding-block: var(--sc-space-2);
  border-block-end: 1px solid var(--sc-color-border-subtle);
}

.sc-changes__row:last-child {
  border-block-end: 0;
}

.sc-changes__head {
  color: var(--sc-color-text-muted);
  font-size: 0.875rem;
}

.sc-changes__field {
  font-weight: 600;
}

.sc-changes__today {
  color: var(--sc-color-text-muted);
  overflow-wrap: anywhere;
}

.sc-changes__new {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.sc-changes__label {
  display: none;
  color: var(--sc-color-text-muted);
  font-weight: 400;
}

@media (max-width: 599.98px) {
  .sc-changes__row {
    grid-template-columns: minmax(0, 1fr);
  }

  .sc-changes__row.sc-changes__head {
    display: none;
  }

  .sc-changes__label {
    display: inline;
  }
}

.sc-changes--answered .sc-changes__row {
  grid-template-columns: minmax(8rem, 1fr) minmax(0, 2fr);
}

.sc-changes__reason {
  margin: var(--sc-space-2) 0 0;
  font-style: italic;
}

/* Browser check of 26 Nov 2026: the state chip and the button of a request apart; a field's value close to its name; the plain words and the way to Structure stacked. */
.sc-corrections .sc-list__aside {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sc-space-2);
}

.sc-correction-fields {
  max-inline-size: 40rem;
}

.sc-settings__root-missing {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sc-space-2);
}

.sc-settings__root-missing p {
  margin: 0;
}

/* The page has arrived but is not live yet (web host, the first seconds): inert, with a thin moving bar at the top (SpitalCoRoot). */
.sc-root--starting {
  cursor: progress;
}

.sc-root--starting::before {
  content: "";
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 2000;
  height: 3px;
  background: linear-gradient(90deg, transparent 0%, var(--sc-color-primary) 50%, transparent 100%);
  background-size: 50% 100%;
  background-repeat: no-repeat;
  animation: sc-starting 1.2s ease-in-out infinite;
}

@keyframes sc-starting {
  from { background-position: -50% 0; }
  to { background-position: 150% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sc-root--starting::before {
    animation: none;
    background: var(--sc-color-primary);
    opacity: 0.6;
  }
}
