/* -----------------------------------------------------------------------------
   Application stylesheet
   PAMC Support. The UI is Bootstrap 5.3 + Bootstrap Icons, themed with the visual principles of
   PAMC Web (D:\00_PAMC\trunk_pamcweb, Styles/app.css) so both products look like one family:
   - brand blue #054A8F (the PAMC logo swoosh) for primary actions, #003D79 on hover/links;
   - PAMC navy #0D1E35 for the side menu and the sign-in background;
   - slate greys (#F8FAFC page, #E2E8F0 borders, #475569 secondary text), Segoe UI;
   - rounded-lg controls (.5rem), rounded-xl cards (.75rem), a light shadow, a brand focus ring.
   The rest of this file adds what Bootstrap has no component for (shell, chat, stepper, Kanban).
   Changing the brand = changing the variables below.

   Author: Allan Barcelos <aBarcelos@pamcsoftware.com>
   ----------------------------------------------------------------------------- */

:root,
[data-bs-theme=light] {
    --pamc-brand-50: #eff6ff;
    --pamc-brand-100: #daeaff;
    --pamc-brand-200: #bfdbff;
    --pamc-brand-300: #8fbbf1;
    --pamc-brand-500: #286cba;
    --pamc-brand-600: #054a8f;
    --pamc-brand-700: #003d79;
    --pamc-brand-800: #003064;
    --pamc-brand-950: #0d1e35;
    --pamc-slate-50: #f8fafc;
    --pamc-slate-100: #f1f5f9;
    --pamc-slate-200: #e2e8f0;
    --pamc-slate-300: #cbd5e1;
    --pamc-slate-400: #94a3b8;
    --pamc-slate-500: #64748b;
    --pamc-slate-600: #475569;
    --pamc-slate-700: #334155;
    --pamc-slate-800: #1e293b;
    --pamc-slate-900: #0f172a;
    --pamc-shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, .05);

    --bs-primary: var(--pamc-brand-600);
    --bs-primary-rgb: 5, 74, 143;
    --bs-primary-text-emphasis: var(--pamc-brand-800);
    --bs-primary-bg-subtle: var(--pamc-brand-50);
    --bs-primary-border-subtle: var(--pamc-brand-200);
    --bs-link-color: var(--pamc-brand-600);
    --bs-link-color-rgb: 5, 74, 143;
    --bs-link-hover-color: var(--pamc-brand-700);
    --bs-link-hover-color-rgb: 0, 61, 121;
    --bs-body-font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    --bs-body-color: var(--pamc-slate-900);
    --bs-body-color-rgb: 15, 23, 42;
    --bs-secondary-color: var(--pamc-slate-600);
    --bs-secondary-color-rgb: 71, 85, 105;
    --bs-tertiary-color: var(--pamc-slate-500);
    --bs-tertiary-bg: var(--pamc-slate-50);
    --bs-tertiary-bg-rgb: 248, 250, 252;
    --bs-secondary-bg: var(--pamc-slate-100);
    --bs-border-color: var(--pamc-slate-200);
    --bs-border-radius: .5rem;
    --bs-border-radius-sm: .375rem;
    --bs-border-radius-lg: .75rem;
    --bs-box-shadow-sm: var(--pamc-shadow-sm);
    --bs-focus-ring-color: rgba(40, 108, 186, .25);
}

body {
    background-color: var(--pamc-slate-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1:focus {
    outline: none;
}

/* Page title (PageHeader): text-2xl, semibold, tight tracking; the subtitle in slate-600. */
.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -.025em;
    line-height: 1.25;
    margin: 0;
}

.page-subtitle {
    margin: .25rem 0 0;
    font-size: .875rem;
    color: var(--pamc-slate-600);
}

/* ── Buttons: rounded-lg, semibold, text-sm ────────────────────────────── */
.btn {
    --bs-btn-padding-x: 1rem;
    --bs-btn-padding-y: .5rem;
    --bs-btn-font-size: .875rem;
    --bs-btn-font-weight: 600;
    --bs-btn-border-radius: .5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

.btn-sm {
    --bs-btn-padding-x: .625rem;
    --bs-btn-padding-y: .25rem;
    --bs-btn-font-size: .8125rem;
    --bs-btn-border-radius: .375rem;
    gap: .375rem;
}

.btn-link {
    --bs-btn-font-weight: 500;
}

.btn-primary {
    --bs-btn-bg: var(--pamc-brand-600);
    --bs-btn-border-color: var(--pamc-brand-600);
    --bs-btn-hover-bg: var(--pamc-brand-700);
    --bs-btn-hover-border-color: var(--pamc-brand-700);
    --bs-btn-active-bg: var(--pamc-brand-800);
    --bs-btn-active-border-color: var(--pamc-brand-800);
    --bs-btn-disabled-bg: var(--pamc-brand-600);
    --bs-btn-disabled-border-color: var(--pamc-brand-600);
    --bs-btn-focus-shadow-rgb: 40, 108, 186;
}

.btn-outline-primary {
    --bs-btn-color: var(--pamc-brand-600);
    --bs-btn-border-color: var(--pamc-brand-300);
    --bs-btn-hover-bg: var(--pamc-brand-50);
    --bs-btn-hover-color: var(--pamc-brand-700);
    --bs-btn-hover-border-color: var(--pamc-brand-300);
    --bs-btn-active-bg: var(--pamc-brand-100);
    --bs-btn-active-color: var(--pamc-brand-800);
    --bs-btn-active-border-color: var(--pamc-brand-300);
    --bs-btn-focus-shadow-rgb: 40, 108, 186;
}

/* PAMC "secondary" button: white, slate border, slate text, light grey on hover. */
.btn-outline-secondary,
.btn-light {
    --bs-btn-color: var(--pamc-slate-700);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: var(--pamc-slate-300);
    --bs-btn-hover-color: var(--pamc-slate-800);
    --bs-btn-hover-bg: var(--pamc-slate-100);
    --bs-btn-hover-border-color: var(--pamc-slate-300);
    --bs-btn-active-color: var(--pamc-slate-900);
    --bs-btn-active-bg: var(--pamc-slate-200);
    --bs-btn-active-border-color: var(--pamc-slate-300);
    --bs-btn-disabled-color: var(--pamc-slate-500);
    --bs-btn-disabled-bg: #fff;
    --bs-btn-disabled-border-color: var(--pamc-slate-200);
    --bs-btn-focus-shadow-rgb: 40, 108, 186;
}

/* ── Form controls: rounded-lg, slate-300 border, brand focus ring ─────── */
.form-control,
.form-select {
    border-color: var(--pamc-slate-300);
    border-radius: .5rem;
    font-size: .875rem;
    padding-top: .5rem;
    padding-bottom: .5rem;
    box-shadow: var(--pamc-shadow-sm);
}

.form-control-sm,
.form-select-sm {
    padding-top: .25rem;
    padding-bottom: .25rem;
    font-size: .8125rem;
    border-radius: .375rem;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--pamc-brand-500);
    box-shadow: 0 0 0 .2rem var(--pamc-brand-100);
}

.form-check-input:checked {
    background-color: var(--pamc-brand-600);
    border-color: var(--pamc-brand-600);
}

.form-label {
    font-size: .875rem;
    font-weight: 500;
    color: var(--pamc-slate-700);
    margin-bottom: .25rem;
}

.input-group-text {
    background-color: var(--pamc-slate-50);
    border-color: var(--pamc-slate-300);
    color: var(--pamc-slate-500);
    font-size: .875rem;
}

.input-group > .form-control,
.input-group > .form-select {
    box-shadow: none;
}

/* ── Cards: rounded-xl, slate-200 border, light shadow ─────────────────── */
.card {
    --bs-card-border-radius: .75rem;
    --bs-card-inner-border-radius: calc(.75rem - 1px);
    --bs-card-border-color: var(--pamc-slate-200);
    --bs-card-cap-bg: #fff;
    --bs-card-cap-padding-y: .75rem;
    box-shadow: var(--pamc-shadow-sm);
}

.card-header {
    font-size: .9375rem;
    font-weight: 600;
    color: var(--pamc-slate-800);
}

.card-header .bi {
    color: var(--pamc-slate-400);
}

/* ── Tabs (TabStrip): one row, underlined active tab, scrolls sideways on narrow screens ── */
.tab-strip {
    display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: thin;
    border-bottom: 1px solid var(--bs-border-color); margin-bottom: 1.25rem;
}
.tab-strip-tab {
    display: inline-flex; align-items: center; gap: .4rem; flex: 0 0 auto; white-space: nowrap;
    padding: .65rem .9rem; margin-bottom: -1px; border: 0; border-bottom: 3px solid transparent;
    background: none; color: var(--bs-secondary-color); font-weight: 600; font-size: .925rem; border-radius: 0;
}
.tab-strip-tab:hover { color: var(--bs-body-color); border-bottom-color: var(--bs-border-color); }
.tab-strip-tab.active { color: var(--bs-primary); border-bottom-color: var(--bs-primary); }
.tab-strip-tab:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: -2px; border-radius: .375rem .375rem 0 0; }
.tab-strip-badge {
    display: inline-block; min-width: 1.5rem; padding: .05rem .45rem; border-radius: 999px; font-size: .75rem;
    line-height: 1.3; text-align: center; background: var(--bs-secondary-bg); color: var(--bs-body-color);
}
.tab-strip-tab.active .tab-strip-badge { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }
/* A narrow column (the ticket's side panel): tighter tabs, names without icons, so they fit. */
.tab-strip.compact { gap: 0; }
.tab-strip.compact .tab-strip-tab { padding: .6rem .65rem; font-size: .875rem; }
.tab-strip.compact .tab-strip-tab > i { display: none; }
[role="tabpanel"]:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 4px; border-radius: .5rem; }

/* ── Task page: what to do next, and who is on the task ───────────────── */
.next-step { display: flex; gap: .75rem; align-items: flex-start; }
.next-step-icon {
    flex: 0 0 auto; width: 2.25rem; height: 2.25rem; border-radius: 50%; display: grid; place-items: center;
    background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); font-size: 1.1rem;
}
.next-step.tone-warning .next-step-icon { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.next-step.tone-muted .next-step-icon { background: var(--bs-secondary-bg); color: var(--bs-secondary-color); }
.task-people { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .9rem; }
.task-people > span { display: inline-flex; align-items: center; gap: .3rem; }
.task-people .who { color: var(--bs-secondary-color); }
.task-people .me { font-weight: 600; }

/* ── Tables: slate-50 header, small uppercase labels, light row lines ─── */
.table {
    --bs-table-color: var(--pamc-slate-900);
    --bs-table-border-color: var(--pamc-slate-100);
    --bs-table-hover-bg: var(--pamc-slate-50);
    font-size: .875rem;
}

.table > thead th,
.table > thead.table-light th {
    background-color: var(--pamc-slate-50);
    color: var(--pamc-slate-600);
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .025em;
    text-transform: uppercase;
    white-space: nowrap;
    border-bottom: 1px solid var(--pamc-slate-200);
    padding: .5rem .75rem;
}

.table > tbody > tr > td {
    padding: .5rem .75rem;
}

/* ── Dropdowns, modals, alerts, badges ─────────────────────────────────── */
.dropdown-menu {
    --bs-dropdown-border-color: var(--pamc-slate-200);
    --bs-dropdown-border-radius: .5rem;
    --bs-dropdown-link-active-bg: var(--pamc-brand-600);
    --bs-dropdown-font-size: .875rem;
}

.modal-content {
    --bs-modal-border-radius: .75rem;
    --bs-modal-border-color: var(--pamc-slate-200);
}

.modal-title {
    font-weight: 600;
}

.alert {
    --bs-alert-border-radius: .5rem;
    font-size: .875rem;
}

/* A message (AlertBox): icon, text and × on one axis, centred; a long text wraps beside the icon. */
.app-alert {
    display: flex;
    align-items: center;
    gap: .625rem;
    padding: .625rem .625rem .625rem .875rem;
    line-height: 1.45;
}

.app-alert-icon {
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1;
}

.app-alert-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.app-alert-close {
    flex-shrink: 0;
    width: .75rem;
    height: .75rem;
    padding: .375rem;
    background-size: .625rem;
    border-radius: .375rem;
}

.app-alert-important {
    border-left: .25rem solid var(--bs-warning);
}

/* Acknowledge dialog: something the person must say they understood. */
.ack-header {
    border-bottom-width: 0;
    padding-bottom: .5rem;
}

.ack-header .modal-title .bi {
    font-size: 1.25rem;
}

.ack-warning .modal-title .bi { color: var(--bs-warning) !important; }
.ack-danger .modal-title .bi { color: var(--bs-danger) !important; }
.ack-success .modal-title .bi { color: var(--bs-success) !important; }
.ack-info .modal-title .bi { color: var(--bs-info) !important; }

.ack-message {
    font-size: .9375rem;
    line-height: 1.5;
}

.ack-dialog > :last-child {
    margin-bottom: 0;
}

.ack-confirm {
    margin-top: 1rem;
    padding: .625rem .75rem .625rem 2.25rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    background-color: var(--bs-tertiary-bg);
}

/* A banner at the top of the pages: the icon on the left, the text and its buttons beside it
   (the buttons go under the text, together, when the line is short). */
.app-banner {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.app-banner-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
    line-height: 1;
}

.app-banner-body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
}

.app-banner-text {
    flex: 1 1 18rem;
    min-width: 0;
}

.app-banner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.app-banner-actions .btn {
    white-space: nowrap;
}

.badge {
    font-weight: 600;
}

/* ── Shell: like PAMC Web — the window never scrolls, only <main> does ── */
:root {
    --app-sidebar-width: 16rem;
    --app-header-height: 4rem;
    /* The foot of the menu and the page's footer: one line, the same height side by side. */
    --app-footer-height: 2.75rem;
}

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.app-sidebar {
    flex-shrink: 0;
    display: none;
    max-height: 50dvh;
    overflow-y: auto;
    background-color: var(--pamc-brand-950);
    color: #f1f5f9;
}

.app-sidebar.open {
    display: block;
}

/* Header menu button (narrow screens): just the icon, a soft background under the pointer. */
.app-menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border: 0;
    border-radius: .5rem;
    background: transparent;
    color: var(--pamc-slate-600);
    font-size: 1.5rem;
    line-height: 1;
    transition: background-color .15s ease, color .15s ease;
}

.app-menu-toggle:hover,
.app-menu-toggle[aria-expanded="true"] {
    background-color: var(--pamc-slate-100);
    color: var(--pamc-slate-900);
}

.app-menu-toggle:focus-visible,
.app-sidebar-collapse:focus-visible {
    outline: 2px solid var(--pamc-brand-600);
    outline-offset: 2px;
}

/* Foot of the side menu (wide screens): collapse to the icons / expand. A band of its own, a shade
   lighter than the menu, as tall as the page's footer beside it; icon and text centred on its line. */
.app-sidebar-collapse {
    align-items: center;
    gap: .75rem;
    height: var(--app-footer-height);
    margin: auto 0 0;
    padding: 0 1.5rem;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
    border-radius: 0;
    background-color: rgba(255, 255, 255, .045);
    color: var(--pamc-slate-400);
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1;
    text-align: left;
    transition: color .15s ease, background-color .15s ease;
}

.app-sidebar-collapse:hover {
    background-color: rgba(255, 255, 255, .08);
    color: #fff;
}

.app-sidebar-collapse .bi {
    display: inline-flex;
    font-size: 1rem;
    line-height: 1;
    transition: transform .2s ease;
}

.app-sidebar-collapse .nav-text {
    line-height: 1;
}

/* The page's footer: always at the bottom of the window (the page scrolls above it); the version
   on the far left, the platform's name on the far right. */
.app-footer {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: var(--app-footer-height);
    padding: 0 1rem;
    background-color: #fff;
    border-top: 1px solid var(--pamc-slate-200);
    color: var(--pamc-slate-500);
    font-size: .75rem;
    line-height: 1;
    white-space: nowrap;
}

.app-footer-version {
    font-family: var(--bs-font-monospace);
}

.app-footer-name {
    font-weight: 600;
    color: var(--pamc-slate-600, var(--pamc-slate-500));
}

.app-brand {
    display: none;
    align-items: center;
    gap: .75rem;
    height: var(--app-header-height);
    padding: 0 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
    text-decoration: none;
}

.app-brand img {
    height: 2.25rem;
    width: auto;
}

/* The square PAMC icon replaces the logo when the menu is collapsed. */
.app-brand .app-brand-icon {
    display: none;
    height: 2rem;
    border-radius: .375rem;
}

/* The small product tag next to the logo (PAMC Web shows "Web"). */
.app-brand-tag {
    padding: .125rem .375rem;
    border-radius: .25rem;
    background-color: var(--pamc-brand-600);
    color: #fff;
    font-size: .625rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.app-nav {
    display: flex;
    flex-direction: column;
    gap: .125rem;
    padding: .75rem;
    margin: 0;
    list-style: none;
}

.app-nav .nav-section {
    padding: .875rem .75rem .25rem;
    font-size: .6875rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--pamc-slate-400);
}

.app-nav .nav-section:first-child {
    padding-top: 0;
}

.app-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .4375rem .75rem;
    border-radius: .5rem;
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.25rem;
    color: #e2e8f0;
    white-space: nowrap;
}

.app-nav .nav-link .bi {
    flex-shrink: 0;
    font-size: 1.0625rem;
    line-height: 1;
    color: var(--pamc-slate-300);
}

.app-nav .nav-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-nav .nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, .1);
}

.app-nav .nav-link.active {
    color: #fff;
    background-color: var(--pamc-brand-600);
    box-shadow: var(--pamc-shadow-sm);
}

.app-nav .nav-link.active .bi {
    color: #fff;
}

.app-main {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.app-header {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    height: var(--app-header-height);
    padding: 0 1rem;
    background-color: #fff;
    border-bottom: 1px solid var(--pamc-slate-200);
}

.app-header > div:first-child {
    min-width: 0;
}

.app-header-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 1rem;
    font-weight: 600;
    color: var(--pamc-slate-800);
}

.app-content {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    width: 100%;
    overflow-y: auto;
    /* The scrollbar's room is always kept: a page that grows past the window (the task list after
       the Kanban, a filter that finds more) does not shift the layout sideways. */
    scrollbar-gutter: stable;
    padding: 1.5rem 1rem;
}

@media (min-width: 576px) {
    .app-header { padding: 0 1.5rem; }
    .app-content { padding: 1.5rem; }
    .app-footer { padding: 0 1.5rem; }
}

@media (min-width: 992px) {
    .app-shell { flex-direction: row; }
    /* A column: the logo on top and the collapse control at the foot stay in place; only the links
       scroll, and only on a window too short for all of them. */
    .app-sidebar > * { flex-shrink: 0; }
    .app-sidebar {
        display: flex;
        flex-direction: column;
        width: var(--app-sidebar-width);
        height: 100%;
        max-height: none;
        overflow: hidden;
    }
    .app-sidebar > .app-nav {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(255, 255, 255, .25) transparent;
    }
    .app-brand { display: flex; }
    .app-sidebar { transition: width .2s ease; }

    /* Collapsed (header button, remembered in the browser): only the icons; the name is the tooltip. */
    html.menu-collapsed {
        --app-sidebar-width: 4.5rem;
    }
    html.menu-collapsed .app-sidebar { overflow-x: hidden; }
    html.menu-collapsed .app-brand { justify-content: center; padding: 0; }
    html.menu-collapsed .app-brand-logo,
    html.menu-collapsed .app-brand-tag,
    html.menu-collapsed .app-nav .nav-text,
    html.menu-collapsed .app-sidebar-collapse .nav-text { display: none; }
    html.menu-collapsed .app-brand-icon { display: block; }
    html.menu-collapsed .app-nav { padding: .75rem .625rem; }
    html.menu-collapsed .app-nav .nav-link { justify-content: center; padding: .5rem 0; }
    /* Section titles become a thin line between the groups. */
    html.menu-collapsed .app-nav .nav-section {
        height: 0;
        margin: .5rem .25rem;
        padding: 0;
        overflow: hidden;
        border-top: 1px solid rgba(255, 255, 255, .15);
    }
    html.menu-collapsed .app-nav .nav-section:first-child { display: none; }
    html.menu-collapsed .app-sidebar-collapse { justify-content: center; padding: 0; }
    html.menu-collapsed .app-sidebar-collapse .bi { transform: rotate(180deg); }
}

@media (prefers-reduced-motion: reduce) {
    .app-sidebar, .app-sidebar-collapse .bi { transition: none !important; }
}

@media (min-width: 1400px) {
    .app-content { padding: 1.5rem 2.5rem; }
}

/* Dropdowns are rendered by Blazor (no Bootstrap JS / Popper): anchor them to the toggle. */
.dropdown-menu.show.dropdown-anchored {
    position: absolute;
    top: calc(100% + .25rem);
    right: 0;
    left: auto;
}

.click-catcher {
    position: fixed;
    inset: 0;
    z-index: 1000;
}

.notification-menu {
    width: 22rem;
    max-height: 26rem;
    overflow-y: auto;
}

/* ── Avatar ────────────────────────────────────────────────────────────── */
.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    font-size: .8rem;
    font-weight: 600;
}

.avatar-sm {
    width: 1.5rem;
    height: 1.5rem;
    font-size: .65rem;
}

.avatar-lg {
    width: 7rem;
    height: 7rem;
    font-size: 2.25rem;
}

/* Profile photo with the "change" button laid over its corner. */
.avatar-edit {
    position: relative;
    display: inline-block;
}

.avatar-edit .avatar-edit-btn {
    position: absolute;
    right: 0;
    bottom: 0;
}

/* A file input hidden from sight but not from the keyboard: Tab reaches it, Enter or Space opens
   the dialog, and the label that stands for it shows the focus. */
.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}

.file-input:focus-visible + .file-trigger,
.avatar-edit-btn:has(.file-input:focus-visible) {
    outline: 2px solid var(--pamc-brand-600);
    outline-offset: 2px;
}

/* ── Ticket conversation ───────────────────────────────────────────────── */
.chat-feed {
    max-height: calc(100vh - 21rem);
    min-height: 20rem;
    overflow-y: auto;
}

.chat-msg {
    max-width: 88%;
}

.chat-msg.mine {
    margin-left: auto;
    flex-direction: row-reverse;
}

.chat-bubble {
    background-color: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color-translucent);
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-msg.mine .chat-bubble {
    background-color: var(--bs-primary-bg-subtle);
    border-color: var(--bs-primary-border-subtle);
}

.chat-msg.internal .chat-bubble {
    background-color: var(--bs-warning-bg-subtle);
    border: 1px dashed var(--bs-warning-border-subtle);
}

.pre-wrap {
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Attachments ───────────────────────────────────────────────────────── */
.attachment-thumb {
    width: 9rem;
    height: 6.5rem;
    object-fit: cover;
}

.attachment-video {
    width: 20rem;
    max-width: 100%;
    background: #000;
}

/* ── Stage stepper (task progress shown on the ticket) ─────────────────── */
.stepper {
    display: flex;
    list-style: none;
    padding: 0;
    margin: .75rem 0 .25rem;
}

.stepper .step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.stepper .step::before {
    content: "";
    position: absolute;
    top: .7rem;
    left: -50%;
    width: 100%;
    height: 3px;
    background-color: var(--bs-border-color);
}

.stepper .step:first-child::before {
    display: none;
}

.stepper .step.done::before,
.stepper .step.current::before {
    background-color: var(--bs-success);
}

.stepper .dot {
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 50%;
    background-color: var(--bs-secondary-bg);
    border: 2px solid var(--bs-body-bg);
    color: var(--bs-white);
    font-size: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.stepper .step.done .dot {
    background-color: var(--bs-success);
}

.stepper .step.current .dot {
    background-color: var(--bs-primary);
    box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .25);
}

.stepper .label {
    font-size: .68rem;
    line-height: 1.2;
    margin-top: .3rem;
    color: var(--bs-secondary-color);
}

/* In narrow containers (e.g. the ticket sidebar) only the current stage keeps its label;
   the others show it as a tooltip. */
.stepper-wrap {
    container-type: inline-size;
}

@container (max-width: 36rem) {
    .stepper .step:not(.current) .label {
        display: none;
    }

    .stepper .step.current .label {
        white-space: nowrap;
    }
}

.stepper .step.current .label {
    color: var(--bs-primary);
    font-weight: 600;
}

/* ── Kanban ────────────────────────────────────────────────────────────── */
.board {
    display: grid;
    /* one column per stage, whatever their number */
    grid-auto-flow: column;
    grid-auto-columns: minmax(15rem, 1fr);
    gap: .75rem;
    overflow-x: auto;
    padding-bottom: .75rem;
    align-items: start;
}

.board-column {
    min-height: 20rem;
    border-top: 3px solid var(--accent, var(--bs-border-color));
    transition: box-shadow .15s, opacity .15s;
}

/* The background is dragged to move sideways (pamc.board, js/app.js); a card keeps its own cursor. */
.board.can-pan {
    cursor: grab;
}

.board.panning,
.board.panning * {
    cursor: grabbing !important;
    user-select: none;
}

.board-column.drop-ok {
    box-shadow: 0 0 0 .2rem rgba(var(--bs-primary-rgb), .45);
}

.board-column.drop-no {
    opacity: .5;
}

.task-card {
    cursor: pointer;
    border-left: 4px solid var(--accent, var(--bs-border-color));
}

.task-card[draggable="true"] {
    cursor: grab;
}

.task-card:hover {
    box-shadow: var(--bs-box-shadow-sm);
}

/* ── Hotfix: red stripes along the card (and the list row), on top of every column ── */
.task-card.hotfix {
    border-left-color: var(--bs-danger);
    background-image: repeating-linear-gradient(135deg, rgba(var(--bs-danger-rgb), .09) 0 8px, transparent 8px 16px);
    box-shadow: inset 0 0 0 1px var(--bs-danger-border-subtle);
}
.task-row.hotfix > td:first-child {
    box-shadow: inset 4px 0 0 var(--bs-danger);
    background-image: repeating-linear-gradient(135deg, rgba(var(--bs-danger-rgb), .09) 0 6px, transparent 6px 12px);
}
.hotfix-badge {
    color: #fff;
    background: repeating-linear-gradient(135deg, var(--bs-danger) 0 6px, #a52834 6px 12px);
}

/* ── Sign-in pages: PAMC navy, the logo swoosh drawn large and faint, a centered card ── */
/* One standard for every sign-in page (sign in, sign-up, codes, passwords): the card is
   28rem wide (40rem for the sign-up form) and never narrower than the screen allows, with the
   same padding scale; the language switch keeps its own strip at the top, so it never covers the
   logo, and a page taller than the screen grows (scrolls) instead of being cut. */
.auth-wrapper {
    --auth-width: 28rem;
    --auth-wide-width: 40rem;
    --auth-pad: 1.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 4rem 1rem 2rem;
    overflow-x: hidden;
    background-color: var(--pamc-brand-950);
}

@media (min-width: 576px) {
    .auth-wrapper { --auth-pad: 2.25rem; padding: 2.5rem 1.5rem; }
}

.auth-swoosh {
    position: absolute;
    inset: auto 0 0 0;
    width: 100%;
    height: 66%;
    color: var(--pamc-brand-600);
    pointer-events: none;
}

/* Always in the top corner; the wrapper keeps that strip free, so it never covers the logo. */
.auth-language {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 1;
}

.auth-main {
    position: relative;
    width: 100%;
    max-width: var(--auth-width);
}

/* A longer form (sign-up): more room, so the fields are not squeezed. */
.auth-main.auth-wide {
    max-width: var(--auth-wide-width);
}

.auth-card .card-body {
    padding: var(--auth-pad);
}

.auth-section-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--pamc-slate-500, #64748b);
    margin-bottom: .75rem;
}

/* A section reached from a link (e.g. the estimated time → the Estimate card) flashes briefly. */
.card.flash {
    box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .35);
    transition: box-shadow .3s ease;
}

.estimate-link {
    cursor: pointer;
}

/* Estimate: the time field keeps a fixed width (h:mm), the description takes the rest. */
@media (min-width: 768px) {
    .estimate-time {
        width: 9.5rem;
    }
}

.estimate-hours {
    min-width: 4rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.estimate-total {
    background: var(--bs-tertiary-bg);
    font-weight: 600;
}

/* Lines up the total with the times above it (the room of the edit / remove buttons). */
.estimate-actions-space {
    width: 3.25rem;
}

/* Password rules, ticked while typing (PasswordRules.razor + app.js). */
.password-rules {
    list-style: none;
    padding: 0;
    margin: .5rem 0 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
    gap: .25rem .75rem;
    font-size: .8rem;
    color: var(--bs-secondary-color);
}

.password-rules li {
    display: flex;
    align-items: center;
    gap: .4rem;
    transition: color .15s ease;
}

.password-rules li.met {
    color: var(--bs-success);
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1.5rem;
}

.auth-brand img {
    height: 3rem;
    width: auto;
}

@media (min-width: 576px) {
    .auth-brand { margin-bottom: 2rem; }
    .auth-brand img { height: 4rem; }
}

.auth-brand-tag {
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .3em;
    text-transform: uppercase;
    color: var(--pamc-brand-300);
}

.auth-card .card {
    border: 0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .25), 0 8px 10px -6px rgba(0, 0, 0, .2);
}

.auth-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--pamc-slate-900);
    margin: 0;
}

/* Language switch on the navy background. */
.btn-group.on-dark .btn {
    --bs-btn-color: #e2e8f0;
    --bs-btn-bg: transparent;
    --bs-btn-border-color: rgba(255, 255, 255, .25);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: rgba(255, 255, 255, .1);
    --bs-btn-hover-border-color: rgba(255, 255, 255, .35);
}

.btn-group.on-dark .btn.btn-primary {
    --bs-btn-bg: var(--pamc-brand-600);
    --bs-btn-border-color: var(--pamc-brand-600);
    --bs-btn-color: #fff;
}

/* ── Blazor error UI ───────────────────────────────────────────────────── */
#blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
}

.blazor-error-boundary {
    background: var(--bs-danger);
    color: var(--bs-white);
    padding: 1rem;
    border-radius: var(--bs-border-radius);
}

.blazor-error-boundary::after {
    content: "An error occurred while displaying this component.";
}

/* ── Telemetry charts (dataviz method: thin marks, 4px rounded data-ends, recessive grid;
   categorical slots validated with the skill's validator on the white card surface) ── */
.viz {
    --viz-1: #2a78d6;          /* categorical slot 1 (blue)   */
    --viz-2: #eb6834;          /* categorical slot 2 (orange) */
    --viz-grid: #e2e8f0;       /* one step off the surface    */
    --viz-track: #eff6ff;      /* lighter step of the blue ramp, meter track */
    --status-good: #0ca30c;
    --status-warning: #fab219;
    --status-critical: #d03b3b;
}

.stat-label { font-size: .8125rem; color: var(--pamc-slate-600); }
.stat-value { font-size: 1.75rem; font-weight: 600; line-height: 1.2; color: var(--pamc-slate-900); }
.stat-note { font-size: .75rem; color: var(--pamc-slate-500); }
.stat-status-critical { color: var(--status-critical); }

.viz-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .8125rem; color: var(--pamc-slate-600); }
.viz-key { display: inline-block; width: .75rem; height: .75rem; border-radius: 2px; margin-right: .375rem; vertical-align: -1px; }

/* Horizontal bars: <= 24px thick, square at the baseline, 4px rounded data-end, value at the tip. */
.hbar-row { display: grid; grid-template-columns: minmax(7rem, 9rem) 1fr; align-items: center; gap: .75rem; padding: .25rem 0; }
.hbar-label { font-size: .8125rem; color: var(--pamc-slate-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar-track { display: flex; align-items: center; gap: .5rem; min-width: 0; }
.hbar { height: 16px; border-radius: 0 4px 4px 0; background: var(--viz-1); min-width: 2px; transition: filter .15s; }
.hbar:hover, .hbar-row:focus-visible .hbar { filter: brightness(1.12); }
.hbar-row:focus-visible { outline: 2px solid var(--pamc-brand-500); outline-offset: 2px; border-radius: .25rem; }
.hbar-value { font-size: .8125rem; color: var(--pamc-slate-600); font-variant-numeric: tabular-nums; }

/* Columns (SVG). */
.viz-svg { width: 100%; height: auto; display: block; }
.viz-svg text { font-family: var(--bs-body-font-family); fill: var(--pamc-slate-500); font-size: 11px; }
.viz-svg .grid { stroke: var(--viz-grid); stroke-width: 1; }
.viz-svg .col-1 { fill: var(--viz-1); }
.viz-svg .col-2 { fill: var(--viz-2); }
.viz-svg .hit { fill: transparent; cursor: default; }
.viz-svg g.bucket:hover .hit, .viz-svg g.bucket:focus .hit { fill: rgba(15, 23, 42, .04); }
.viz-svg g.bucket:focus { outline: none; }

/* Meter: severity fill on a lighter step of the same ramp. */
.meter { height: 8px; border-radius: 4px; background: var(--viz-track); overflow: hidden; min-width: 4rem; }
.meter > span { display: block; height: 100%; border-radius: 4px; }
.meter-ok { background: var(--viz-1); }
.meter-warning { background: var(--status-warning); }
.meter-critical { background: var(--status-critical); }

.viz-loading { opacity: .55; transition: opacity .15s; }

/* Planning timeline (Gantt grouped by person): one row per task with its code and title, its
   pieces as bars (the telemetry's categorical slots), late tasks in the critical status colour with
   how late after the bar, the due date as a diamond on the task's row, days off shaded, absences
   hatched, today a dashed line. */
.planning-scroll { overflow-x: auto; }
.planning-timeline { width: auto; }
.planning-timeline .pl-person { fill: #f8fafc; }
.planning-timeline .pl-name { font-size: 12px; font-weight: 600; fill: var(--pamc-slate-900); }
.planning-timeline .pl-hours { font-size: 11px; }
.planning-timeline .pl-empty { font-size: 11px; font-style: italic; }
.planning-timeline .pl-code { font-family: var(--bs-font-monospace); font-size: 11px; fill: var(--pamc-slate-700); }
.planning-timeline .pl-title { font-size: 11px; fill: var(--pamc-slate-700); }
.planning-timeline a { text-decoration: none; }
.planning-timeline a:hover .pl-code, .planning-timeline a:hover .pl-title { fill: var(--pamc-brand-500, #2a78d6); text-decoration: underline; }
.planning-timeline .pl-day { font-size: 10px; }
.planning-timeline .pl-bar { stroke: rgba(15, 23, 42, .15); stroke-width: 1; }
.planning-timeline a:hover .pl-bar, .planning-timeline a:focus .pl-bar { filter: brightness(1.12); }
.planning-timeline .pl-late-text { fill: var(--status-critical); font-size: 11px; font-weight: 600; }
.planning-timeline .pl-due-line { stroke: var(--pamc-slate-900); stroke-width: 1; stroke-dasharray: 2 2; }
.pl-due { fill: var(--pamc-slate-900); stroke: #fff; stroke-width: 1.5; }
.planning-timeline .pl-today { stroke: var(--status-critical); stroke-width: 1.5; stroke-dasharray: 4 3; }
.planning-timeline .pl-absent { fill: rgba(100, 116, 139, .22); }
.pl-dev { fill: var(--viz-1); background: var(--viz-1); }
.pl-review { fill: var(--viz-2); background: var(--viz-2); }
.pl-test { fill: #64748b; background: #64748b; }
.pl-late, .planning-timeline .pl-bar.pl-late { fill: var(--status-critical); background: var(--status-critical); }
.pl-off { fill: #f1f5f9; background: #f1f5f9; border: 1px solid #e2e8f0; }
.pl-absent-key { background: rgba(100, 116, 139, .35); }
.pl-today-key { width: 2px !important; background: var(--status-critical); }
.planning-load .meter { min-width: 3.5rem; }

/* Stand-up brief (telemetry): compact task rows grouped by stage. */
.brief-stage {
    margin: 1rem 0 .25rem;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--pamc-slate-600);
}
.brief-stage:first-of-type { margin-top: 0; }
.brief-task {
    padding: .5rem .75rem;
    margin-bottom: .375rem;
    border: 1px solid var(--pamc-slate-200);
    border-left: 3px solid var(--pamc-slate-300);
    border-radius: .5rem;
    font-size: .875rem;
}
.brief-task.is-late { border-left-color: var(--status-critical, #d03b3b); }
.brief-task.is-blocked { border-left-color: var(--status-critical, #d03b3b); background: #fef2f2; }
.brief-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem 1rem;
    margin-top: .25rem;
    font-size: .8125rem;
    color: var(--pamc-slate-600);
}
.brief-note { margin-top: .25rem; font-size: .8125rem; color: var(--pamc-slate-700); }

/* Authenticator setup: the QR code scales to its frame. */
.totp-qr { width: 12rem; height: 12rem; flex-shrink: 0; }
.totp-qr svg { display: block; width: 100%; height: 100%; }

/* ── Versions ─────────────────────────────────────────────────────────── */
.version-tag {
    font-family: var(--bs-font-monospace); font-weight: 600; font-size: 1.05rem;
    padding: .35rem .7rem; border-radius: .5rem; white-space: nowrap;
    background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis);
    border: 1px solid var(--bs-primary-border-subtle);
}
/* released (closed): delivered, so green — not greyed out */
.version-tag.closed {
    background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); border-color: var(--bs-success-border-subtle);
}

/* ── Searchable select (SearchSelect.razor) ───────────────────────────── */
.pick { position: relative; }
.pick-toggle { min-height: calc(1.5em + .75rem + 2px); min-width: 10rem; }
.pick-menu {
    position: absolute; z-index: 1060; top: calc(100% + 2px); left: 0; right: 0; min-width: 16rem;
    background: var(--bs-body-bg); border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius);
}
.pick-list { max-height: 16rem; overflow-y: auto; overscroll-behavior: contain; }
.pick-item {
    display: flex; align-items: baseline; gap: .5rem; padding: .45rem .75rem; cursor: pointer; font-size: .9rem;
}
.pick-item.active { background: var(--bs-primary-bg-subtle); color: var(--bs-primary-text-emphasis); }
.pick-item.selected { font-weight: 600; }
.pick-item > span { flex: 0 1 auto; min-width: 0; }
.pick-hint { flex: 1 1 0; min-width: 3rem; color: var(--bs-secondary-color); font-weight: 400; }
.pick-note { padding: .5rem .75rem; font-size: .8rem; color: var(--bs-secondary-color); text-align: center; }

/* ── Choice cards (ImpactPicker.razor): a radio group laid out as cards ── */
/* The grid follows its own width, not the window's: 4 columns when they fit, else 2, else 1 —
   never 3 + 1, which leaves one card alone. */
.choice-wrap { container-type: inline-size; }
.choice-grid {
    display: grid; grid-template-columns: 1fr;
    gap: .75rem; margin: 0; padding: 0; border: 0; min-width: 0;
}
@container (min-width: 32rem) { .choice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (min-width: 58rem) { .choice-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.choice { position: relative; display: flex; min-width: 0; }
.choice-card {
    display: flex; flex-direction: column; gap: .35rem; width: 100%; margin: 0;
    padding: .875rem 1rem; border: 1px solid var(--bs-border-color); border-radius: .75rem;
    background: var(--bs-body-bg); cursor: pointer; text-align: left;
    transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.choice-card:hover { border-color: var(--choice); }
.choice-title { display: flex; align-items: center; gap: .5rem; font-weight: 600; color: var(--choice-text); line-height: 1.3; }
.choice-title > .bi:first-child { font-size: 1.25rem; color: var(--choice); flex: none; }
.choice-check { margin-left: auto; color: var(--choice); flex: none; }
.choice-help { font-size: .8125rem; line-height: 1.4; color: var(--bs-secondary-color); overflow-wrap: anywhere; }
.btn-check:checked + .choice-card {
    border-color: var(--choice); background: var(--choice-bg); box-shadow: inset 0 0 0 1px var(--choice);
}
.btn-check:checked + .choice-card .choice-help { color: var(--choice-text); }
.btn-check:focus-visible + .choice-card { outline: 0; box-shadow: 0 0 0 .25rem rgba(var(--bs-primary-rgb), .25); }

/* Form actions: full-width and stacked (main action first) on a phone, side by side above. */
.form-actions { display: flex; flex-direction: column-reverse; gap: .5rem; }
@media (min-width: 576px) { .form-actions { flex-direction: row; justify-content: flex-end; } }

/* ── @mentions ────────────────────────────────────────────────────────── */
.mention-box { position: relative; }
.mention-menu { top: calc(100% + 2px); left: 0; right: auto; width: min(24rem, 100%); }
.mention {
    color: var(--bs-primary-text-emphasis); background: var(--bs-primary-bg-subtle);
    border-radius: .25rem; padding: 0 .2rem; font-weight: 600; white-space: nowrap;
}
.mention.me { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }

/* ── Forms in sections (UserFields: the same on every screen) ─────────── */
.form-section + .form-section { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--bs-border-color-translucent); }
.form-section-title {
    display: flex; align-items: center; gap: .4rem; margin-bottom: .85rem;
    font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--bs-secondary-color);
}
.form-notice {
    display: flex; gap: .65rem; align-items: flex-start; margin-top: 1.25rem; padding: .75rem 1rem; border-radius: var(--bs-border-radius);
    background: var(--bs-primary-bg-subtle); border: 1px solid var(--bs-primary-border-subtle); color: var(--bs-primary-text-emphasis); font-size: .875rem;
}
.form-notice > .bi { font-size: 1.1rem; line-height: 1.2; }

/* ── Sensitive tickets / restricted tasks ─────────────────────────────── */
.sensitive-badge {
    display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .6rem; border-radius: 999px;
    background: var(--bs-danger); color: #fff; font-size: .75rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; vertical-align: middle;
}
.sensitive-badge.small-badge { padding: .1rem .45rem; font-size: .65rem; margin-right: .35rem; }
.sensitive-banner {
    display: flex; align-items: flex-start; gap: .75rem; padding: .85rem 1rem; border-radius: var(--bs-border-radius);
    background: repeating-linear-gradient(-45deg, var(--bs-danger-bg-subtle) 0 12px, transparent 12px 24px), var(--bs-body-bg);
    border: 1px solid var(--bs-danger-border-subtle); border-left: .3rem solid var(--bs-danger); color: var(--bs-danger-text-emphasis);
}
.sensitive-banner > .bi { font-size: 1.5rem; line-height: 1; color: var(--bs-danger); }
.task-card.restricted { box-shadow: inset 0 0 0 2px var(--bs-danger-border-subtle); }
/* On a board card the badges line up on the right edge, under the priority (no trailing margin). */
.board-card-badges .sensitive-badge { margin-right: 0; }
/* A dialog creating something restricted: its header says so before anything is saved. */
.modal-header.restricted-header {
    background: repeating-linear-gradient(-45deg, var(--bs-danger-bg-subtle) 0 12px, transparent 12px 24px), var(--bs-body-bg);
    border-top: .3rem solid var(--bs-danger); border-bottom-color: var(--bs-danger-border-subtle); color: var(--bs-danger-text-emphasis);
}
.modal-header.restricted-header .modal-title > .bi { color: var(--bs-danger); }

/* ── [attachment] references in descriptions ──────────────────────────── */
.attachment-refs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.attachment-ref {
    display: inline-flex; align-items: center; gap: .25rem; padding: .1rem .5rem; border-radius: 999px;
    background: var(--bs-secondary-bg); border: 1px solid var(--bs-border-color); text-decoration: none; color: var(--bs-body-color);
}
.attachment-ref:hover { border-color: var(--bs-primary); color: var(--bs-primary); }
.attachment-ref.missing { background: var(--bs-warning-bg-subtle); border-color: var(--bs-warning-border-subtle); color: var(--bs-warning-text-emphasis); }

/* ── Test plan ────────────────────────────────────────────────────────── */
.test-case { border-left-width: .25rem !important; }
.test-case.passed { border-left-color: var(--bs-success) !important; }
.test-case.failed { border-left-color: var(--bs-danger) !important; }
.test-case.blocked { border-left-color: var(--bs-warning) !important; }
.test-num {
    flex: 0 0 auto; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--bs-secondary-bg); font-size: .75rem; font-weight: 700;
}
.min-w-0 { min-width: 0; }
.access-chip {
    display: inline-flex; align-items: center; gap: .15rem; padding: .05rem .35rem; border-radius: .375rem;
    border: 1px solid var(--bs-border-color); background: var(--bs-body-bg); font-size: .72rem;
}
.access-chip code { color: var(--bs-body-color); margin-right: .25rem; }
.access-chip .right {
    width: 1.05rem; text-align: center; border-radius: .2rem; font-weight: 700; color: var(--bs-tertiary-color); background: var(--bs-tertiary-bg);
}
.access-chip .right.on { color: #fff; background: var(--bs-primary); }

/* ── Release notes ── */
.release-notes { padding-left: 1.1rem; }
.release-notes li { margin-bottom: .25rem; }

/* Ticket list: the row opens the ticket; its title is the real link (keyboard, middle-click). */
.ticket-row, .task-row { cursor: pointer; }
.ticket-row a:focus-visible, .task-row a:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; border-radius: .2rem; }

/* ── Filter bars (task list, ticket list, Kanban) ───────────────────────────────────────────
   Search on top; the selects in an even grid, each with a visible label; quick filters as
   toggle chips (aria-pressed, with a check mark: not color alone). On narrow screens the fields
   fold behind a "Filters" button that says how many are on. */
.filter-bar {
    padding: 1rem 1.25rem;
    border-color: var(--pamc-slate-200);
    box-shadow: var(--pamc-shadow-sm);
}

.filter-top {
    display: flex;
    gap: .75rem;
    align-items: center;
}

.filter-top .filter-search {
    flex: 1 1 auto;
    min-width: 0;
}

.filter-search .input-group-text {
    background: #fff;
    color: var(--pamc-slate-500);
}

.filter-search .form-control {
    border-left: 0;
}

.filter-label {
    display: block;
    margin-bottom: .375rem;
    font-size: .75rem;
    font-weight: 600;
    color: var(--pamc-slate-600);
}

.filter-fields {
    display: none;
    margin-top: 1rem;
}

.filter-fields.show {
    display: block;
}

.filter-fields .pick-toggle {
    min-width: 0;
}

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--pamc-slate-100);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    min-height: 2.25rem;
    padding: .375rem .875rem;
    border: 1px solid var(--pamc-slate-300);
    border-radius: 999px;
    background: #fff;
    color: var(--pamc-slate-700);
    font-size: .8125rem;
    font-weight: 500;
    line-height: 1.2;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.filter-chip:hover {
    border-color: var(--pamc-slate-400);
    background: var(--pamc-slate-50);
}

.filter-chip[aria-pressed="true"] {
    border-color: var(--pamc-brand-600);
    background: var(--pamc-brand-50);
    color: var(--pamc-brand-700);
}

.filter-chip .filter-chip-check {
    display: none;
}

.filter-chip[aria-pressed="true"] .filter-chip-check {
    display: inline;
}

.filter-chip:focus-visible,
.filter-clear:focus-visible {
    outline: 2px solid var(--pamc-brand-600);
    outline-offset: 2px;
}

.filter-clear {
    margin-left: auto;
    padding: .375rem .5rem;
    border: 0;
    background: none;
    color: var(--pamc-brand-600);
    font-size: .8125rem;
    font-weight: 500;
}

.filter-clear:hover {
    color: var(--pamc-brand-800);
    text-decoration: underline;
}

@media (min-width: 768px) {
    .filter-fields { display: block; }
    .filter-toggle { display: none !important; }
    /* The tasks (Kanban and list) and the tickets keep their height for the work: the fields fold
       under "Filters" at every width. */
    .filter-bar-collapsible .filter-fields { display: none; }
    .filter-bar-collapsible .filter-fields.show { display: block; }
    .filter-bar-collapsible .filter-toggle { display: inline-flex !important; }
}

@media (prefers-reduced-motion: reduce) {
    .filter-chip { transition: none; }
}

/* ── Dashboard (home page) ──────────────────────────────────────────────────────────────────
   Stat tiles: the label in sentence case, the value in semibold sans; the tone (warning /
   danger) only when there is something to act on, always with an icon and a label. Lists:
   a few rows and "See all". Meters for the versions: the fill on a lighter step of the same hue. */
.dash-section {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: .5rem 0 1rem;
    font-size: .8125rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--pamc-slate-500);
}

.dash-tile {
    border-color: var(--pamc-slate-200);
    box-shadow: var(--pamc-shadow-sm);
    color: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}

a.dash-tile:hover {
    border-color: var(--pamc-brand-300);
    box-shadow: 0 2px 8px rgba(15, 23, 42, .08);
}

a.dash-tile:focus-visible {
    outline: 2px solid var(--pamc-brand-600);
    outline-offset: 2px;
}

.dash-tile .card-body {
    padding: 1rem 1.125rem;
}

.dash-tile-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: .75rem;
    background: var(--pamc-slate-100);
    color: var(--pamc-slate-500);
    font-size: 1.25rem;
}

.dash-tile-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
    color: var(--pamc-slate-900);
}

.dash-tile-label {
    display: block;
    margin-top: .125rem;
    font-size: .8125rem;
    color: var(--pamc-slate-600);
}

.dash-tile-hint {
    display: block;
    font-size: .75rem;
    color: var(--pamc-slate-500);
}

.dash-tile-primary .dash-tile-icon { background: var(--pamc-brand-50); color: var(--pamc-brand-600); }
.dash-tile-warning .dash-tile-icon { background: var(--bs-warning-bg-subtle); color: var(--bs-warning-text-emphasis); }
.dash-tile-danger .dash-tile-icon { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); }
.dash-tile-danger .dash-tile-value { color: var(--bs-danger-text-emphasis); }

.dash-card {
    border-color: var(--pamc-slate-200);
    box-shadow: var(--pamc-shadow-sm);
}

.dash-card .card-header {
    padding: .75rem 1rem;
}

.dash-row {
    padding: .625rem 1rem;
}

.dash-row a:focus-visible {
    outline: 2px solid var(--pamc-brand-600);
    outline-offset: 2px;
    border-radius: .2rem;
}

.dash-meter {
    height: .5rem;
    border-radius: 999px;
    background: var(--pamc-brand-100);
}

.dash-meter .progress-bar {
    border-radius: 999px;
    background: var(--pamc-brand-600);
}

@media (prefers-reduced-motion: reduce) {
    .dash-tile { transition: none; }
}

/* The card's title is its link: the focus ring shows on the whole card. */
.task-card:has(.task-card-link:focus-visible) {
    outline: 2px solid var(--pamc-brand-600);
    outline-offset: 2px;
}
.task-card-link:focus-visible { outline: none; }

.cursor-pointer { cursor: pointer; }

/* ── Integrations (Settings → Integrations, the profile's chat accounts) ───────────────────────
   Each platform with its own colour on a soft tile; the forms open under their row. */
.integration-logo {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 2.25rem; height: 2.25rem; border-radius: .5rem; font-size: 1.15rem;
}
.integration-logo-slack { background: #f4ecf7; color: #4a154b; }
.integration-logo-teams { background: #ecebfa; color: #4b53bc; }
.integration-logo-discord { background: #eceefe; color: #5865f2; }
.integration-icon-slack { color: #4a154b; }
.integration-icon-teams { color: #4b53bc; }
.integration-icon-discord { color: #5865f2; }
.integration-help summary { cursor: pointer; color: var(--pamc-brand-600); }
.integration-help ol { padding-left: 1.1rem; }
.integration-help li + li { margin-top: .25rem; }
.min-w-0 { min-width: 0; }
/* the forms and buttons of a chat account line up with its name, not under its logo */
@media (min-width: 576px) { .chat-account-body { margin-left: 3.25rem; } }

/* Recovery codes (shown once, in the acknowledge dialog). */
.recovery-codes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)); /* 10 codes: 5 even rows */
    gap: .5rem;
}

.recovery-code {
    padding: .375rem .5rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .375rem;
    background-color: var(--bs-tertiary-bg);
    text-align: center;
    user-select: all;
}

/* Notification bell: the unread count on the bell's top right, close to it. */
.bell-icon {
    position: relative;
    display: inline-flex;
    line-height: 1;
}

/* (.bell-icon first: Bootstrap's ".btn .badge" would make it relative again) */
.bell-icon .bell-count {
    position: absolute;
    top: -.4rem;
    left: calc(100% - .55rem);
    min-width: 1.125rem;
    height: 1.125rem;
    padding: 0 .3rem;
    font-size: .625rem;
    font-weight: 700;
    line-height: calc(1.125rem - 4px);
    border: 2px solid var(--bs-body-bg);
}

/* The task rules' warnings: no gap left under them when they end the dialog. */
.move-warnings:last-child {
    margin-bottom: 0;
}

/* A test case withdrawn (kept as evidence): faded, its title struck through. */
.test-case.withdrawn { opacity: .7; }
.test-case.withdrawn .fw-semibold.small { text-decoration: line-through; }

/* The original email a ticket was opened from (team only): folded in the conversation. */
.original-email summary { cursor: pointer; }
.original-email summary::marker { color: var(--bs-warning-text-emphasis); }

/* The evolution reports' schedule: the icon sits on the first line of text, whatever wraps below. */
.evolution-schedule { line-height: 1.5; }
.evolution-schedule > .bi { line-height: inherit; }

/* "… is typing" below a ticket's last message: three dots that come and go. */
.typing-indicator { padding: .15rem .25rem; }
.typing-dots { display: inline-flex; gap: 3px; }
.typing-dots span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--bs-secondary-color);
    animation: typing-dot 1.2s infinite ease-in-out both;
}
.typing-dots span:nth-child(2) { animation-delay: .15s; }
.typing-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-dot {
    0%, 80%, 100% { opacity: .25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
    .typing-dots span { animation: none; opacity: .6; }
}

/* ── Skip link: hidden until the keyboard reaches it ──────────────────── */
.skip-link {
    position: absolute;
    left: .5rem;
    top: -3rem;
    z-index: 2000;
    padding: .5rem 1rem;
    border-radius: .5rem;
    background: var(--bs-primary);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
}

.skip-link:focus {
    top: .5rem;
    color: #fff;
}

#main-content:focus {
    outline: none;
}

/* ── Documentation ─────────────────────────────────────────────────────── */
.doc-books {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
    gap: 1rem;
    margin: 0;
}

.doc-book {
    transition: box-shadow .15s, border-color .15s;
}

.doc-book:hover,
.doc-book:focus-visible {
    border-color: var(--bs-primary);
    box-shadow: var(--bs-box-shadow-sm);
}

.doc-book-icon {
    font-size: 1.5rem;
    color: var(--bs-primary);
    line-height: 1;
}

/* Tree | page | its contents; the tree above the page on a narrow screen, the contents only when wide. */
.doc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

@media (min-width: 992px) {
    .doc-layout { grid-template-columns: 15rem minmax(0, 1fr); }
    .doc-tree { position: sticky; top: 0; max-height: calc(100dvh - 9rem); overflow-y: auto; }
    /* Wide: the pages are always shown. */
    .doc-tree .doc-tree-pages { display: block; }
    .doc-tree .doc-tree-toggle { display: none; }
}

@media (min-width: 1400px) {
    .doc-layout { grid-template-columns: 15rem minmax(0, 1fr) 13rem; }
}

.doc-toc { display: none; }

@media (min-width: 1400px) {
    .doc-toc { display: block; position: sticky; top: 0; font-size: .85rem; }
}

.doc-tree-title {
    font-weight: 600;
    padding: .25rem .5rem;
}

.doc-tree-pages { display: none; margin-top: .5rem; }
.doc-tree-pages.open { display: block; }

.doc-tree-list {
    list-style: none;
    margin: 0;
    padding-left: 0;
}

.doc-tree-list .doc-tree-list {
    padding-left: .85rem;
    border-left: 1px solid var(--bs-border-color);
    margin-left: .5rem;
}

.doc-tree-link {
    display: block;
    padding: .3rem .5rem;
    border-radius: .375rem;
    color: var(--bs-body-color);
    text-decoration: none;
    font-size: .9rem;
    line-height: 1.3;
}

.doc-tree-link:hover {
    background: var(--bs-tertiary-bg);
}

.doc-tree-link.active {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
    font-weight: 600;
}

/* The page: a comfortable line length, the editor's styles. */
.doc-content {
    max-width: 48rem;
}

.doc-body {
    line-height: 1.65;
    /* Only a word too long for its line breaks (anywhere would let a table squeeze its columns into
       broken words). */
    overflow-wrap: break-word;
}

.doc-body h2 { font-size: 1.35rem; margin-top: 2rem; scroll-margin-top: 1rem; }
.doc-body h3 { font-size: 1.1rem; margin-top: 1.5rem; scroll-margin-top: 1rem; }
/* A picture in a sentence or a table (a button's icon) sits on the line; a picture on its own (a
   screenshot) is a framed block. */
.doc-body img { max-width: 100%; height: auto; vertical-align: middle; }
.doc-body p > img:only-child,
.doc-body > img { display: block; margin: .75rem 0; border: 1px solid var(--bs-border-color); border-radius: .5rem; box-shadow: var(--bs-box-shadow-sm); }
.doc-body td img, .doc-body th img { box-shadow: none; }
.doc-body table { width: 100%; margin-bottom: 1rem; border-collapse: collapse; display: block; overflow-x: auto; }
.doc-body th, .doc-body td { border: 1px solid var(--bs-border-color); padding: .4rem .6rem; vertical-align: top; }
.doc-body th { background: var(--bs-tertiary-bg); }
.doc-body pre { background: var(--bs-tertiary-bg); padding: .75rem 1rem; border-radius: .375rem; overflow-x: auto; }
.doc-body blockquote { border-left: 4px solid var(--bs-border-color); padding-left: 1rem; color: var(--bs-secondary-color); }
.doc-body .doc-note,
.doc-body .doc-warning { border-left: 4px solid var(--bs-info); background: var(--bs-info-bg-subtle); padding: .75rem 1rem; border-radius: .375rem; margin-bottom: 1rem; }
.doc-body .doc-warning { border-left-color: var(--bs-warning); background: var(--bs-warning-bg-subtle); }

.doc-toc-title {
    font-weight: 600;
    margin-bottom: .5rem;
}

.doc-toc ul {
    list-style: none;
    padding-left: 0;
    border-left: 1px solid var(--bs-border-color);
}

.doc-toc a {
    display: block;
    padding: .2rem .75rem;
    color: var(--bs-secondary-color);
    text-decoration: none;
}

.doc-toc a:hover { color: var(--bs-primary); }
.doc-toc .doc-toc-sub a { padding-left: 1.5rem; }

.doc-pager {
    display: flex;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bs-border-color);
}

.doc-pager-link {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .6rem .9rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .5rem;
    text-decoration: none;
    color: var(--bs-body-color);
    max-width: 48%;
}

.doc-pager-link:hover { border-color: var(--bs-primary); }

/* Printing a page prints the page only. */
@media print {
    .app-sidebar, .app-header, .app-footer, .app-banner, .skip-link, .doc-print-hide { display: none !important; }
    .app-content { overflow: visible !important; padding: 0 !important; }
    .doc-layout { display: block; }
    .doc-content { max-width: none; }
    .doc-body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .8em; }
}

/* ── Documentation editor ─────────────────────────────────────────────── */
.doc-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bs-body-bg);
}

.doc-toolbar .btn.active {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-primary-text-emphasis);
    border-color: var(--bs-primary-border-subtle);
}

.doc-editor-host .doc-editor-area {
    min-height: 24rem;
    padding: 1rem 1.25rem;
    outline: none;
}

.doc-editor-host .doc-editor-area:focus-visible {
    box-shadow: inset 0 0 0 .2rem rgba(var(--bs-primary-rgb), .35);
}

/* The placeholder of an empty editor. */
.doc-editor-area p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    float: left;
    height: 0;
    color: var(--bs-secondary-color);
    pointer-events: none;
}

.doc-editor-area img.ProseMirror-selectednode {
    outline: 3px solid var(--bs-primary);
}

.doc-editor-area table { display: table; }
.doc-editor-area .selectedCell { background: var(--bs-primary-bg-subtle); }
.doc-editor-area .ProseMirror-gapcursor:after { border-top-color: var(--bs-body-color); }
.doc-body .doc-note > :last-child,
.doc-body .doc-warning > :last-child { margin-bottom: 0; }

/* Book settings: the icon choices; a page's history: the comparison. */
.doc-icons { display: flex; flex-wrap: wrap; gap: .35rem; }
.doc-icons .btn { width: 2.5rem; }
.list-group-item.active-soft { background: var(--bs-primary-bg-subtle); }
.doc-diff { border: 1px solid var(--bs-border-color); border-radius: .375rem; padding: .5rem; display: flex; flex-direction: column; gap: .25rem; }
.doc-diff-line { display: block; padding: .25rem .5rem; border-radius: .25rem; text-decoration: none; overflow-wrap: anywhere; }
.doc-diff-line.removed { background: var(--bs-danger-bg-subtle); color: var(--bs-danger-text-emphasis); text-decoration: line-through; }
.doc-diff-line.added { background: var(--bs-success-bg-subtle); color: var(--bs-success-text-emphasis); }
.doc-diff-line.removed::before { content: "− "; }
.doc-diff-line.added::before { content: "+ "; }

/* Documentation search results. */
.doc-results { max-width: 48rem; }
.doc-result { padding: .75rem 0; border-bottom: 1px solid var(--bs-border-color); }
.doc-result-title { font-weight: 600; font-size: 1.05rem; }
.doc-result mark { padding: 0 .1em; background: var(--bs-warning-bg-subtle); color: inherit; }

/* The import's plan: a finding's label, then the page it matches. */
.doc-plan td .badge { margin-right: .4rem; }

/* Actions: the short Kanban (three columns, as wide as the page) of the tasks' cards. */
.action-board { grid-auto-columns: minmax(16rem, 1fr); }

/* ── The customer on the move: phones and tablets ────────────────────────
   The full portal is for the team at a desk. A customer below lg (a phone, a tablet upright) has a
   bar at the bottom with their places (MainLayout) in place of the menu and the footer; their
   tickets as cards (TicketList); a photo straight from the camera (FilePicker). */
.app-tabbar {
    display: none;
}

/* Clear of a phone's notch and rounded corners (the viewport covers the whole screen). */
.app-shell {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

@media (max-width: 991.98px) {
    .client-ui .app-footer { display: none; }

    .client-ui .app-tabbar {
        display: flex;
        flex-shrink: 0;
        align-items: stretch;
        background-color: #fff;
        border-top: 1px solid var(--pamc-slate-200);
        box-shadow: 0 -2px 8px rgba(15, 23, 42, .04);
        /* Above the phone's home bar. */
        padding-bottom: env(safe-area-inset-bottom);
    }

    .client-ui .app-content { padding-bottom: 1rem; }
}

/* Each place: an icon and its name, at least 44px to the thumb. */
.app-tab {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .2rem;
    min-width: 0;
    min-height: 3.5rem;
    padding: .375rem .25rem;
    color: var(--pamc-slate-600);
    font-size: .75rem;
    font-weight: 500;
    line-height: 1.1;
    text-align: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

.app-tab > span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-tab .bi {
    font-size: 1.375rem;
    line-height: 1;
}

.app-tab:hover { color: var(--pamc-slate-900); }

.app-tab.active {
    color: var(--pamc-brand-600);
    font-weight: 600;
}

.app-tab:focus-visible {
    outline: 2px solid var(--pamc-brand-600);
    outline-offset: -4px;
    border-radius: .5rem;
}

/* A new ticket: the one action, in the middle, in the brand's colour. */
.app-tab-new .bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 1.875rem;
    border-radius: 999px;
    background-color: var(--pamc-brand-600);
    color: #fff;
    font-size: 1.25rem;
}

.app-tab-new.active .bi { background-color: var(--pamc-brand-800); }

/* A customer's tickets on a phone: one card each, the whole card to tap. */
.ticket-card-item {
    padding: .875rem 1rem;
}

.ticket-card-item.critical {
    box-shadow: inset 4px 0 0 var(--bs-danger);
}

.ticket-card-top {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    color: var(--bs-secondary-color);
    font-size: .8125rem;
}

.ticket-card-title {
    margin: .125rem 0 .5rem;
    color: var(--bs-body-color);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.ticket-card-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .375rem .5rem;
    min-width: 0;
}

/* "Take a photo": only where there is a camera at hand (a touch screen). */
.file-camera { display: none; }

@media (pointer: coarse) {
    .file-camera { display: inline-flex; }
}

/* "Shift+Enter to send": only with a keyboard at hand (a phone sends with the button). In a dialog's
   footer or a form's actions, on the left, away from the buttons. */
.modal-footer .send-hint,
.form-actions .send-hint { margin-right: auto; align-self: center; }
@media (pointer: coarse) {
    .send-hint { display: none; }
}

@media (max-width: 767.98px) {
    /* Fields at 16px: a phone does not zoom the page in when one is touched. */
    .form-control,
    .form-select,
    .form-control-sm,
    .form-select-sm {
        font-size: 1rem;
    }

    /* The conversation takes the room the phone has. */
    .chat-feed {
        max-height: 60vh;
        max-height: 60dvh;
        min-height: 12rem;
    }
}

/* Buttons and links at least 44px to the finger on a touch screen. */
@media (pointer: coarse) {
    .client-ui .btn:not(.btn-sm):not(.btn-close),
    .client-ui .file-trigger {
        min-height: 2.75rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: .375rem;
    }
}

@media print {
    .app-tabbar { display: none !important; }
}
