/*
 * The Datus theme. ROADMAP 6.6 (owner, 2026-09-30).
 *
 * Datus runs on Dashkit (theme.bundle.css, Bootstrap 5.2.3). This file loads
 * after it and is THE place Datus's colours are defined: the theme's own names
 * where Datus differs from Dashkit, and Datus's names for the rest.
 *
 * USE A NAME, NEVER A HEX VALUE:
 *   markup / CSS   .btn-primary, .text-secondary, var(--bs-primary), var(--datus-row-inactive)
 *   charts / JS    datusColor('primary'), datusColor('chart-budget', 0.4)   (assets/js/highcharts.datus.js)
 *   emails         datus_mail_palette()['primary']                          (app/mailer.php -- emails cannot
 *                  read CSS, so it mirrors the values here; tools/test_theme.php checks they agree)
 * tools/test_theme.php fails on a hex colour anywhere else in Datus's own code.
 *
 * PRIMARY is the navbar blue #1976d2 -- one Datus blue, the owner's choice.
 * Dashkit's was #2c7be5. Bootstrap 5.2 compiles primary INTO each component
 * (.btn-primary { --bs-btn-bg: #2c7be5 }), so setting --bs-primary alone
 * recolours only the utilities that read it, such as .text-primary. The
 * component block below re-points every theme rule that used the old blue or a
 * shade of it; the list was generated from theme.bundle.css, not guessed, and
 * tools/test_theme.php re-derives it to prove nothing was missed.
 *
 * SHADES are Bootstrap's own derivations of primary, precomputed:
 *   shade N% = mix(black, primary, N%)   tint N% = mix(white, primary, N%)
 * Change --bs-primary and they must be recomputed (tools/test_theme.php says so).
 *
 * NEAR-DUPLICATES were folded (owner, 2026-09-30): a hard-coded colour within
 * CIEDE2000 2 of a theme colour -- a difference the eye cannot see -- now uses
 * the theme's name. Anything further away kept its exact value under its own
 * name, so no page changed except where primary did.
 */

:root {
    /* ---- the theme's own names, where Datus differs from Dashkit ------------ */
    --bs-primary: #1976d2;
    --bs-primary-rgb: 25, 118, 210;
    --bs-blue: #1976d2;
    --bs-link-color: #1976d2;
    --bs-link-hover-color: #145ea8;                 /* shade 20%, Bootstrap's rule; Dashkit had its own */
    --bs-chart-primary-700: #1976d2;

    /* Bootstrap's derivations of primary (see the header) */
    --datus-primary-shade-10: #176abd;
    --datus-primary-shade-15: #1564b3;              /* button hover */
    --datus-primary-shade-20: #145ea8;              /* button pressed, link hover */
    --datus-primary-shade-25: #13599e;              /* pressed button border */
    --datus-primary-shade-40: #0f477e;
    --datus-primary-shade-60: #0a2f54;              /* text on a primary alert */
    --datus-primary-tint-70: #bad6f2;
    --datus-primary-tint-80: #d1e4f6;               /* soft backgrounds: bg-primary-soft, table-primary */
    --datus-primary-focus-rgb: 60, 139, 217;        /* tint 15%: the focus ring */

    /* ---- Datus's own colours: no theme equivalent -------------------------- */
    --datus-navbar-link: #e8f1fa;                   /* navbar links that are not the current page: tint 90% of
                                                       primary, 4.0:1 on it (white is 4.6:1, the most this blue
                                                       allows). Was a grey at 3.0:1 -- unreadable on a dim phone */
    --datus-input-border: #85add4;
    --datus-input-border-disabled: #bebfc0;
    --datus-icon-active: #ffc107;                   /* the dot on a lit icon; brighter than the theme's warning */
    --datus-row-inactive: #ebebeb;
    --datus-red-100: #f8d7da;                       /* the .bg-red-* / .bg-orange-* tints below */
    --datus-red-200: #f1aeb5;
    --datus-red-400: #e35d6a;
    --datus-orange-100: #ffe5d0;

    /* ---- chart colours, by what they show -----------------------------------
       rgb triples, so a chart can apply its own transparency:
       datusColor('chart-budget', 0.4). Healthy profit is the theme's success. */
    --datus-chart-time-rgb: 255, 165, 0;            /* labour: hours at their rate (CSS "orange") */
    --datus-chart-expenses-rgb: 113, 124, 135;      /* purchases and expenses */
    --datus-chart-combined-rgb: 59, 129, 248;       /* time + expenses */
    --datus-chart-budget-rgb: 255, 0, 0;            /* the budget line, drawn translucent */
    --datus-chart-burden-rgb: 200, 100, 0;          /* time at burden (cost) rate */
    --datus-chart-invoiced-rgb: 85, 191, 59;
    --datus-chart-contingency-rgb: 50, 166, 168;
    --datus-chart-today-rgb: 0, 0, 255;             /* the "Today" line, drawn translucent */
    --datus-chart-profit-rgb: 59, 129, 248;         /* the profit bullet's bar and target */
    --datus-chart-loss-rgb: 181, 112, 124;          /* profit bullet band: below 0% */
    --datus-chart-thin-margin-rgb: 255, 224, 131;   /* profit bullet band: 0-20% */
    --datus-chart-waywot-rgb: 171, 205, 239;        /* days someone logged a WAYWOT entry */
    --datus-pto-booked: #d97706;                    /* PTO booked in Datus, not yet on a timesheet (ROADMAP 6.10).
                                                       Checked against the primary: colour-blind dE 26.9, contrast >= 3:1 */
    /* My day's timeline (my-day.php, ROADMAP 6.16, 2026-10-30): a project's colour, chosen by its
       number (timesheet_reminder_project_color()), so it is the same every day */
    --datus-timeline-1: #2a73c4;
    --datus-timeline-2: #2f9e6b;
    --datus-timeline-3: #c2410c;
    --datus-timeline-4: #7c3aed;
    --datus-timeline-5: #0e7490;
    --datus-timeline-6: #b45309;
    --datus-timeline-7: #be185d;
    --datus-timeline-8: #4d7c0f;
    --datus-timeline-none: #8a96a3;                 /* no project number; also the hour labels */
    --datus-timeline-out: #f4c45d;                  /* time out, striped with the lighter one */
    --datus-timeline-out-light: #fbe3a8;
    --datus-timeline-rule: #e3e8ee;                 /* between lanes */
    --datus-timeline-label: #5b6b7b;                /* the lane names */
    --datus-timeline-gap: #ffffff;                  /* the card, around each commit's block, so close ones stay apart */
    --datus-timeline-datus: #6d28d9;                /* the Datus lane's badge (2026-11-03): the theme's soft badges are */
    --datus-timeline-datus-light: #ede7fb;          /* all taken by the other sources; 6.6:1 */

    /* The sign-in page's "Sign in with Google" button (2026-11-05): Google's colours for its light
       button, from its branding guidelines. Google's, not Datus's to change */
    --datus-google-surface: #ffffff;
    --datus-google-border: #747775;
    --datus-google-text: #1f1f1f;
    --datus-google-state: #303030;                  /* the overlay on hover (8%) and press (12%) */
    --datus-google-shadow-rgb: 60, 64, 67;
}

/* ---- Datus's own rules ------------------------------------------------------ */

/* A page on a wide screen (owner, 2026-12-01: "the content doesn't always have to be full width,
   but it should at least center itself on the page in the ultrawide scenario"). On a screen wider
   than 1920px, a page's own container -- straight inside .main-content, or inside its .header --
   is centred and no wider than the navbar's content (col-xl-10: five sixths of the page), nor
   capped below 1880px: so it lines up with the navbar's edges from 2256px (2272: 189 to 2083,
   measured), and a 1920px screen is exactly as before. :where() gives it no specificity, so a
   container that sets its own width (container-xl) keeps it. .datus-wide takes the whole width
   (the ticket board). The dashboard centres its own (a .main-content.col-xl-10 inside
   .main-content) and is not matched. */
@media (min-width: 1921px) {
    :where(body > .main-content > .container-fluid, body > .main-content > .header > .container-fluid) {
        max-width: max(1880px, 83.3333%);
    }
}
.datus-wide {
    max-width: none;
}

.icon.active:after {
    background-color: var(--datus-icon-active) !important;
}
td.ellipsis {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 300px;
}
.inactive {
    background-color: var(--datus-row-inactive) !important;
}
.floating {
    background-color: var(--bs-light) !important;  /* was #edf3fe: folded, CIEDE2000 1.8 */
}
.bg-red-100 {
    background-color: var(--datus-red-100);
}
.bg-red-200 {
    background-color: var(--datus-red-200);
    border-radius: 10px;
}
.bg-red-400 {
    background-color: var(--datus-red-400);
}
.bg-orange-100 {
    background-color: var(--datus-orange-100);
    border-radius: 10px;
}
.fe-2x {
    font-size: 150%;
}
/* The navbar (owner, 2026-10-28: "very hard to see on a dim mobile screen. I couldn't even see the menu
   roll out"). Dashkit drew its dark navbar navy, with slate-grey details; Datus repainted the bar blue
   and the slate stayed -- on the menu button, and on the opened menu's dropdown items on a phone, where
   the dropdowns lose their white box. Slate on this blue is 1.2:1: invisible. So the button is white,
   and so is the marker on the current page's link, which Dashkit draws in primary -- blue on blue. */
.navbar-dark {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
    --bs-navbar-toggler-icon-bg: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='white' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}
.navbar-nav .nav-link:not(.active) {
    color: var(--datus-navbar-link);
}
.navbar-dark .navbar-nav .nav-link.active:before {
    border-color: var(--bs-white);
}
@media (max-width: 767.98px) {   /* Dashkit's breakpoint for the transparent dropdowns, not Bootstrap's */
    .navbar-dark.navbar-expand-lg .navbar-nav .dropdown-item {
        color: var(--datus-navbar-link);   /* hover and focus stay Dashkit's white */
    }
    .navbar-dark.navbar-expand-lg .navbar-nav .dropdown-item a {
        color: inherit;   /* "All Staff" is a link inside the item: primary on primary otherwise */
    }
}
.form-control {
    border: 1px solid var(--datus-input-border);
}
.form-control:disabled {
    border: 1px solid var(--datus-input-border-disabled);
}

/* A heading you can type into -- the quote editor's title, Budget Builder's. It still reads as the page's
   title, and says it can be changed without becoming a form box (owner, 2026-10-26: "make it subtle tho, I
   don't mean change it to a generic form input"): a faint dashed underline and a pencil, a tint on hover, a
   solid line while typing. Nothing shows when it cannot be changed. */
.datus-editable-title {
    display: flex;
    align-items: center;
    gap: .5rem;
}
/* !important against Dashkit's .form-control-flush, which forces border and background transparent with it. */
.datus-editable-title .form-control-flush {
    flex: 0 1 auto;
    width: auto;                    /* not Bootstrap's 100%, which would override the next line */
    field-sizing: content;          /* as wide as the title, so the pencil sits beside it */
    min-width: 12ch;
    max-width: 100%;
    border-width: 0 0 1px 0;
    border-style: dashed;
    border-color: transparent transparent var(--datus-input-border) transparent !important;
    border-radius: .375rem .375rem 0 0;
    padding: 0 .375rem;
    margin-left: -.375rem;
    background-color: transparent !important;
    transition: background-color .15s ease, border-color .15s ease;
}
.datus-editable-title .form-control-flush:hover,
.datus-editable-title .form-control-flush:focus {
    background-color: rgba(var(--datus-primary-focus-rgb), .07) !important;
    border-bottom-color: var(--bs-primary) !important;
    box-shadow: none;
}
.datus-editable-title .form-control-flush:focus {
    border-bottom-style: solid;
}
.datus-editable-title .form-control-flush:disabled {
    border-bottom-color: transparent !important;
    background-color: transparent !important;
}
.datus-editable-pencil {
    font-size: 1rem;
    color: var(--bs-gray-500);
    opacity: .7;
    pointer-events: none;
    transition: opacity .15s ease, color .15s ease;
}
.datus-editable-title:hover .datus-editable-pencil,
.datus-editable-title:focus-within .datus-editable-pencil {
    opacity: 1;
    color: var(--bs-primary);
}
.datus-editable-title:has(:disabled) .datus-editable-pencil {
    display: none;
}

/* ---- Dashkit's components, re-pointed at primary -----------------------------
   Every declaration in theme.bundle.css that used Dashkit's primary or one of
   its shades, same selectors in the same order, so the cascade between them is
   unchanged; this file loads later, so each of these wins. Generated, then
   checked by tools/test_theme.php. Two browser-specific range-thumb selectors
   stay separate on purpose: a browser drops a whole rule it cannot parse. */

.table-primary {
    --bs-table-bg: var(--datus-primary-tint-80);
}
.form-check-input:checked {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.form-check-input[type=checkbox]:indeterminate {
    background-color: var(--bs-primary);
    border-color: var(--bs-primary);
}
.form-range::-webkit-slider-thumb {
    background-color: var(--bs-primary);
}
.form-range::-webkit-slider-thumb:active {
    background-color: var(--datus-primary-tint-70);
}
.form-range::-moz-range-thumb {
    background-color: var(--bs-primary);
}
.form-range::-moz-range-thumb:active {
    background-color: var(--datus-primary-tint-70);
}
.btn-primary {
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--datus-primary-shade-15);
    --bs-btn-hover-border-color: var(--datus-primary-shade-20);
    --bs-btn-focus-shadow-rgb: var(--datus-primary-focus-rgb);
    --bs-btn-active-bg: var(--datus-primary-shade-20);
    --bs-btn-active-border-color: var(--datus-primary-shade-25);
    --bs-btn-disabled-bg: var(--bs-primary);
    --bs-btn-disabled-border-color: var(--bs-primary);
}
.btn-outline-primary {
    --bs-btn-color: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--bs-primary);
    --bs-btn-hover-border-color: var(--bs-primary);
    --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
    --bs-btn-active-bg: var(--bs-primary);
    --bs-btn-active-border-color: var(--bs-primary);
    --bs-btn-disabled-color: var(--bs-primary);
    --bs-btn-disabled-border-color: var(--bs-primary);
}
.btn-link {
    --bs-btn-focus-shadow-rgb: var(--datus-primary-focus-rgb);
}
.nav-pills {
    --bs-nav-pills-link-active-bg: var(--bs-primary);
}
.pagination {
    --bs-pagination-active-bg: var(--bs-primary);
}
.alert-primary {
    --bs-alert-color: var(--datus-primary-shade-60);
}
.progress {
    --bs-progress-bar-bg: var(--bs-primary);
}
.list-group {
    --bs-list-group-active-bg: var(--bs-primary);
    --bs-list-group-active-border-color: var(--bs-primary);
}
.list-group-item-primary {
    background-color: var(--datus-primary-tint-80);
    color: var(--datus-primary-shade-40);
}
.list-group-item-primary.list-group-item-action:focus,
.list-group-item-primary.list-group-item-action:hover {
    color: var(--datus-primary-shade-40);
}
.list-group-item-primary.list-group-item-action.active {
    background-color: var(--datus-primary-shade-40);
    border-color: var(--datus-primary-shade-40);
}
.text-bg-primary {
    background-color: RGBA(var(--bs-primary-rgb), var(--bs-bg-opacity, 1)) !important;
}
.link-primary {
    color: var(--bs-primary) !important;
}
.link-primary:focus,
.link-primary:hover {
    color: var(--datus-primary-shade-20) !important;
}
.border-primary {
    border-color: var(--bs-primary) !important;
}
.bg-primary {
    background-color: var(--bs-primary) !important;
}
.bg-ellipses.bg-primary {
    background-image: radial-gradient(var(--bs-primary), var(--bs-primary) 70%, transparent 70.1%);
}
.bg-primary-soft {
    background-color: var(--datus-primary-tint-80) !important;
}
.badge.bg-primary-soft {
    color: var(--bs-primary);
}
.alert-primary {
    --bs-alert-bg: var(--bs-primary);
    --bs-alert-border-color: var(--bs-primary);
}
.list-group-item-primary {
    background-color: var(--bs-primary);
}
.list-group-item-primary.list-group-item-action:focus,
.list-group-item-primary.list-group-item-action:hover {
    background-color: var(--datus-primary-shade-10);
}
.ql-tooltip .ql-action:before,
.ql-tooltip.ql-editing .ql-action:before {
    --bs-btn-bg: var(--bs-primary);
    --bs-btn-border-color: var(--bs-primary);
    --bs-btn-hover-bg: var(--datus-primary-shade-15);
    --bs-btn-hover-border-color: var(--datus-primary-shade-20);
    --bs-btn-focus-shadow-rgb: var(--datus-primary-focus-rgb);
    --bs-btn-active-bg: var(--datus-primary-shade-20);
    --bs-btn-active-border-color: var(--datus-primary-shade-25);
    --bs-btn-disabled-bg: var(--bs-primary);
    --bs-btn-disabled-border-color: var(--bs-primary);
}

/* A NAS path that copies on click -- in Datum's answers and the search page's
   "Files on the NAS" card (ROADMAP 6.3u). Browsers will not follow a V:\ link
   from a web page, so the path to paste into File Explorer is the hand-over. */
code.datus-path {
    cursor: copy;
    overflow-wrap: break-word;   /* not break-all: that lets a table squeeze the column to one character */
}
code.datus-path.is-copied {
    outline: 1px solid var(--bs-success);
    outline-offset: 1px;
}
/* ...and Datum's "Open" after it: File Explorer at that file (search-ms:). */
a.datus-open {
    margin-left: .35em;
    font-size: .85em;
    white-space: nowrap;
}

/* A sorted column's header -- the search page's "Files on the NAS" table. The
   theme's [data-sort] caret points both ways; the column in use gets one arrow
   for its direction instead. Drawn as a mask in the header's own colour, so no
   colour is named here. */
.table [data-sort].datus-sort-asc::after,
.table [data-sort].datus-sort-desc::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 10px;
    background-color: currentColor;
    -webkit-mask: no-repeat center / contain;
    mask: no-repeat center / contain;
}
.table [data-sort].datus-sort-asc::after {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='10' viewBox='0 0 6 10'><path d='M3 0L6 4H0Z'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='10' viewBox='0 0 6 10'><path d='M3 0L6 4H0Z'/></svg>");
}
.table [data-sort].datus-sort-desc::after {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='10' viewBox='0 0 6 10'><path d='M3 10L0 6H6Z'/></svg>");
    mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='6' height='10' viewBox='0 0 6 10'><path d='M3 10L0 6H6Z'/></svg>");
}

/* The user dashboard's cards (dashboard.php; owner, 2026-10-30). Two columns:
   .datus-dash-main is the milestone chart, the milestones under it and, for a PM,
   PM Projects; .datus-dash-side is PTO and At A Glance. Below 1600px both are
   full width, the side one under the main one (its two cards side by side from
   xl, Bootstrap's col-xl-6). From 1600px the side column stands to the right: a
   third of the row, never under 460px -- what At A Glance's header needs for its
   title and three tabs -- and the main column takes the rest, so the chart and
   the milestones share one width that grows with the screen without spanning it. */
@media (min-width: 1600px) {
    .datus-dash-main {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
    }
    .datus-dash-side {
        width: max(460px, 33.333%);
    }
    .datus-dash-side .datus-dash-side-card {
        width: 100%;
    }
}

/* ...and the PTO card's list and add form: side by side when the card is wide
   enough for both, stacked when it is not. By the card's own width, because it
   is a third of the screen on a wide one and half or all of it on narrower ones. */
.datus-pto-body {
    container-type: inline-size;
}
.datus-pto-half + .datus-pto-half {
    margin-top: 1.5rem;
}
@container (min-width: 540px) {
    .datus-pto-half {
        width: 50%;
    }
    .datus-pto-half + .datus-pto-half {
        margin-top: 0;
    }
}

/* Tabs that switch a project status in or out of view (owner, 2026-11-03): the
   shown tab's underline is that status's colour, the green, yellow and red of
   the dots beside each project, in place of Dashkit's primary. All Staff's chart
   (employees.php) and the dashboard's PM Projects. */
.nav-tabs .nav-link.active.datus-tab-success {
    border-bottom-color: var(--bs-success);
}
.nav-tabs .nav-link.active.datus-tab-warning {
    border-bottom-color: var(--bs-warning);
}
.nav-tabs .nav-link.active.datus-tab-danger {
    border-bottom-color: var(--bs-danger);
}

/* ...and PM Projects' status tabs carry a count each. The header grows to a
   second line rather than overflow its fixed height when the card is too
   narrow for the title and all three. */
.datus-pm-header {
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
}
.datus-pm-filter .badge {
    margin-left: .375rem;
    background-color: rgba(var(--bs-body-color-rgb), .06);
    color: inherit;
}

/* The project page's Milestones and Google Drive cards (project-overview.php;
   owner, 2026-10-30). They start a row of their own, side by side while both fit,
   the spare width two parts to Milestones and one to Drive; stacked, each full
   width, when they do not. Milestones starts from the narrowest its table can be
   without scrolling (min-content) or 880px, whichever is more: 880px holds the
   place before the table arrives (it loads after the page, and the cards should
   not jump when it lands), and a wider team table -- a column per person --
   pushes Drive below rather than scroll. Not the table's natural width
   (max-content): that counts every text box at full size and the longest name in
   the "+ Support" picker, and would stack the cards on screens with room for both.
   Only a table wider than the whole row (a phone) scrolls, inside its card. */
.datus-ms-col {
    flex: 2 1 min-content;
    width: auto;
    min-width: min(880px, 100%);
}
.datus-drive-col {
    flex: 1 1 420px;
    width: auto;
    min-width: 0;   /* the "No Drive ID Set" example URL cannot wrap and held it at 560px; the card breaks it */
}
.datus-ms-table {
    overflow-x: auto;
}
/* Its descriptions get room to be read. Both tables (mod-milestone-table.php and
   the team one) set the column's width only as a min-width in em on the header,
   whose font is small: about 200px. A minimum here instead of a share of the
   width, because the team table's other columns, a column per person, must keep
   theirs -- a 40% share squeezed its "+ Support" picker down to its arrow. Extra
   width is still shared by the columns' natural widths, this one the largest. */
.datus-ms-table td.description .form-control,
.datus-ms-table td.description .form-control-plaintext {
    min-width: 18rem;
}

/* ROADMAP 6.25 Stage A: the project page's Media card (assets/js/datus-project-media.js).
   A grid of thumbnails that fills the card's width, each 4:3 and cropped; a video and an
   animation's kept frame carry a mark; the viewer is the card's own overlay. */
.datus-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .5rem;
}
.datus-media-tile {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: var(--bs-border-radius);
    background: var(--bs-gray-200);
    aspect-ratio: 4 / 3;
    overflow: hidden;
    cursor: pointer;
}
.datus-media-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.datus-media-tile:focus-visible {
    outline: 3px solid var(--bs-primary);
    outline-offset: 2px;
}
.datus-media-tile.is-hidden img {
    opacity: .45;
}
.datus-media-tile .datus-media-mark {
    position: absolute;
    left: .35rem;
    bottom: .35rem;
    max-width: calc(100% - .7rem);
    padding: .1rem .4rem;
    border-radius: var(--bs-border-radius-sm);
    background: rgba(var(--bs-dark-rgb), .7);
    color: var(--bs-white);
    font-size: .7rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.datus-media-tile .datus-media-none {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: .5rem .5rem 1.9rem;   /* clear of the mark at the foot */
    color: var(--bs-gray-600);
    font-size: .75rem;
    text-align: center;
    overflow-wrap: anywhere;
}
.datus-media-viewer {
    position: fixed;
    inset: 0;
    z-index: 1060;
    display: flex;
    flex-direction: column;
    background: rgba(var(--bs-dark-rgb), .92);
    color: var(--bs-white);
}
.datus-media-viewer[hidden] {
    display: none;
}
.datus-media-viewer .datus-media-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.datus-media-viewer .datus-media-stage img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.datus-media-viewer .datus-media-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    align-items: center;
    padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px));
    font-size: .85rem;
}
.datus-media-viewer .datus-media-bar a {
    color: var(--bs-white);
}
/* The card's header wraps on a narrow screen instead of running off the card (owner, on a phone,
   2026-11-04): Dashkit gives .card-header a fixed height. */
.datus-media-card > .card-header {
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    padding-top: .75rem;
    padding-bottom: .75rem;
}
.datus-media-controls {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    min-width: 0;
}
@media (max-width: 575.98px) {
    .datus-media-controls,
    .datus-media-controls .btn-group,
    #project-media-add {
        width: 100%;
    }
    .datus-media-controls .btn-group > .btn {
        flex: 1 1 0;
    }
    .datus-media-grid {
        grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
        gap: .35rem;
    }
}

/* The navbar's search box on a phone or tablet: in the bar, between the menu and the avatar, as
   wide as the bar allows (app/mod-navbar.php). Its list of projects fits the screen. */
@media (max-width: 991.98px) {
    /* A zero basis, so it takes only the room left and the avatar stays on the bar's first line. */
    .datus-nav-search {
        flex: 1 1 0;
        min-width: 0;
        margin-left: .5rem;
    }
    .datus-nav-search .input-group {
        width: 100%;
        flex-wrap: nowrap;
    }
    .datus-nav-search .form-control {
        min-width: 0;
    }
    #topnav .navbar-user {
        flex: 0 0 auto;
    }
    /* Pages written with a bare px-6 (4.5rem a side: the project page and a closed project's
       review) left a 390px phone 245px for the page (measured 2026-11-04). The other pages already
       write px-3 px-lg-6; this gives the rest the same below large screens. */
    .container-fluid.px-6 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    .datus-nav-search .dropdown-menu {
        width: calc(100vw - 2rem);
        max-height: 60vh;
        overflow-y: auto;
    }
}
/* The project page's Milestones footer on a phone: "Pending" over "Margin", each with its number,
   beside the two round buttons. The 4.5rem .ps-6 before "Margin" wrapped the line mid-figure. */
@media (max-width: 575.98px) {
    .datus-ms-col .card-footer h2 {
        font-size: 1.1rem;
        line-height: 1.5;
    }
    .datus-ms-col .card-footer h2 .ps-6 {
        padding-left: 0 !important;
    }
    .datus-ms-col .card-footer h2 .ps-6::before {
        content: "";
        display: block;
    }
}

/* The sign-in page (sign-in.php, 2026-11-05). The one page outside the session gate, so none of
   the navbar's includes: Datus's blue panel and mark beside the sign-in column on a computer, a
   blue band above it on a phone, like the navbar. The button is Google's own light "Sign in with
   Google" (its branding guidelines' HTML/CSS, the --datus-google-* colours), so it reads as
   Google's. */
.datus-signin {
    display: flex;
    min-height: 100vh;
}
.datus-signin-brand {
    position: relative;
    flex: 0 0 42%;
    max-width: 38rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 3rem;
    padding: 3rem 3.5rem;
    overflow: hidden;
    background: var(--bs-primary);
    color: var(--bs-white);
}
.datus-signin-mark {
    position: relative;
    display: flex;
    align-items: center;
    gap: .75rem;
    font-size: 1.625rem;
    font-weight: 600;
    letter-spacing: .01em;
}
.datus-signin-mark img {
    height: 2.5rem;
    width: auto;
}
.datus-signin-company {
    position: relative;
    height: 2rem;
    width: auto;
    align-self: flex-start;
    filter: brightness(0) invert(1);        /* the wordmark in white, on the blue */
    opacity: .9;
}
.datus-signin-watermark {
    position: absolute;
    right: -7rem;
    bottom: -6rem;
    height: 30rem;
    opacity: .07;
    pointer-events: none;
}
.datus-signin-main {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
}
.datus-signin-panel {
    width: 100%;
    max-width: 23.5rem;
}
.datus-signin-panel h1 {
    margin-bottom: .5rem;
    font-size: 1.875rem;
}
.datus-signin-lead {
    margin-bottom: 2rem;
    color: var(--bs-secondary);
    font-size: 1.0625rem;
}
.datus-signin-assure {
    display: flex;
    gap: .5rem;
    margin: 1rem 0 0;
    color: var(--bs-secondary);
    font-size: .8125rem;
}
.datus-signin-assure .fe {
    margin-top: .15rem;
}
.datus-signin-elsewhere {               /* a visitor who wanted the company, not Datus */
    margin: 2rem 0 0;
    padding: 1.5rem 0 0;
    border-top: 1px solid var(--bs-border-color);
    color: var(--bs-secondary);
    font-size: .8125rem;
}

/* What the callback or sign-out sent back (?notice=): a bold lead and what to do, on a soft tint */
.datus-signin-notice {
    margin-bottom: 1.5rem;
    padding: .875rem 1rem;
    border-left: 3px solid var(--bs-secondary);
    border-radius: var(--bs-border-radius);
    background: rgba(var(--bs-secondary-rgb), .1);
    font-size: .875rem;
}
.datus-signin-notice > strong {
    display: block;
}
.datus-signin-notice > div {
    margin-top: .25rem;
    color: var(--bs-gray-700);
}
.datus-signin-notice.is-danger {
    border-left-color: var(--bs-danger);
    background: rgba(var(--bs-danger-rgb), .08);
}
.datus-signin-notice.is-success {
    border-left-color: var(--bs-success);
    background: rgba(var(--bs-success-rgb), .1);
}

.datus-google-btn {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    height: 44px;
    padding: 0 12px;
    overflow: hidden;
    border: 1px solid var(--datus-google-border);
    border-radius: 4px;
    background: var(--datus-google-surface);
    color: var(--datus-google-text);
    font-family: 'Roboto', arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .25px;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color .218s, border-color .218s, box-shadow .218s;
}
.datus-google-btn img {
    flex: none;
    width: 20px;
    height: 20px;
}
.datus-google-btn span {
    flex: 1 1 auto;
    margin-right: 20px;                     /* the logo's width, so the words sit in the middle */
    text-align: center;
}
.datus-google-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--datus-google-state);
    opacity: 0;
    transition: opacity .218s;
    pointer-events: none;
}
.datus-google-btn:hover,
.datus-google-btn:focus {
    color: var(--datus-google-text);
    box-shadow: 0 1px 2px 0 rgba(var(--datus-google-shadow-rgb), .3), 0 1px 3px 1px rgba(var(--datus-google-shadow-rgb), .15);
}
.datus-google-btn:hover::after {
    opacity: .08;
}
.datus-google-btn:active::after,
.datus-google-btn:focus-visible::after {
    opacity: .12;
}
.datus-google-btn:focus-visible {
    outline: 3px solid rgba(var(--datus-primary-focus-rgb), .5);
    outline-offset: 2px;
}

/* A phone, and a tablet held upright: the blue becomes a band like the navbar, the column below */
@media (max-width: 991.98px) {
    .datus-signin {
        flex-direction: column;
    }
    .datus-signin-brand {
        flex: none;
        max-width: none;
        padding: 1rem 16px;
    }
    .datus-signin-mark {
        font-size: 1.25rem;
        gap: .625rem;
    }
    .datus-signin-mark img {
        height: 1.75rem;
    }
    .datus-signin-company,
    .datus-signin-watermark {
        display: none;
    }
    .datus-signin-main {
        align-items: flex-start;
        padding: 2.5rem 16px;
    }
}

/* ---------------------------------------------------------------------------------------------
   6.27 phone: every page laid out for a phone (ROADMAP 6.27, 2026-11-04). Measured by rendering
   each page and laying it out at 390px in headless Chrome over DevTools. Nothing here changes a
   page on a computer: the rules apply below a width, and the two chart classes keep the minimum
   the pages had inline. Keep it the last block in the file.
   --------------------------------------------------------------------------------------------- */

/* Charts kept at a minimum width on a computer (employees.php, budget-builder.php; until now an
   inline min-width), which made those pages wider than a phone. On a phone they take the card's
   width, as Highcharts can. */
@media (min-width: 576px) {
    .datus-chart-min-400 {
        min-width: 400px;
    }
    .datus-chart-min-600 {
        min-width: 600px;
    }
}

@media (max-width: 767.98px) {
    /* Dashkit fixes a card header at 60px on one line, so a title beside tabs, buttons or a note
       was squeezed to a word a line (PTO, Settings › People, My day) or spilled out of the card
       (the dashboard's At A Glance tabs). Here it grows instead: the title is sized by its words,
       and what sits beside it moves under it when the two do not fit. */
    .card-header {
        height: auto;
        min-height: 60px;
        flex-wrap: wrap;
        column-gap: .75rem;
        row-gap: .25rem;
    }
    .card-header > :first-child {
        flex: 1 1 auto;
    }
    /* Dashkit pulls header tabs up into the 60px; on a line of their own that covered the title. */
    .card-header-tabs {
        margin-top: 0;
    }
}

@media (max-width: 575.98px) {
    /* Room under every page for Datum, who sits over the bottom-right corner (72px on a phone,
       assets/css/datum.css), so the last card can be scrolled clear of him. */
    .main-content {
        padding-bottom: 5rem;
    }

    /* The page header's big round buttons (Budget Builder and the quote editor: owner, 2026-11-03)
       at a phone's size, so they fit on one line under the title instead of three. */
    .header-body .btn-lg.rounded-circle {
        width: 2.75rem;
        height: 2.75rem;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .header-body .btn-lg.rounded-circle > .fe {
        font-size: 1.25rem;
        margin: 0;
    }

    /* The quote editor's sections (assets/js/quote-editor.js): the heading on a line of its own,
       Templates, Polish and the arrows under it; beside them it was squeezed to a few pixels. */
    .qe-section > .d-flex.align-items-center {
        flex-wrap: wrap;
    }
    .qe-section > .d-flex.align-items-center > input.form-control-flush {
        flex: 1 0 100%;
    }

    /* Stat tiles two to a row (dashboard.php, index.php: .datus-stat-tile), so four take two
       short rows rather than four tall ones. */
    .datus-stat-tile {
        display: flex;
        flex-direction: column;
    }
    .datus-stat-tile > .card {   /* the two in a row the same height */
        flex: 1 1 auto;
    }
    .datus-stat-tile .card-body {
        padding: 1rem;
    }
    .datus-stat-tile .h2 {
        font-size: 1.25rem;
    }

    /* Rows of faces (Today's Report: logged, not logged) wrap instead of running off the card. */
    .avatar-group {
        flex-wrap: wrap;
        max-width: 100%;
        row-gap: .25rem;
    }

    /* PTO's year timeline (app/func/f_pto_views.php): narrower name and total columns and a label
       a quarter, so the months have room; twelve labels in 116px ran together. That file's styles
       are inline, after this one, hence the extra .pto-tl in each selector. */
    .pto-tl .pto-tl-name {
        flex-basis: 5.5rem;
    }
    .pto-tl .pto-tl-total {
        flex-basis: 3rem;
    }
    .pto-tl .pto-tl-head .pto-tl-track span:not(:nth-child(3n+1)) {
        display: none;
    }

    /* My day: the timeline's hours every other one, and the day's list as one block per event
       (when and where it came from, then what, then the project) instead of a 750px table. */
    .md-chart .md-axis .md-tick:nth-child(even) {
        display: none;
    }
    .md-list thead {
        display: none;
    }
    .md-list,
    .md-list tbody {
        display: block;
        width: 100%;
    }
    .md-list tbody tr {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: .5rem;
        padding: .6rem 1rem;
        border-top: 1px solid var(--bs-border-color);
    }
    .md-list.card-table tbody td {   /* the page's own .md-when and .md-proj are width:1%, nowrap */
        display: block;
        width: auto;
        border: 0;
        padding: 0;
        white-space: normal;
    }
    .md-list.card-table tbody td:first-child {   /* Dashkit's card-table indent is !important */
        padding-left: 0 !important;
    }
    .md-list tbody td:nth-child(n+3) {
        grid-column: 1 / -1;
    }
}

/* A fold button's chevron (dashboard.php's PTO form and At A Glance, folded on a phone). */
.datus-fold .fe {
    display: inline-block;
    transition: transform .15s;
}
.datus-fold[aria-expanded="true"] .fe {
    transform: rotate(180deg);
}

@media (max-width: 575.98px) {
    /* The dashboard on a phone (owner, 2026-11-04: decision 4): the milestones due first, under
       the WAYWOT button and the alerts, then the tiles, the chart and the rest; the PTO form and
       At A Glance folded (dashboard.php). The two column wrappers step aside (display: contents)
       so their cards can be ordered with the tiles; a computer keeps its two columns. */
    .datus-dash-body {
        display: flex;
        flex-direction: column;
    }
    .datus-dash-body > .datus-dash-cols,
    .datus-dash-cols > .datus-dash-main {
        display: contents;
    }
    .datus-dash-body > .row,
    .datus-dash-main > *,
    .datus-dash-cols > .datus-dash-side {
        order: 2;
    }
    .datus-dash-main > #milestones,
    .datus-dash-main > .datus-dash-milestones {
        order: 1;
    }
    .datus-dash-body > :not(.row) {   /* the feedback footer: last, as before */
        order: 3;
    }
    .datus-dash-cols > .datus-dash-side {   /* its row's gutter is gone with the row's box */
        padding-left: 0;
        padding-right: 0;
    }
    .datus-glance:has(> .collapse:not(.show)) .card-header-tabs {   /* no tabs while folded */
        display: none;
    }
    #PTO.collapse.show,
    #PTO.collapsing {
        margin-top: 1rem;
    }

    /* Lists as one block per row (owner, 2026-11-04: decision 1): the projects list
       (#active_projects-table, index.php), the milestones (#active_milestones-table, the dashboard
       and All Staff) and quotes (.datus-quotes-list). Both ids are arrayAsSortTable()'s, whose
       cells carry their column's name; the quotes table is placed by column. No sorting on a phone. */
    :is(#active_projects-table, #active_milestones-table, .datus-quotes-list) thead {
        display: none;
    }
    :is(#active_projects-table, #active_milestones-table, .datus-quotes-list),
    :is(#active_projects-table, #active_milestones-table, .datus-quotes-list) > tbody {
        display: block;
        width: 100%;
    }
    :is(#active_projects-table, #active_milestones-table, .datus-quotes-list) > tbody > tr {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        column-gap: .5rem;
        row-gap: .2rem;
        padding: .75rem 1rem;
        border-top: 1px solid var(--bs-border-color);
    }
    :is(#active_projects-table, #active_milestones-table, .datus-quotes-list) > tbody > tr > td {
        display: block;
        width: auto;
        padding: 0 !important;             /* the cells' p-2, Dashkit's card-table indent */
        border: 0;
        text-align: left !important;       /* the cells' text-center */
    }

    #active_projects-table td.number { order: 1; font-weight: 600; }
    #active_projects-table td.status { order: 2; }
    #active_projects-table td.status .alert {
        padding: .05rem .5rem !important;
        margin: 0;
        font-size: .75rem;
    }
    #active_projects-table td.pm { order: 3; margin-left: auto; }
    #active_projects-table td.customer { order: 4; flex-basis: 100%; }
    #active_projects-table td.budgetbrused { order: 5; flex: 1 1 8rem; }
    #active_projects-table td.hoursbrpending { order: 6; color: var(--bs-secondary); }
    #active_projects-table td.hoursbrpending::after { content: " h pending"; }
    #active_projects-table td.hours-accruedbr7Days { order: 7; color: var(--bs-secondary); }
    #active_projects-table td.hours-accruedbr7Days::after { content: " h this week"; }
    #active_projects-table :is(td.billable, td.expenses, td.balance) { display: none; }

    #active_milestones-table td.Due-Date { order: 1; font-weight: 600; }
    #active_milestones-table td.Alerts { order: 2; }
    #active_milestones-table td.Alerts .h2 { font-size: 1rem; }
    #active_milestones-table td.Role { order: 3; font-size: .75rem; text-transform: uppercase; color: var(--bs-secondary); }
    #active_milestones-table td.Hours { order: 4; margin-left: auto; }
    #active_milestones-table td.Hours::after { content: " h"; }
    #active_milestones-table td.Project { order: 5; flex-basis: 100%; }
    #active_milestones-table td.Description { order: 6; flex-basis: 100%; color: var(--bs-gray-700); }

    .datus-quotes-list td:nth-child(1) { order: 1; font-weight: 600; }     /* number */
    .datus-quotes-list td:nth-child(7) { order: 2; margin-left: auto; }    /* total */
    .datus-quotes-list td:nth-child(3) { order: 3; flex-basis: 100%; }     /* customer */
    .datus-quotes-list td:nth-child(4) { order: 4; flex-basis: 100%; color: var(--bs-secondary); }   /* title */
    .datus-quotes-list td:nth-child(2) { order: 5; }                       /* issued */
    .datus-quotes-list td:nth-child(5) { order: 6; }                       /* sent as */
    .datus-quotes-list td:nth-child(8) { order: 7; }                       /* outcome */
    .datus-quotes-list td:nth-child(10) { order: 8; margin-left: auto; }   /* the PDF */
    .datus-quotes-list :is(td:nth-child(6), td:nth-child(9)) {   /* arrangement, origin */
        display: none !important;   /* the shared rule above names two ids, which outrank a class */
    }
}

/* ---- Tickets (/tickets, ROADMAP 6.31) ----------------------------------------------------
 * Dashkit's kanban (.kanban-container, .kanban-item and Draggable's classes) made compact:
 * a coloured rule on each column, and small cards. The containers are .tk-category,
 * not .kanban-category, so Dashkit's own Sortable does not take them: datus-tickets.js does.
 *
 * The width (owner, 2026-12-01: "make better use of my wide screen"). The board is the page's
 * whole width (.datus-wide). The open columns share it equally, never under 17rem (narrower,
 * the board scrolls sideways, as it did), and stand as tall as the tallest, so all of a column
 * takes a drop. A column wide enough puts its cards side by side, 15rem or more each, read
 * left to right, one height a row. A rolled-up column (.tk-rolled; Done unless this browser
 * chose otherwise) is a strip with its name and count: its body covers it, so a click
 * anywhere opens it and a card dragged onto it lands in it. */
.tk-board { min-height: 0; padding-bottom: 1.5rem; overflow-x: auto; }   /* Dashkit's is scroll: a bar even with nothing to scroll */
.tk-board > .row { --bs-gutter-x: 1rem; }
.tk-board > .row > .tk-col { flex: 1 1 0; min-width: 17rem; max-width: none; display: flex; flex-direction: column; }
.tk-column { flex: 1 1 auto; margin-bottom: 0; border-top: 3px solid var(--bs-secondary); background-color: var(--bs-gray-100); }
.tk-column.tk-tone-warning { border-top-color: var(--bs-warning); }
.tk-column.tk-tone-primary { border-top-color: var(--bs-primary); }
.tk-column.tk-tone-info    { border-top-color: var(--bs-info); }
.tk-column.tk-tone-success { border-top-color: var(--bs-success); }
.tk-column > .card-header { height: auto; min-height: 0; padding: .625rem .75rem; background-color: transparent; gap: .375rem; }
.tk-column > .card-body { padding: 0 .5rem .5rem; display: flex; flex-direction: column; }
.tk-category {
    flex: 1 1 auto; min-height: 3rem;   /* an empty column still takes a drop */
    display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .5rem; align-content: start;
}
.tk-category > .kanban-item > .tk-card { height: 100%; }
.tk-foot { margin-top: .5rem; }
a.tk-foot { align-self: flex-start; }
.tk-roll { padding: 0 .125rem; line-height: 1; }
.tk-board > .row > .tk-col.tk-rolled { flex: 0 0 4rem; min-width: 0; }
.tk-rolled .tk-column { position: relative; min-height: 16rem; }
.tk-rolled .tk-column:hover { border-color: var(--bs-gray-400); }
.tk-rolled .tk-column > .card-header { flex-direction: column; align-items: center; gap: .5rem; padding: .5rem .25rem; }
.tk-rolled .tk-column > .card-header > .card-header-title { order: 3; flex: 0 0 auto; writing-mode: vertical-rl; white-space: nowrap; }
.tk-rolled .tk-roll { order: -1; }
.tk-rolled .tk-count { white-space: normal; text-align: center; }   /* "3 of 20" while filtered */
.tk-rolled .tk-column > .card-body { position: absolute; inset: 0; z-index: 1; padding: 0; cursor: pointer; border-radius: inherit; }
.tk-rolled .tk-category { display: block; height: 100%; min-height: 0; border-radius: inherit; }
.tk-rolled .tk-category > .kanban-item:not(.draggable-mirror), .tk-rolled .tk-foot { display: none; }
.draggable--is-dragging .tk-rolled .tk-column { border-style: dashed; }   /* while dragging: a strip takes the card */
.tk-rolled .tk-category.draggable-container--over { outline: 2px dashed var(--bs-primary); outline-offset: -2px; background-color: rgba(var(--bs-primary-rgb), .08); }
.tk-card { cursor: pointer; }
.tk-card:hover { border-color: var(--bs-gray-400); }
.tk-card:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 1px; }
.tk-card > .card-body { padding: .5rem .625rem; }
.tk-card .tk-meta { font-size: .75rem; line-height: 1.2; }
.tk-card .tk-meta .badge { font-weight: 500; max-width: 9rem; }
.tk-card .tk-title {
    font-size: .8125rem; line-height: 1.3; margin: 0 0 .375rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tk-card .avatar-xs { width: 1.375rem; height: 1.375rem; font-size: .5625rem; }
.tk-filters .form-control, .tk-filters .form-select { width: auto; min-width: 9rem; }
.tk-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.tk-num { width: 6rem; }
/* A Datum card's answer (Datum's own markup) and what Datum saw (2026-11-20, Datum Reports' view) */
.tk-answer { overflow-wrap: anywhere; }
.tk-answer table { font-size: inherit; }
.tk-trace { max-height: 20rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .75rem; }
