/* Órga shell (D159): the page frame of every page that extends base.html, in the Órga Clinic Growth
   Studio's look (apps/web/app/layout.tsx, sidebar-nav.tsx, top-bar.tsx, studio-footer.tsx and
   globals.css on studio main bbce5b7), translated from Tailwind to plain CSS. The palette, .og-glass
   and the fonts come from orga-glass.css, which base.html links just before this file.

   - The frame: colour patches on cream, a 12 px gap and padding (16 px from 768 px).
   - The sidebar (nav#app-sidebar): a floating glass panel, 240 px, sticky, the salon name at the top
     in the heading font, items with an icon, the current page on solid fern. The D109 rail (64 px of
     44 px icon buttons) still works; on /help it is the default (D157). Below 768 px the same element
     is the phone menu: a drawer that slides in from the left (shell-drawer.js).
   - The header card (header.og-topbar) at the top of the content column replaces the dark Bootstrap
     navbar: salon name and the current section on the left, pill buttons on the right.
   - The footer card at the bottom of the column.
   - The content sits on the patches on every page, as the studio. Pages built for the glass (body
     class og-page) style their own panels; on every other signed-in page (main.og-cards) each
     Bootstrap card is a glass card (strong paper glass, so Bootstrap's greys keep 4.5:1), a card in
     a card is a tile, and the headings and table headers are the studio's (D159 addendum).
   - Bootstrap's colours become the studio palette under body.og-shell only (the client portal keeps
     its look): primary fern, success fern-700, info fern-900, warning honey, danger the error red;
     every focus ring is a 3 px fern outline.
   Contrast: tests/test_glass_contrast.py. Blur only on .og-glass (the sidebar, header and footer). */

/* ---- The page -------------------------------------------------------------------------------- */
body.og-shell {
    min-height: 100vh;
    margin: 0;
    background-color: var(--og-cream);
    background-image: var(--og-patches);
    background-repeat: no-repeat;
    background-size: 100% 100%;
    color: var(--og-ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "rlig" 1, "calt" 1;

    /* Bootstrap's own variables: Lato, ink, fern instead of blue, a fern focus ring. */
    --bs-body-font-family: var(--og-font-body);
    --bs-body-color: #101812;
    --bs-body-color-rgb: 16, 24, 18;
    --bs-primary: #1A4D2E;
    --bs-primary-rgb: 26, 77, 46;
    --bs-secondary-rgb: 62, 74, 65;          /* .text-secondary and .bg-secondary: ink-2, 4.5:1 on paper */
    --bs-link-color: #1A4D2E;
    --bs-link-color-rgb: 26, 77, 46;
    --bs-link-hover-color: #173B26;
    --bs-link-hover-color-rgb: 23, 59, 38;
    --bs-focus-ring-color: rgba(26, 77, 46, 0.35);

    /* One palette (D159 addendum, M1): Bootstrap's other accents are the studio's fern, honey and
       error. info = fern-900, success = fern-700, warning = honey (a fill with ink text; as text it
       is the dark gold, below), danger = the error red, light = cream, dark = ink. White text on
       every dark fill is 4.5:1 or more (tests/test_glass_contrast.py). */
    --bs-secondary: #3E4A41;
    --bs-secondary-color: #3E4A41;           /* .text-muted: ink-2, not the body colour at 75 % */
    --bs-secondary-color-rgb: 62, 74, 65;
    --bs-success: #2F6B45;
    --bs-success-rgb: 47, 107, 69;
    --bs-info: #173B26;
    --bs-info-rgb: 23, 59, 38;
    --bs-warning: #C9A24A;
    --bs-warning-rgb: 201, 162, 74;
    --bs-danger: #A8402A;
    --bs-danger-rgb: 168, 64, 42;
    --bs-light: #F6F1E4;
    --bs-light-rgb: 246, 241, 228;
    --bs-dark: #101812;
    --bs-dark-rgb: 16, 24, 18;
    --bs-code-color: #173B26;
    --bs-secondary-bg: #EDE6D3;              /* disabled fields, progress tracks: cream-2 */
    --bs-secondary-bg-rgb: 237, 230, 211;
    --bs-tertiary-bg: #F6F1E4;               /* .input-group-text, .bg-body-tertiary: cream */
    --bs-tertiary-bg-rgb: 246, 241, 228;
    --bs-highlight-bg: #F7EDD2;
    /* the tints behind alerts, list-group items and subtle badges */
    --bs-primary-text-emphasis: #173B26;
    --bs-primary-bg-subtle: #E6F0E2;
    --bs-primary-border-subtle: #8FB99A;
    --bs-success-text-emphasis: #173B26;
    --bs-success-bg-subtle: #E6F0E2;
    --bs-success-border-subtle: #8FB99A;
    --bs-info-text-emphasis: #173B26;
    --bs-info-bg-subtle: #E6F0E2;
    --bs-info-border-subtle: #8FB99A;
    --bs-warning-text-emphasis: #101812;
    --bs-warning-bg-subtle: #F7EDD2;
    --bs-warning-border-subtle: #E3C77F;
    --bs-danger-text-emphasis: #A8402A;
    --bs-danger-bg-subtle: #F8E8E3;
    --bs-danger-border-subtle: #A8402A;
    --bs-secondary-text-emphasis: #3E4A41;
    --bs-secondary-bg-subtle: #EDE6D3;
    --bs-secondary-border-subtle: #8C968F;
    --bs-light-text-emphasis: #3E4A41;
    --bs-light-bg-subtle: #FFFCF6;
    --bs-light-border-subtle: #D5E6D9;
    --bs-dark-text-emphasis: #101812;
    --bs-dark-bg-subtle: #EDE6D3;
    --bs-dark-border-subtle: #8C968F;

    /* custom.css draws with these; re-pointed to the Órga Warm Palette inside the shell only. */
    --orga-primary: #1A4D2E;
    --orga-secondary: #2F6B45;
    --orga-accent: #56966A;
    --orga-dark: #173B26;
    --orga-light: #E6F0E2;
}
body.og-shell h1, body.og-shell h2, body.og-shell h3,
body.og-shell .h1, body.og-shell .h2, body.og-shell .h3 {
    font-family: var(--og-font-heading);
}
body.og-shell ::placeholder {
    color: var(--og-muted);   /* 7.9:1 on white, as the studio */
    opacity: 1;
}

/* ---- The frame: sidebar column + content column ---------------------------------------------- */
.og-frame {
    display: flex;
    gap: 12px;
    width: 100%;
    min-height: 100vh;
    padding: 12px;
}
.og-column {
    display: flex;
    flex: 1 1 0%;
    flex-direction: column;
    gap: 12px;
    min-width: 0;   /* a wide table scrolls in its own box instead of widening the page */
}
@media (min-width: 768px) {
    .og-frame, .og-column { gap: 16px; }
    .og-frame { padding: 16px; }
}

/* ---- The sidebar panel (desktop) ------------------------------------------------------------- */
.og-sidebar {
    display: flex;
    flex-direction: column;
    flex: 0 0 240px;
    width: 240px;
    max-width: 240px;
    position: sticky;
    top: 16px;
    align-self: flex-start;
    max-height: calc(100vh - 32px);
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--og-ink);
    font-family: var(--og-font-body);
    transition: width .15s ease, flex-basis .15s ease, max-width .15s ease;
}
.og-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .25rem;
    flex-shrink: 0;
    min-height: 4rem;
    padding: 0 .75rem 0 1.25rem;
}
.og-sidebar-brand {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--og-font-heading);
    font-size: 1.125rem;
    line-height: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    color: var(--og-fern-800);
    text-decoration: none;
    border-radius: 6px;
}
.og-sidebar-brand:hover { color: var(--og-fern-900); }

.og-sidebar .sidebar-toggle,
.og-sidebar .og-drawer-close {
    display: none;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--og-ink-2);
    font-size: 1rem;
    transition: background-color .15s ease, color .15s ease;
}
.og-sidebar .sidebar-toggle:hover,
.og-sidebar .og-drawer-close:hover { background: var(--og-hover-bg); color: var(--og-fern-900); }
@media (min-width: 768px) {
    .og-sidebar .sidebar-toggle { display: inline-flex; }
}

/* The items: the studio's 12 px rounded rows, bold fern-900, with the salon's icons. */
.og-sidebar .nav {
    flex-wrap: nowrap;
    gap: 4px;
    padding: .5rem .75rem 1rem;
}
.og-sidebar .nav-item { min-width: 0; }
.og-sidebar .nav-item.mt-3 { margin-top: .5rem !important; }
.og-sidebar .nav-link {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0;
    padding: .5rem .75rem;
    border-radius: 12px;
    font-size: .875rem;
    line-height: 1.25rem;
    font-weight: 700;
    color: var(--og-fern-900);
    white-space: nowrap;
    transition: background-color .15s ease, color .15s ease;
}
.og-sidebar .nav-link i {
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
}
/* A label longer than the panel ends in an ellipsis; the full name stays in the link text. */
.og-sidebar .sidebar-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.og-sidebar .nav-link:hover,
.og-sidebar .nav-link:focus { background-color: var(--og-hover-bg); color: var(--og-fern-800); }
.og-sidebar .nav-link.active,
.og-sidebar .nav-link.active:hover,
.og-sidebar .nav-link.active:focus { background-color: var(--og-fern-800); color: #fff; }
/* Section labels (ADMINISTRATION, MARKETING, SYSTEM): the studio's 11 px uppercase label.
   `!important` only against the markup's Bootstrap utilities (px-3 mt-4 mb-1 text-muted). */
.og-sidebar .sidebar-heading {
    margin: .75rem 0 .25rem !important;
    padding: 0 .75rem !important;
    font-family: var(--og-font-body);
    font-size: .6875rem;
    line-height: 1rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--og-ink-2) !important;
}
/* The AI status: the studio's tagline strip at the foot of the panel (fern-600/20 line). */
.og-sidebar .sidebar-status {
    margin: auto 0 0 !important;
    padding: 1rem 1.25rem !important;
    border-top: 1px solid var(--og-line);
    border-radius: 0 !important;
    background: transparent !important;
    font-size: .75rem;
    line-height: 1rem;
    color: var(--og-ink-2);
}
.og-sidebar .sidebar-status h6 {
    margin-bottom: .25rem;
    font-family: var(--og-font-body);
    font-size: .75rem;
    font-weight: 700;
    color: var(--og-ink-2) !important;
}
.og-sidebar .sidebar-status .text-muted { color: var(--og-ink-2) !important; }
.og-sidebar .sidebar-status .text-success { color: var(--og-fern-800) !important; }

/* Focus: a 3 px fern-900 ring just outside the item (the panel's 12 px gutter holds it). */
.og-sidebar .nav-link:focus-visible,
.og-sidebar .sidebar-toggle:focus-visible,
.og-sidebar .og-drawer-close:focus-visible,
.og-sidebar-brand:focus-visible {
    outline: 3px solid var(--og-fern-900);
    outline-offset: 0;
    box-shadow: none;
}

/* ---- The rail (D109; the default on /help, D157): 64 px, 44 px icon buttons -------------------- */
@media (min-width: 768px) {
    html.sidebar-collapsed .og-sidebar { flex-basis: 64px; width: 64px; max-width: 64px; }
    html.sidebar-collapsed .og-sidebar-head { justify-content: center; padding: 0; }
    html.sidebar-collapsed .og-sidebar-brand { display: none; }
    html.sidebar-collapsed .og-sidebar .sidebar-toggle i { transform: rotate(180deg); }
    html.sidebar-collapsed .og-sidebar .nav { align-items: center; padding: .5rem 0 1rem; }
    html.sidebar-collapsed .og-sidebar .sidebar-label,
    html.sidebar-collapsed .og-sidebar .sidebar-heading,
    html.sidebar-collapsed .og-sidebar .sidebar-status small,
    html.sidebar-collapsed .og-sidebar .sidebar-status span:not(.status-dot) { display: none !important; }
    html.sidebar-collapsed .og-sidebar .nav-item.mt-3 { margin-top: .35rem !important; }
    html.sidebar-collapsed .og-sidebar .nav-link {
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
    }
    html.sidebar-collapsed .og-sidebar .nav-link i { width: auto; margin: 0 !important; font-size: 1.125rem; }
    html.sidebar-collapsed .og-sidebar .nav-link .badge {
        position: absolute;
        top: 1px;
        right: 1px;
        margin: 0 !important;
        padding: .15em .35em;
        font-size: .625rem;
    }
    html.sidebar-collapsed .og-sidebar .sidebar-status { padding: .75rem 0 !important; text-align: center; }
    html.sidebar-collapsed .og-sidebar .sidebar-status h6 { margin: 0; }
    html.sidebar-collapsed .og-sidebar .sidebar-status h6 i { margin: 0 !important; font-size: 1.1rem; }
    html.sidebar-collapsed .og-sidebar .sidebar-status .status-dot {
        display: inline-block;
        width: 8px;
        height: 8px;
        margin-top: 2px;
        border-radius: 50%;
        background: var(--og-fern-700);
    }
}

/* ---- The phone menu: the same panel as an off-canvas drawer (below 768 px) -------------------- */
.og-drawer-backdrop { display: none; }
@media (max-width: 767.98px) {
    .og-sidebar.og-glass {
        position: fixed;
        top: 12px;
        bottom: 12px;
        left: 12px;
        z-index: 1045;
        flex: none;
        width: 240px;
        max-width: calc(100vw - 24px);
        max-height: none;
        background: var(--og-glass-strong-bg);   /* nearly opaque: it floats over the page */
        transform: translateX(-110%);
        visibility: hidden;                         /* closed: out of the tab order even before the script runs */
        transition: transform .2s ease-out, visibility 0s linear .2s;
    }
    html.og-drawer-open .og-sidebar.og-glass {
        transform: none;
        visibility: visible;
        transition: transform .2s ease-out, visibility 0s;
    }
    .og-sidebar .og-drawer-close { display: inline-flex; }
    .og-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1040;
        background: rgba(0, 0, 0, 0.4);
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }
    html.og-drawer-open .og-drawer-backdrop { opacity: 1; pointer-events: auto; }
}

/* ---- The header card ------------------------------------------------------------------------- */
/* position + z-index: the blur makes the card its own stacking context, so without them the user
   menu's dropdown would open underneath the cards of the page below it. Under the phone drawer
   (1040/1045), the help assistant (1040) and Bootstrap's modals (1050+). */
.og-topbar {
    position: relative;
    z-index: 1020;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .5rem .75rem;
    min-height: 4rem;
    padding: .625rem .75rem;
}
@media (min-width: 576px) {
    .og-topbar { padding: .75rem 1.5rem; }
}
.og-topbar-start {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: .75rem;
    min-width: 0;
}
.og-topbar-titles { min-width: 0; }
.og-eyebrow,
.og-context {
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.og-eyebrow {
    font-size: .75rem;
    line-height: 1rem;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--og-ink-2);
}
a.og-eyebrow { display: block; text-decoration: none; }
a.og-eyebrow:hover { color: var(--og-fern-900); }
.og-context {
    display: none;
    font-size: .875rem;
    line-height: 1.25rem;
    color: var(--og-ink);
}
@media (min-width: 640px) {
    .og-context { display: block; }
}
.og-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    margin-left: -.25rem;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--og-ink-2);
    font-size: 1.25rem;
    transition: background-color .15s ease, color .15s ease;
}
.og-menu-btn:hover { background: var(--og-hover-bg); color: var(--og-ink); }
@media (min-width: 768px) {
    .og-menu-btn { display: none; }
}
.og-topbar-end {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .5rem;
    min-width: 0;
    margin-left: auto;
}

/* The pill buttons: the studio's rounded-full chips (fern-600/40 line on white/50, 12 px text,
   26 px tall); 36 px on a touch screen and on tablet widths, so a finger hits them. */
.og-pill {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    min-width: 26px;
    min-height: 26px;
    padding: .25rem .75rem;
    border: 1px solid var(--og-pill-border);
    border-radius: 999px;
    background: var(--og-pill-bg);
    color: var(--og-ink-2);
    font-family: var(--og-font-body);
    font-size: .75rem;
    font-weight: 400;
    line-height: 1rem;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.og-pill:hover,
.og-pill[aria-expanded="true"] {
    border-color: var(--og-fern-700);
    background: var(--og-fern-50);
    color: var(--og-fern-900);
}
.og-pill-help { border-color: var(--og-fern-700); color: var(--og-muted); }
.og-pill-danger,
.og-pill-danger:hover { border-color: var(--og-error); background: var(--og-error); color: #fff; }
.og-pill-danger:hover { border-color: var(--og-error-dark); background: var(--og-error-dark); }
.og-pill .lang-text { font-weight: 700; }
.og-user-name {
    max-width: 12rem;
    overflow: hidden;
    text-overflow: ellipsis;
}
.og-pill.dropdown-toggle::after { margin-left: .125rem; }
.og-pill:focus-visible,
.og-menu-btn:focus-visible,
a.og-eyebrow:focus-visible {
    outline: 3px solid var(--og-fern-800);
    outline-offset: 2px;
    box-shadow: none;
}
@media (max-width: 1199.98px), (pointer: coarse) {
    .og-pill { min-width: 36px; min-height: 36px; }
}
/* Phones: one row too; the salon name gives way (ellipsis) when the Salon closed pill is shown. */
@media (max-width: 575.98px) {
    .og-pill .og-user-name {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        margin: -1px !important;
        padding: 0 !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
    .og-topbar { flex-wrap: nowrap; gap: .5rem; }
    .og-topbar-end { flex-wrap: nowrap; flex-shrink: 0; gap: .375rem; }
    .og-pill { padding: .25rem .5rem; }
}
/* Phones and tablets (M2): icon-only pills, so the header card stays one row; the label stays for
   screen readers (visually hidden, not removed). On a tablet the signed-in name stays visible
   (shortened), because staff check it on the shared tablet before recording a visit; a phone shows
   only the person icon. */
@media (min-width: 576px) and (max-width: 1199.98px) {
    .og-pill { padding: .25rem .625rem; }
    .og-user-name { max-width: 7.5rem; }
}
@media (max-width: 1199.98px) {
    .og-pill .og-pill-label:not(.og-user-name) {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        margin: -1px !important;
        padding: 0 !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
}

/* ---- The content ------------------------------------------------------------------------------ */
/* The studio's main: 32 px top and bottom, 24 px sides (40 px from 1024 px). On a phone the glass
   pages use the full column, so their panels line up with the header card. */
.og-main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1rem 0;
}
@media (min-width: 576px) {
    .og-main { padding: 2rem 1.5rem; }
}
@media (min-width: 1024px) {
    .og-main { padding: 2rem 2.5rem; }
}
/* Every other signed-in page (main.og-cards, D159 addendum): as the studio, the page sits straight on
   the colour patches and every Bootstrap card is a glass card. The cards are the studio's
   og-glass-strong (paper at 92 %, no blur: the content is dense and the tablets are slow), so
   tables, forms and the greys keep their contrast; a card inside a card is a light tile (the studio's
   og-tile), never a second panel. No backdrop-filter, reduced transparency and print: solid paper. */
.og-main.og-cards .card {
    --bs-card-bg: var(--og-card-bg);
    --bs-card-border-color: var(--og-glass-border);
    --bs-card-border-radius: var(--og-radius-panel);
    --bs-card-inner-border-radius: 21px;
    --bs-card-cap-bg: transparent;
    --bs-card-cap-padding-y: .875rem;
    --bs-card-cap-padding-x: 1.25rem;
    --bs-card-spacer-x: 1.25rem;
    border: 1px solid var(--og-glass-border);
    box-shadow: var(--og-shadow) !important;   /* the studio's one shadow; beats .shadow-sm and custom.css's hover */
    color: var(--og-ink);
}
.og-cards .card .card,
.og-cards .modal .card,
.og-cards .card.og-tile {
    --bs-card-bg: var(--og-tile-bg);
    --bs-card-border-color: var(--og-tile-border);
    --bs-card-border-radius: var(--og-radius-tile);
    --bs-card-inner-border-radius: 15px;
    border-color: var(--og-tile-border);
    box-shadow: none !important;
}
/* The card headers: no grey bar and no coloured bar, the studio's fern-100 hairline and fern-900
   heading. `!important` only against the markup's Bootstrap utilities (bg-primary text-white ...).
   A warning or danger header keeps its meaning as the honey or error tint. */
.og-cards .card > .card-header {
    background: transparent !important;
    border-bottom: 1px solid var(--og-fern-100);
    color: var(--og-fern-900) !important;
    font-family: var(--og-font-body);
    font-weight: 700;
}
.og-cards .card > .card-header.border-0 { border-bottom: 0; }
.og-cards .card > .card-header.bg-warning { background: var(--og-honey-100) !important; color: var(--og-ink) !important; }
.og-cards .card > .card-header.bg-danger { background: var(--og-error-50) !important; color: var(--og-error) !important; }
.og-cards .card > .card-header :is(h1, h2, h3, h4, h5, h6, .card-title) {
    font-family: var(--og-font-heading);
    font-weight: 600;
    color: inherit;
}
.og-cards .card > .card-header :is(.text-white, .text-white-50, .text-dark, .card-title, i):not(.badge, .btn, .badge *, .btn *),
.og-cards .card > .card-header.bg-warning :is(.card-title, i):not(.badge *, .btn *) { color: inherit !important; }
/* A card that is itself a solid fill (a stat card: bg-primary text-white) keeps its white header. */
.og-cards .card:is(.bg-primary, .bg-success, .bg-info, .bg-danger, .bg-secondary, .bg-dark):not([class*="bg-opacity"]) > .card-header {
    color: #fff !important;
    border-bottom-color: rgba(255, 255, 255, 0.25);
}
.og-cards .card > .card-header :is(.btn-light, .btn-outline-light) {
    --bs-btn-color: var(--og-fern-800);
    --bs-btn-bg: var(--og-pill-bg);
    --bs-btn-border-color: var(--og-fern-700);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--og-fern-800);
    --bs-btn-hover-border-color: var(--og-fern-800);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--og-fern-900);
    --bs-btn-active-border-color: var(--og-fern-900);
}
.og-cards .card > .card-footer {
    background: transparent;
    border-top: 1px solid var(--og-fern-100);
}
.og-cards .card .list-group { --bs-list-group-bg: transparent; --bs-list-group-border-color: var(--og-fern-100); }

/* Page headings, as the studio's (24 px 700 fern-800 in Outfit); an h2 that is not in a card is a
   section title. Never on a solid fill (a stat card, a coloured block): those keep their white. */
.og-cards :is(h1, .h1, h2, .h2):not(.text-white):not([class*="bg-"] *):not(.stats-card *):not(.modal *) {
    font-family: var(--og-font-heading);
    color: var(--og-fern-800);
    letter-spacing: -0.025em;
}
.og-cards :is(h1, .h1):not(.text-white):not([class*="bg-"] *):not(.stats-card *):not(.modal *) {
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 700;
}
.og-cards h2:not(.card h2):not(.modal h2):not([class*="bg-"] *):not(.stats-card *) {
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-weight: 600;
}
.og-cards .card :is(h3, h4, h5, h6):not(.text-white):not([class*="bg-"] *):not(.stats-card *) { color: var(--og-fern-900); }

/* Text straight on the patches (outside a card, a modal, an alert or a menu): full ink for the
   muted greys and fern-900 for links, which keep 4.5:1 over the darkest patch. */
.og-cards :is(.text-muted, .text-secondary, .text-body-secondary):not(.card *, .modal *, .alert *, .dropdown-menu *) {
    color: var(--og-ink) !important;
}
.og-cards a:not(.btn):not(.dropdown-item):not(.nav-link):not(.page-link):not(.list-group-item):not(.card *, .modal *, .alert *, .dropdown-menu *) {
    color: var(--og-fern-900);
}
/* A table that is not in a card gets the card's paper under its rows. */
.og-cards .table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--og-ink);
    --bs-table-border-color: rgba(23, 59, 38, 0.12);
    --bs-table-striped-bg: rgba(23, 59, 38, 0.03);
    --bs-table-striped-color: var(--og-ink);
    --bs-table-hover-bg: rgba(230, 240, 226, 0.7);
    --bs-table-hover-color: var(--og-ink);
}
.og-cards .table:not(.card .table):not(.modal .table) { --bs-table-bg: var(--og-card-bg); }

.og-flash { margin-bottom: 1rem; }
.og-main > .og-flash:last-child { margin-bottom: 0; }

/* The sign-in page draws its own gradient page and a full-height box; in the shell it is a card on
   the patches. */
body.og-shell .login-container { min-height: 0; padding: 2rem 0; background: none; }

/* ---- The footer card -------------------------------------------------------------------------- */
.og-footer {
    padding: 1rem 1.5rem;
    font-size: .75rem;
    line-height: 1.125rem;
    color: var(--og-ink-2);
}
.og-footer-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: .75rem 2rem;
}
.og-footer p { margin: 0 0 .125rem; }
.og-footer .og-footer-title {
    margin-bottom: .25rem;
    font-family: var(--og-font-heading);
    font-size: .875rem;
    font-weight: 600;
    color: var(--og-fern-900);
}
.og-footer .og-footer-copy {
    margin: .75rem 0 0;
    padding-top: .75rem;
    border-top: 1px solid var(--og-line);
}
@media (min-width: 768px) {
    .og-footer-end { text-align: right; }
}

/* ---- Bootstrap in the Órga palette (inside the shell only) ------------------------------------ */
body.og-shell .btn-primary {
    --bs-btn-bg: #1A4D2E;
    --bs-btn-border-color: #1A4D2E;
    --bs-btn-hover-bg: #173B26;
    --bs-btn-hover-border-color: #173B26;
    --bs-btn-active-bg: #173B26;
    --bs-btn-active-border-color: #173B26;
    --bs-btn-disabled-bg: #1A4D2E;
    --bs-btn-disabled-border-color: #1A4D2E;
}
body.og-shell .btn-outline-primary {
    --bs-btn-color: #1A4D2E;
    --bs-btn-border-color: #1A4D2E;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #1A4D2E;
    --bs-btn-hover-border-color: #1A4D2E;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #173B26;
    --bs-btn-active-border-color: #173B26;
    --bs-btn-disabled-color: #1A4D2E;
    --bs-btn-disabled-border-color: #1A4D2E;
}
/* The other buttons (M1): Bootstrap writes their colours as literals, so each variant is re-pointed. */
body.og-shell .btn-success {
    --bs-btn-color: #fff; --bs-btn-bg: #2F6B45; --bs-btn-border-color: #2F6B45;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #1A4D2E; --bs-btn-hover-border-color: #1A4D2E;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #173B26; --bs-btn-active-border-color: #173B26;
    --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: #2F6B45; --bs-btn-disabled-border-color: #2F6B45;
}
body.og-shell .btn-info {
    --bs-btn-color: #fff; --bs-btn-bg: #173B26; --bs-btn-border-color: #173B26;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #101812; --bs-btn-hover-border-color: #101812;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #101812; --bs-btn-active-border-color: #101812;
    --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: #173B26; --bs-btn-disabled-border-color: #173B26;
}
body.og-shell .btn-warning {
    --bs-btn-color: #101812; --bs-btn-bg: #C9A24A; --bs-btn-border-color: #C9A24A;
    --bs-btn-hover-color: #101812; --bs-btn-hover-bg: #E3C77F; --bs-btn-hover-border-color: #E3C77F;
    --bs-btn-active-color: #101812; --bs-btn-active-bg: #E3C77F; --bs-btn-active-border-color: #E3C77F;
    --bs-btn-disabled-color: #101812; --bs-btn-disabled-bg: #C9A24A; --bs-btn-disabled-border-color: #C9A24A;
}
body.og-shell .btn-danger {
    --bs-btn-color: #fff; --bs-btn-bg: #A8402A; --bs-btn-border-color: #A8402A;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #8C3423; --bs-btn-hover-border-color: #8C3423;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #8C3423; --bs-btn-active-border-color: #8C3423;
    --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: #A8402A; --bs-btn-disabled-border-color: #A8402A;
}
body.og-shell .btn-secondary {
    --bs-btn-color: #fff; --bs-btn-bg: #3E4A41; --bs-btn-border-color: #3E4A41;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #101812; --bs-btn-hover-border-color: #101812;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #101812; --bs-btn-active-border-color: #101812;
    --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: #3E4A41; --bs-btn-disabled-border-color: #3E4A41;
}
body.og-shell .btn-dark {
    --bs-btn-color: #fff; --bs-btn-bg: #101812; --bs-btn-border-color: #101812;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #173B26; --bs-btn-hover-border-color: #173B26;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #173B26; --bs-btn-active-border-color: #173B26;
}
body.og-shell .btn-light {
    --bs-btn-color: #173B26; --bs-btn-bg: #E6F0E2; --bs-btn-border-color: #D5E6D9;
    --bs-btn-hover-color: #173B26; --bs-btn-hover-bg: #D5E6D9; --bs-btn-hover-border-color: #8FB99A;
    --bs-btn-active-color: #173B26; --bs-btn-active-bg: #D5E6D9; --bs-btn-active-border-color: #8FB99A;
}
body.og-shell .btn-outline-success,
body.og-shell .btn-outline-info,
body.og-shell .btn-outline-danger,
body.og-shell .btn-outline-secondary,
body.og-shell .btn-outline-dark,
body.og-shell .btn-outline-purple {
    --bs-btn-hover-color: #fff;
    --bs-btn-active-color: #fff;
    --bs-btn-bg: transparent;
}
body.og-shell .btn-outline-success {
    --bs-btn-color: #2F6B45; --bs-btn-border-color: #2F6B45;
    --bs-btn-hover-bg: #2F6B45; --bs-btn-hover-border-color: #2F6B45;
    --bs-btn-active-bg: #1A4D2E; --bs-btn-active-border-color: #1A4D2E;
    --bs-btn-disabled-color: #2F6B45; --bs-btn-disabled-border-color: #2F6B45;
}
body.og-shell .btn-outline-info {
    --bs-btn-color: #173B26; --bs-btn-border-color: #173B26;
    --bs-btn-hover-bg: #173B26; --bs-btn-hover-border-color: #173B26;
    --bs-btn-active-bg: #101812; --bs-btn-active-border-color: #101812;
    --bs-btn-disabled-color: #173B26; --bs-btn-disabled-border-color: #173B26;
}
body.og-shell .btn-outline-warning {
    --bs-btn-color: #7A5C00; --bs-btn-border-color: #9A7530; --bs-btn-bg: transparent;
    --bs-btn-hover-color: #101812; --bs-btn-hover-bg: #C9A24A; --bs-btn-hover-border-color: #C9A24A;
    --bs-btn-active-color: #101812; --bs-btn-active-bg: #E3C77F; --bs-btn-active-border-color: #E3C77F;
    --bs-btn-disabled-color: #7A5C00; --bs-btn-disabled-border-color: #9A7530;
}
body.og-shell .btn-outline-danger {
    --bs-btn-color: #A8402A; --bs-btn-border-color: #A8402A;
    --bs-btn-hover-bg: #A8402A; --bs-btn-hover-border-color: #A8402A;
    --bs-btn-active-bg: #8C3423; --bs-btn-active-border-color: #8C3423;
    --bs-btn-disabled-color: #A8402A; --bs-btn-disabled-border-color: #A8402A;
}
body.og-shell .btn-outline-secondary {
    --bs-btn-color: #3E4A41; --bs-btn-border-color: #8C968F;
    --bs-btn-hover-bg: #3E4A41; --bs-btn-hover-border-color: #3E4A41;
    --bs-btn-active-bg: #101812; --bs-btn-active-border-color: #101812;
    --bs-btn-disabled-color: #3E4A41; --bs-btn-disabled-border-color: #8C968F;
}
body.og-shell .btn-outline-dark {
    --bs-btn-color: #101812; --bs-btn-border-color: #101812;
    --bs-btn-hover-bg: #101812; --bs-btn-hover-border-color: #101812;
    --bs-btn-active-bg: #173B26; --bs-btn-active-border-color: #173B26;
}
/* custom.css's purple questionnaire button (literal colours, so they are replaced here). */
body.og-shell .btn-outline-purple,
body.og-shell .btn-outline-purple:disabled,
body.og-shell .btn-outline-purple.disabled { color: #173B26; border-color: #173B26; background-color: transparent; }
body.og-shell .btn-outline-purple:hover,
body.og-shell .btn-outline-purple:active,
body.og-shell .btn-outline-purple.active { color: #fff; border-color: #173B26; background-color: #173B26; }
body.og-shell .btn-outline-purple:focus { box-shadow: none; }

/* Text, fills and badges. Honey is a fill, never text: .text-warning is the dark gold (6.1:1 on a
   card); a honey or cream fill takes ink text, every fern, ink and red fill takes white text. */
body.og-shell .text-warning { color: #7A5C00 !important; }
body.og-shell .badge:is(.bg-warning, .bg-light, .text-bg-warning, .text-bg-light),
body.og-shell :is(.bg-warning, .bg-light):is(.text-white, .text-light) { color: #101812 !important; }
body.og-shell :is(.text-bg-primary, .text-bg-success, .text-bg-info, .text-bg-danger, .text-bg-secondary, .text-bg-dark) { color: #fff !important; }
body.og-shell :is(.bg-primary, .bg-success, .bg-info, .bg-danger, .bg-secondary, .bg-dark):is(.text-dark, .text-body):not([class*="bg-opacity"]) { color: #fff !important; }
/* Muted text on a dark fill (the AI console on bg-dark, stat cards) is white at 85 %, not ink-2. */
body.og-shell :is(.bg-dark, .bg-primary, .bg-success, .bg-info, .bg-danger, .bg-secondary):not([class*="bg-opacity"]):not(.og-cards .card > .card-header) :is(.text-muted, .text-secondary, .text-body-secondary) {
    color: rgba(255, 255, 255, 0.85) !important;
}
body.og-shell .table-light {
    --bs-table-color: #173B26;
    --bs-table-bg: #E6F0E2;
    --bs-table-border-color: rgba(23, 59, 38, 0.15);
    --bs-table-striped-bg: #DDEAD8;
    --bs-table-striped-color: #173B26;
    --bs-table-active-bg: #D5E6D9;
    --bs-table-active-color: #173B26;
    --bs-table-hover-bg: #D5E6D9;
    --bs-table-hover-color: #173B26;
}
/* Table headers (L2): fern-900 on fern-50 everywhere. */
body.og-shell .table > thead > tr > th {
    background-color: #E6F0E2;
    color: #173B26;
    box-shadow: none;
}

body.og-shell .form-control:focus,
body.og-shell .form-select:focus,
body.og-shell .form-check-input:focus {
    border-color: #2F6B45;
    box-shadow: 0 0 0 .2rem rgba(47, 107, 69, 0.25);
}
body.og-shell .form-check-input:checked {
    background-color: #1A4D2E;
    border-color: #1A4D2E;
}
body.og-shell .dropdown-menu {
    --bs-dropdown-bg: #FFFCF6;
    --bs-dropdown-link-color: #101812;
    --bs-dropdown-link-hover-color: #173B26;
    --bs-dropdown-link-hover-bg: #E6F0E2;
    --bs-dropdown-link-active-color: #fff;
    --bs-dropdown-link-active-bg: #1A4D2E;
    --bs-dropdown-inner-border-radius: 13px;
    border: 1px solid rgba(23, 59, 38, 0.12);
    border-radius: var(--og-radius-control);
    box-shadow: var(--og-shadow);
}
body.og-shell .modal {
    --bs-modal-bg: #FFFCF6;
    --bs-modal-border-color: rgba(23, 59, 38, 0.12);
    --bs-modal-border-radius: 22px;
    --bs-modal-inner-border-radius: 21px;
    --bs-modal-box-shadow: 0 8px 24px rgba(23, 59, 38, 0.16);
}
body.og-shell .card {
    --bs-card-border-radius: 16px;
    --bs-card-inner-border-radius: 15px;
}
body.og-shell .alert { --bs-alert-border-radius: 14px; }
/* custom.css gives these two a 10% tint and mid-green / mid-red text (below 4.5:1); here they
   are the palette's fern and error notices. */
body.og-shell .alert-success { background-color: #E6F0E2; border-color: #8FB99A; color: #173B26; }
body.og-shell .alert-danger { background-color: #F8E8E3; border-color: #A8402A; color: #A8402A; }
body.og-shell .alert { --bs-alert-link-color: inherit; }
body.og-shell .nav-pills { --bs-nav-pills-link-active-bg: #1A4D2E; }
body.og-shell .list-group {
    --bs-list-group-active-bg: #1A4D2E;
    --bs-list-group-active-border-color: #1A4D2E;
    --bs-list-group-action-hover-bg: #E6F0E2;
}
body.og-shell .pagination {
    --bs-pagination-color: #1A4D2E;
    --bs-pagination-hover-color: #173B26;
    --bs-pagination-hover-bg: #E6F0E2;
    --bs-pagination-focus-color: #173B26;
    --bs-pagination-focus-bg: #E6F0E2;
    --bs-pagination-focus-box-shadow: none;
    --bs-pagination-active-bg: #1A4D2E;
    --bs-pagination-active-border-color: #1A4D2E;
}
body.og-shell .accordion {
    --bs-accordion-active-bg: #E6F0E2;
    --bs-accordion-active-color: #173B26;
    --bs-accordion-btn-focus-box-shadow: none;
}

/* ---- Keyboard focus: one fern ring everywhere in the shell, no Bootstrap blue halo ------------- */
/* Scoped to the frame and the modals, so the help assistant keeps its own rings (honey on its fern
   title bar). On a solid dark fill (fern, ink, red headers) the ring is honey, 3:1 on fern. */
.og-frame :focus-visible,
.modal :focus-visible {
    outline: 3px solid var(--og-fern-800);
    outline-offset: 2px;
}
.og-frame .btn:focus-visible,
.modal .btn:focus-visible,
.og-frame .btn-close:focus-visible,
.modal .btn-close:focus-visible,
.og-frame .nav-link:focus-visible,
.og-frame .dropdown-item:focus-visible,
.og-frame .list-group-item:focus-visible,
.og-frame .page-link:focus-visible,
.og-frame .accordion-button:focus-visible {
    box-shadow: none;
}
.og-frame .btn-check:focus-visible + .btn,
.modal .btn-check:focus-visible + .btn {
    outline: 3px solid var(--og-fern-800);
    outline-offset: 2px;
    box-shadow: none;
}
.og-frame :is(.bg-primary, .bg-dark, .bg-success, .bg-danger, .bg-info, .bg-secondary):not([class*="bg-opacity"]) :focus-visible,
.modal :is(.bg-primary, .bg-dark, .bg-success, .bg-danger, .bg-info, .bg-secondary):not([class*="bg-opacity"]) :focus-visible {
    outline-color: var(--og-honey-300);
}
/* A coloured card header is flattened to the card's paper (above), so its ring is fern again. */
.og-cards .card:not(:is(.bg-primary, .bg-success, .bg-info, .bg-danger, .bg-secondary, .bg-dark)) > .card-header :focus-visible {
    outline-color: var(--og-fern-800);
}

/* ---- No backdrop-filter, or reduced transparency asked for: solid paper ------------------------ */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .og-sidebar.og-glass, .og-topbar.og-glass, .og-footer.og-glass { background: var(--og-paper); }
}
@media (prefers-reduced-transparency: reduce) {
    .og-sidebar.og-glass, .og-topbar.og-glass, .og-footer.og-glass {
        background: var(--og-paper);
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
        border-color: rgba(23, 59, 38, 0.18);
    }
    .og-pill { background: #fff; }
}

/* ---- Less motion asked for: the drawer and the rail appear without sliding --------------------- */
@media (prefers-reduced-motion: reduce) {
    .og-sidebar, .og-sidebar.og-glass, html.og-drawer-open .og-sidebar.og-glass,
    .og-drawer-backdrop, .og-pill, .og-menu-btn { transition: none; }
}

/* ---- Print: the page content only, on white ----------------------------------------------------- */
@media print {
    body.og-shell { background: #fff !important; background-image: none !important; }
    .og-sidebar, .og-topbar, .og-footer, .og-drawer-backdrop, .og-menu-btn { display: none !important; }
    .og-frame, .og-column { display: block; padding: 0; min-height: 0; }
    .og-main { padding: 0; background: #fff; }
    .og-main.og-cards .card {
        --bs-card-bg: #fff;
        border: 1px solid #ccc;
        box-shadow: none !important;
    }
}
