/*
 * riad.css — the Riad shell, v6 (SYN-362, docs/design/handoff/v6/syndic.css and screens/Main.html, Building.html,
 * ManagerPhone.html, ManagerMenu.html). Tokens and fonts are in syndic-tokens.css (.riad-stage).
 *
 * Everything here sits under .riad-stage, which renders only when Ui:V5:Mode shows Riad to the user and they chose
 * it (MainLayout), so Classique is untouched. Fixed rem scale (15 px), logical properties only (RTL-safe).
 * Breakpoints: compact < 768 (tab bar + Menu sheet, no rail), wide >= 768 (the 264 px labelled rail).
 */

.riad-stage {
    container-type: inline-size;
    min-height: calc(100vh / var(--page-zoom, 1));
    background: var(--bg);
    color: var(--ink);
}

.riad {
    font-size: 15px;
    line-height: 1.5;
    font-family: var(--f-sans);
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
    min-height: calc(100vh / var(--page-zoom, 1));
    display: flex;
    background: var(--bg);
}

[dir="rtl"] .riad,
[dir="rtl"] .riad-sheet { font-family: var(--f-ar); }

/* The reset covers the shell's own controls only, at zero specificity: buttons and links in the pages keep
   their own styles (.btn, links in cards). */
:where(.riad-rail, .riad-sheet, .riad-top, .riad-tabbar, .riad-pal) :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:where(.riad-rail, .riad-sheet, .riad-top, .riad-tabbar, .riad-pal) :where(a) { color: inherit; text-decoration: none; }
.riad-stage :is(.riad-rail, .riad-sheet, .riad-top, .riad-tabbar, .riad-pal) :is(a, button):focus-visible {
    outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-md);
}

/* ---------- Rail (Main.html .rail) ------------------------------------ */

.riad-rail {
    flex: 0 0 264px;
    width: 264px;
    position: sticky;
    top: 0;
    /* Above the menu scrim (29), so the building switcher's menu inside it takes clicks. */
    z-index: 31;
    height: calc(100vh / var(--page-zoom, 1));
    overflow-y: auto;
    background: var(--rail);
    color: var(--rail-ink);
    border-inline-end: 1px solid var(--rail-line);
}
.riad-rail-in { display: flex; flex-direction: column; gap: 14px; padding: 18px 14px; min-height: 100%; }
.riad-brand { display: flex; padding: 0 6px 8px; }

/* ---------- Brand block (SYN-409, riad-navy mockups .brand.b1) ------------------------------------------------------
   The logo, then "Zenata" over "SYNDIC MANAGEMENT". The top of "Zenata" lines up with the top of the logo, the bottom of
   "SYNDIC MANAGEMENT" with its bottom: logo 42.25 px tall from 2.75 px, text block 48 px (two 24 px lines). */
.brand-block { display: inline-flex; align-items: flex-start; gap: 10px; text-decoration: none; }
.brand-block-logo { height: 42.25px; width: auto; margin-top: 2.75px; display: block; flex: none; }
.brand-block-txt { display: block; line-height: 24px; }
.brand-block-name { display: block; font-family: var(--f-serif); font-weight: 400; font-size: 26px; line-height: 24px; letter-spacing: 0; }
.brand-block-sub { display: block; font-family: var(--f-sans); font-weight: 500; font-size: 12px; line-height: 24px; letter-spacing: .6px; text-transform: uppercase; }
.brand-block--navy { color: #ffffff; }
.brand-block--white { color: var(--navy, #0A2246); }
/* Dark theme: a white-background brand sits on a dark surface, so it takes the navy one's logo and light text. */
[data-theme="dark"] .riad-stage .riad-top .brand-block--white { color: var(--ink); }
[data-theme="dark"] .riad-stage .riad-top .brand-block--white .brand-block-logo { content: url('/brand/zenata-logo-onnavy.svg'); }
[dir="rtl"] .brand-block-name { font-family: var(--f-serif), var(--f-ar); }
/* The top bar (the riad-navy finances.html .brand values): logo 31 px from 1 px, two 17 px lines. */
.brand-block--compact { gap: 8px; }
.brand-block--compact .brand-block-logo { height: 31px; margin-top: 1px; }
.brand-block--compact .brand-block-txt { line-height: 17px; }
.brand-block--compact .brand-block-name { font-size: 19px; line-height: 17px; }
.brand-block--compact .brand-block-sub { font-size: 11px; line-height: 17px; letter-spacing: .5px; }

/* ---------- Agency block (SYN-409): under the brand, the agency's logo (or initials), name and size. ---------------- */
.riad-agency {
    display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px;
    background: rgba(255, 255, 255, .07); border: 1px solid var(--rail-line);
}
.riad-agency-logo {
    width: 34px; height: 34px; border-radius: 8px; flex: none; display: grid; place-items: center; overflow: hidden;
    background: #ffffff; color: #7a3e12; border: 2px solid #e6b866; font-weight: 800; font-size: 12px; letter-spacing: .5px;
}
.riad-agency-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.riad-agency-txt { min-width: 0; }
.riad-agency-name { display: block; font-weight: 600; font-size: 13px; color: var(--rail-ink-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.riad-agency-meta { display: block; font-size: 11.5px; opacity: .8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.riad-switchwrap { position: relative; }
.riad-stage .riad-switch {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; text-align: start;
    background: rgba(255, 255, 255, .07); color: var(--rail-ink); border: 1px solid var(--rail-line); border-radius: var(--r-md);
}
.riad-stage .riad-switch:hover { background: var(--rail-hover); }
.riad-switch-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); flex: none; }
.riad-switch-txt { min-width: 0; flex: 1; }
.riad-switch-name { display: block; font-weight: 600; font-size: .95rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.riad-switch-name { color: var(--rail-ink-strong); }
.riad-switch-meta { display: block; font-size: .82rem; opacity: .8; }
.riad-switch > :last-child { opacity: .8; transform: rotate(90deg); flex: none; }

.riad-nav { display: flex; flex-direction: column; gap: 2px; }
.riad-stage .riad-nav a {
    display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 7px 10px;
    border-radius: var(--r-md); color: var(--rail-ink); font-weight: 500; font-size: .97rem;
}
.riad-stage .riad-nav a:hover { background: var(--rail-hover); color: var(--rail-ink-strong); }
.riad-stage .riad-nav a.on { background: var(--rail-act-bg); color: var(--rail-act-ink); font-weight: 600; }
.riad-nav-lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.riad-count {
    margin-inline-start: auto; font-size: .82rem; font-weight: 600; color: var(--rail-act-ink);
    background: var(--rail-act-bg); border-radius: var(--r-pill); padding: 0 8px; min-width: 24px; text-align: center;
}
/* Main.html: Aujourd'hui's count is the urgent decisions, in red. */
.riad-count.crit { background: var(--crit); color: var(--surface); }
/* ManagerMenu.html: the building's name, then "Agence", over their entries on the phone Menu. */
.riad-nav-group { font-size: .82rem; font-weight: 600; color: var(--rail-ink); opacity: .75; padding: 4px 10px; margin-top: 10px; }
.riad-nav-group:first-child { margin-top: 0; }
.riad-sheet .riad-nav a { min-height: 44px; }
.riad-nav .riad-sub {
    display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px; margin-inline-start: 19px;
    padding-inline-start: 20px; border-inline-start: 1px solid var(--rail-line);
}
.riad-stage .riad-nav .riad-sub a { min-height: 34px; font-size: .93rem; padding: 5px 10px; }
.riad-stage .riad-nav .riad-sub a.on { background: var(--rail-act-bg); color: var(--rail-act-ink); }
/* SYN-381: one icon per sub-item, quieter than the space's own. */
.riad-stage .riad-nav .riad-sub a svg { flex: none; opacity: .75; }
.riad-stage .riad-nav .riad-sub a.on svg { color: currentColor; }
/* SYN-409: a line between the spaces and the foot (Documents, Réglages), as in the mockup. */
.riad-rail-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--rail-line); }

/* ---------- Column and top bar (Main.html .main, .top) ---------------- */

.riad-col { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; }
.riad-top {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 12px; padding: 12px 28px;
    background: var(--surface); border-bottom: 1px solid var(--line);
}
.riad-crumbs { display: flex; align-items: center; gap: 6px; font-size: .93rem; color: var(--ink-3); min-width: 0; flex-wrap: wrap; flex: 1 1 0; }
/* SYN-381: the mark and name in the centre; the crumbs and the tools share the sides equally, so it stays centred. */
.riad-stage .riad-topbrand { display: none; align-items: center; flex: none; white-space: nowrap; }
@media (max-width: 767px) { .riad-stage .riad-topbrand { display: flex; } }
.riad-top-end { display: flex; align-items: center; gap: 12px; flex: 1 1 0; justify-content: flex-end; min-width: 0; }
.brand-mark-svg { flex: none; display: block; }
.riad-slogan { margin: 4px 10px 0; font-size: .8rem; color: var(--rail-ink); opacity: .75; }
.riad-stage .riad-crumbs a { color: var(--ink-2); }
.riad-stage .riad-crumbs a:hover { color: var(--blue); }
.riad-here { color: var(--ink); font-weight: 600; }
.riad-crumb-sep { opacity: .6; }
.riad-stage .riad-search {
    display: flex; align-items: center; gap: 8px; margin-inline-start: auto; min-width: 200px; padding: 8px 12px;
    background: var(--sunk); border: 1px solid transparent; border-radius: var(--r-md); color: var(--ink-3); font-size: .93rem; text-align: start;
}
.riad-stage .riad-search:hover { border-color: var(--line-2); }
.riad-search-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.riad-stage .riad-search kbd {
    font-family: var(--f-mono); font-size: .8rem; color: var(--ink-2); background: var(--surface);
    border: 1px solid var(--line-2); border-radius: 4px; padding: 0 6px;
}
.riad-stage .riad-iconbtn { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-md); color: var(--ink-2); flex: none; }
.riad-stage .riad-iconbtn:hover { background: var(--sunk); color: var(--ink); }
.riad-dot-badge { position: absolute; top: 8px; inset-inline-end: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--crit); border: 2px solid var(--surface); }
.riad-avwrap { position: relative; flex: none; }
.riad-stage .riad-av {
    width: 36px; height: 36px; border-radius: 50%; background: var(--teal-tint); color: var(--teal);
    display: grid; place-items: center; font-weight: 700; font-size: .85rem;
}
.riad-av-static { cursor: default; }

/* ---------- Menus (Settings.html .menu) ------------------------------- */

.riad-menu {
    position: absolute; top: calc(100% + 6px); inset-inline-start: 0; z-index: 40; min-width: 260px;
    background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg);
    box-shadow: var(--float); padding: 6px;
}
.riad-menu.riad-end { inset-inline-start: auto; inset-inline-end: 0; }
.riad-menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 4px; }
.riad-mh { padding: 6px 10px 2px; font-size: .85rem; color: var(--ink-3); font-weight: 600; }
.riad-stage .riad-mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 7px 10px; border-radius: var(--r-md); color: var(--ink); text-align: start; }
.riad-stage .riad-mi:hover,
.riad-stage .riad-mi[aria-checked="true"] { background: var(--sunk); }
.riad-tick { display: inline-flex; color: var(--blue); visibility: hidden; }
.riad-stage .riad-mi[aria-checked="true"] .riad-tick { visibility: visible; }
.riad-seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px 10px 8px; }
.riad-stage .riad-seg button { flex: 1; min-height: 34px; padding: 4px 10px; border: 1px solid var(--line-2); border-radius: var(--r-md); font-size: .9rem; font-weight: 500; }
.riad-stage .riad-seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.riad-who { padding: 8px 10px; }
.riad-who b { display: block; }
.riad-who span { color: var(--ink-3); font-size: .9rem; }
/* Below the sticky bar (z-index 30), whose stacking context holds the menus: it catches outside clicks
   on the page without covering the menu it closes. */
.riad-menu-scrim { position: fixed; inset: 0; z-index: 29; }

/* ---------- Canvas ---------------------------------------------------- */

.riad-main { flex: 1; width: 100%; max-width: 1240px; min-width: 0; }
/* SYN-421: from 1800 px (where the shell is zoomed, app.css) the content takes the width it has, so a wide screen
   shows more: every Finances tab fits at 1920 and tables use the room (the 1240 px column and the 1500 px .page cap
   are lifted). 1280 and 1440 keep both. */
@media (min-width: 1800px) {
    .riad-stage .riad-main,
    .riad-stage .page,
    .riad-stage .v6:not(.riad-auth) { max-width: none; }
}

/* ---------- Pages row of a building section --------------------------- */

.riad-subnav { display: flex; flex-wrap: wrap; gap: 4px; }
.riad-stage .riad-subnav .riad-sub { display: inline-flex; padding: 6px 12px; border-radius: var(--r-md); color: var(--ink-2); font-size: .93rem; white-space: nowrap; text-decoration: none; }
.riad-stage .riad-subnav .riad-sub:hover { color: var(--ink); background: var(--sunk); }
.riad-stage .riad-subnav .riad-sub.active { color: var(--blue); background: var(--blue-tint); font-weight: 600; }

/* ---------- Phone: tab bar and Menu sheet (ManagerPhone.html, ManagerMenu.html) */

.riad-tabbar {
    display: none; position: fixed; inset-inline: 0; bottom: 0; z-index: 50;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 4px calc(10px + env(safe-area-inset-bottom, 0px));
    font-family: var(--f-sans);
}
[dir="rtl"] .riad-tabbar { font-family: var(--f-ar); }
.riad-stage .riad-tabbar > a,
.riad-stage .riad-tabbar > button {
    display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 48px; padding: 6px 2px;
    font-size: .78rem; font-weight: 600; color: var(--ink-3); text-align: center; min-width: 0;
}
.riad-stage .riad-tabbar > a span,
.riad-stage .riad-tabbar > button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.riad-stage .riad-tabbar > a[aria-current="page"],
.riad-stage .riad-tabbar > button[aria-expanded="true"] { color: var(--blue); }

.riad-sheet {
    position: fixed; inset: 0; bottom: calc(68px + env(safe-area-inset-bottom, 0px)); z-index: 45;
    overflow-y: auto; background: var(--rail); color: var(--rail-ink); font-size: 15px;
}
.riad-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line); }
.riad-sheet-head b { font-size: 1.07rem; }
.riad-sheet .riad-rail-in { min-height: 0; padding: 12px; }
.riad-sheet .riad-brand { display: none; }

/* ---------- Command bar ---------------------------------------------- */

.riad-scrim {
    position: fixed; inset: 0; z-index: 70; background: var(--riad-scrim);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 12vh 1em 1em;
}
.riad-pal {
    width: 100%; max-width: 38em; overflow: hidden;
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--line); border-radius: 1em; box-shadow: 0 24px 60px rgba(10, 16, 28, .3);
    font-size: 15px;
}
.riad-pal-in { display: flex; align-items: center; gap: .7em; padding: .95em 1.1em; border-bottom: 1px solid var(--line); color: var(--ink-3); }
.riad-pal-in input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; font-size: 1.05em; color: var(--ink); outline: none; }
.riad-pal-list { max-height: 22em; overflow: auto; padding: .4em; }
.riad-pal-gl { padding: .6em .7em .3em; font-size: .78em; color: var(--ink-3); font-weight: 600; }
.riad-stage .riad-opt { display: flex; align-items: center; gap: .7em; width: 100%; text-align: start; padding: .55em .7em; border-radius: .5em; color: var(--ink); }
.riad-stage .riad-opt[aria-selected="true"] { background: var(--sunk); }
.riad-pal-empty { padding: 1.2em .7em; color: var(--ink-3); }
.riad-pal-foot { padding: .6em 1.1em; border-top: 1px solid var(--line); color: var(--ink-3); font-size: .78em; }

/* ---------- Building workspace (SYN-331 / SYN-362) -------------------- */
/* Building.html page head: the building's name, address and size, then the open section's pages. The sections are
   in the rail, the breadcrumbs in the top bar. Its side padding follows .page's so the two share one edge. */

.riad-ws { padding: 28px 28px 0; display: flex; flex-direction: column; gap: 16px; }
.v6.riad-ws { padding-block: 28px 0; padding-inline: 28px; max-width: none; }
.riad-ws .actions:empty { display: none; }
/* SYN-363: under the workspace head the page starts right below the tabs and on the title's edge: the shell's .page
   keeps only its side padding, and a page's own .page wrapper adds none (it was 28 px twice over, plus the body's). */
.riad-main:has(> .riad-ws) > .page { padding-top: 0; }
/* SYN-364: the same for every Riad page, in a building or not: a page's own .page wrapper adds no padding inside
   the shell's, so content sits on the title's edge (it was indented twice on the resident's and agency pages). */
.riad-main > .page .page { padding: 0; max-width: none; }
/* A head with no actions has nothing on the far side; on a phone the stacked head starts on the reading edge. */
.riad-stage .page-actions:empty { display: none; }
@media (max-width: 767px) { .riad-stage .page-head { align-items: flex-start; } }
/* A space's pages as chips above the page, on a phone only (RiadShell). Scrolls sideways inside itself. */
.riad-space-chips { display: none; }
/* SYN-381: one line, for one release, where an old menu entry now lives. */
.riad-moved { display: flex; align-items: center; gap: 8px; margin: 12px 24px 0; padding: 8px 12px; border-radius: var(--r-md);
    background: var(--blue-tint); color: var(--ink-2); font-size: .93rem; }
@media (max-width: 767px) {
    .riad-space-chips { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 12px 12px 0; }
    .riad-space-chips .chip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 4px 12px; border: 1px solid var(--line-2);
        border-radius: 999px; background: var(--surface); color: var(--ink-2); text-decoration: none; font-size: .93rem; }
    .riad-space-chips .chip.on { background: var(--blue-tint); border-color: transparent; color: var(--blue); font-weight: 600; }
}
.riad-wsh { min-width: 0; }
.riad-ws-title { font-family: var(--f-serif); font-weight: 400; font-size: 34px; line-height: 1.05; margin: 0; letter-spacing: 0; color: var(--ink); overflow-wrap: anywhere; }
[dir="rtl"] .riad-ws-title { font-family: var(--f-ar); font-weight: 600; font-size: 2rem; line-height: 1.25; }
.riad-ws-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--ink-2); margin-top: 6px; }
.riad-ws-meta > span + span::before { content: "· "; color: var(--ink-3); }
.riad-ws-meta b { color: var(--ink-2); font-weight: 500; }
/* The section's pages: the v6 tab row (.tabs). */
/* SYN-332: the "Mise en route" progress (x/10), a mute pill after the page name. */
.riad-ws-badge { margin-inline-start: .45em; padding: .05em .5em; border-radius: 999px; background: var(--sunk); color: var(--ink-2); font-size: .87rem; font-variant-numeric: tabular-nums; }

/* ---------- Existing pages inside Riad (SYN-331) ------------------------ */
/* DESIGN.md: figures as one divided strip, not tiles; panels flat; tables scroll inside their panel. Only the
   look changes: the pages' markup and logic are the Classique ones. */

/* Pages lay their figures out in .grid-4, .kpi-grid or an inline grid: any parent of .kpi cards becomes the strip.
   The inline grids set their own gap, hence !important. */
.riad-stage div:has(> .kpi),
.riad-stage .kpi-grid {
    gap: 0 !important;
    border-block: 1px solid var(--line);
    border-radius: 0;
}
.riad-stage div > .kpi,
.riad-stage .kpi-grid > .kpi-card {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    translate: none;
}
.riad-stage div > .kpi + .kpi,
.riad-stage .kpi-grid > .kpi-card + .kpi-card { border-inline-start: 1px solid var(--line); }
.riad-stage .card,
.riad-stage .kpi-card:hover { box-shadow: none; }
.riad-stage .card-body:has(> .tbl),
.riad-stage .tbl-wrap { overflow-x: auto; max-width: 100%; }

@container (max-width: 959px) {
    .riad-ws { padding-inline: 16px; }
}

@container (max-width: 767px) {
    .riad-ws { padding-top: 1.1em; }
    .riad-ws-title { font-size: 1.9em; }
    .riad-stage div:has(> .kpi),
    .riad-stage .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    .riad-stage div > .kpi:nth-child(odd),
    .riad-stage .kpi-grid > .kpi-card:nth-child(odd) { border-inline-start: 0; }
    .riad-stage div > .kpi:nth-child(n + 3),
    .riad-stage .kpi-grid > .kpi-card:nth-child(n + 3) { border-top: 1px solid var(--line); }
    /* A table keeps its columns and scrolls inside its panel; the page itself never scrolls sideways. */
    .riad-stage .card,
    .riad-stage .card-body { min-width: 0; max-width: 100%; }
    .riad-stage .card-body:has(> .tbl),
    .riad-stage .card:has(> .tbl) { overflow-x: auto; }
    /* A card header's actions wrap under its title instead of running off the screen. */
    .riad-stage .card-head { flex-wrap: wrap; }
    .riad-stage .card-actions { flex-wrap: wrap; min-width: 0; max-width: 100%; }
    /* The millièmes balance bar: five figures in a row, two per row on a phone (its grid is inline). */
    .riad-stage .mll-balance { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 1em !important; }
    /* SYN-336. Communication's three columns (threads, conversation, announcements) stack on a phone; the
       height is the desktop's fixed pane height (its grid is inline). */
    .riad-stage .comm-grid { grid-template-columns: minmax(0, 1fr) !important; height: auto !important; min-height: 0 !important; }
    .riad-stage .comm-grid > * { min-height: 24em; }
}

@container (max-width: 599px) {
    .riad-ws { padding-inline: 12px; }
}

/* SYN-363: the Classique building blocks in the v6 scale (syndic.css .panel, table.t, .btn, .pill), so the building
   sections and settings pages whose markup stays read like the v6 screens. Fixed rem scale, larger than Classique's. */
.riad-stage .card { border-radius: var(--r-lg); }
.riad-stage .card-head { padding: 14px 18px; flex-wrap: wrap; }
/* .card-title: Instrument Serif, see the SYN-409 block below. */
.riad-stage .card-body { padding: 16px 18px; }
.riad-stage .tbl { font-size: .95rem; }
.riad-stage .tbl thead th { font-size: .9rem; text-transform: none; letter-spacing: 0; color: var(--ink-2); background: var(--sunk); white-space: nowrap; }
.riad-stage .tbl tbody tr:hover { background: var(--sunk); }
.riad-stage .btn { min-height: 40px; padding: 8px 14px; border-radius: var(--r-md); font-size: .95rem; font-weight: 600; }
.riad-stage .btn-sm { min-height: 34px; padding: 5px 10px; font-size: .9rem; }
.riad-stage .btn-primary { background: var(--blue); border-color: var(--blue); color: var(--riad-blue-ink); }
.riad-stage .btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: var(--riad-blue-ink); }
.riad-stage .pill { font-size: .85rem; font-weight: 600; padding: 1px 9px; }
.riad-stage .field-input { min-height: 42px; padding: 9px 12px; border-radius: var(--r-md); font-size: .95rem; }
@container (max-width: 767px) {
    .riad-stage .btn { min-height: 44px; }
}

/* SYN-363, UI gate (Impeccable): what the kept markup brings that the v6 scale does not allow. Functional text at
   least 12 px (.82rem of 15 px); text colours at AA contrast in both themes; one family (Plex) for MudBlazor text too. */
.riad-stage { --ink-4: #6b7385; --syndic-teal-deep: var(--teal); }
[data-theme="dark"] .riad-stage { --ink-4: #8a95a9; }
.riad-stage :is(.mud-input-helper-text, .mud-typography-caption, .gauge-label, .stat-label) { font-size: .82rem; }
.riad-stage :is(.mud-typography, .mud-input, .mud-tab, .mud-button-root) { font-family: inherit; }
/* MudBlazor's buttons and tabs speak in sentence case under Riad (v6: no uppercase labels). */
.riad-stage :is(.mud-button-root, .mud-tab) { text-transform: none; letter-spacing: 0; }
.riad-stage .mud-tab { color: var(--ink-2); }
.riad-stage .mud-tab.mud-tab-active { color: var(--blue); }

/* ---------- Teal tabs (SYN-421, replaces SYN-409's grey folder tabs; mockup docs/design/screens/syn-421) ------------
   Every tab row of the Riad look. Closed tabs are teal (#007a70, white 600 labels, 5.23:1; Benaissa chose shade B over
   the exact #008d81, which is 4.10:1). Hover lifts the tab 5 px with a shadow, with no colour change. The open tab is
   lifted, in the panel's colour, with a teal-dark label and a 3 px #008d81 top edge, and joins what is below it. Every
   tab carries a small icon. On a phone the row scrolls sideways with the edge fade. Filters that reuse .tabs say
   .tabs-filter and keep their look. MudTabs take the same look, also in a dialog (which MudBlazor renders outside the
   stage). Teal also means "paid / OK", as a pale pill inside a panel: the tab teal is a solid block above the panel and
   the open tab is in the panel's colour, so the two never touch. */
.riad-stage .tabs:not(.tabs-filter) {
    display: flex; flex-wrap: nowrap; align-items: flex-end; gap: 6px; padding: 10px 0 0; padding-inline-start: 16px;
    margin-bottom: 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
}
.riad-stage .tabs:not(.tabs-filter)::-webkit-scrollbar { display: none; }
/* SYN-405 item 5: the edge that hides more tabs fades out (syndic-riad.js sets the attributes while the row overflows). */
.riad-stage .tabs:not(.tabs-filter) { --fade-start: 0px; --fade-end: 0px; }
.riad-stage .tabs:not(.tabs-filter)[data-more-start] { --fade-start: 48px; }
.riad-stage .tabs:not(.tabs-filter)[data-more-end] { --fade-end: 48px; }
.riad-stage .tabs:not(.tabs-filter):is([data-more-start], [data-more-end]) {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent);
    mask-image: linear-gradient(to right, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent);
}
[dir="rtl"] .riad-stage .tabs:not(.tabs-filter):is([data-more-start], [data-more-end]) {
    -webkit-mask-image: linear-gradient(to left, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent);
    mask-image: linear-gradient(to left, transparent, #000 var(--fade-start), #000 calc(100% - var(--fade-end)), transparent);
}
.riad-stage .tabs:not(.tabs-filter) > :is(a, button),
:is(.riad-stage, body:has(.riad-stage) .mud-dialog) .mud-tabs-tabbar .mud-tab {
    position: relative; display: inline-flex; align-items: center; gap: 8px; flex: none; white-space: nowrap;
    min-height: 0; min-width: 0; padding: 9px 16px; margin: 0; font: inherit; font-weight: 600; letter-spacing: 0;
    background: var(--tab-fill); color: var(--tab-ink); text-decoration: none; cursor: pointer; opacity: 1;
    border: 1px solid var(--tab-fill-edge); border-bottom: 0; border-radius: 10px 10px 0 0;
    transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .18s cubic-bezier(.2, .8, .2, 1);
}
.riad-stage .tabs:not(.tabs-filter) > :is(a, button) svg,
:is(.riad-stage, body:has(.riad-stage) .mud-dialog) .mud-tabs-tabbar .mud-tab .mud-icon-root { opacity: .9; flex: none; }
:is(.riad-stage, body:has(.riad-stage) .mud-dialog) .mud-tabs-tabbar .mud-tab .mud-icon-root { font-size: 17px; width: 17px; height: 17px; margin: 0; }
/* Hover and keyboard focus: the tab lifts; its colour stays. */
.riad-stage .tabs:not(.tabs-filter) > :is(a, button):is(:hover, :focus-visible):not(.on, .active, [aria-current="page"]),
:is(.riad-stage, body:has(.riad-stage) .mud-dialog) .mud-tabs-tabbar .mud-tab:is(:hover, :focus-visible):not(.mud-tab-active) {
    color: var(--tab-ink); background: var(--tab-fill); transform: translateY(-5px); box-shadow: var(--tab-lift-shadow);
}
.riad-stage .tabs:not(.tabs-filter) > :is(a, button):focus-visible,
:is(.riad-stage, body:has(.riad-stage) .mud-dialog) .mud-tabs-tabbar .mud-tab:focus-visible {
    outline: 2px solid var(--focus); outline-offset: 2px;
}
.riad-stage .tabs:not(.tabs-filter) > :is(a, button):is(.on, .active, [aria-current="page"]),
:is(.riad-stage, body:has(.riad-stage) .mud-dialog) .mud-tabs-tabbar .mud-tab.mud-tab-active {
    background: var(--surface); color: var(--tab-open-ink); margin-bottom: -1px; padding-block: 14px 10px;
    transform: translateY(-5px); border: 1px solid var(--line); border-top: 3px solid var(--tab-open-edge); border-bottom: 0;
    box-shadow: var(--tab-open-shadow);
}
.riad-stage .tabs:not(.tabs-filter) > :is(a, button):is(.on, .active, [aria-current="page"]) svg,
:is(.riad-stage, body:has(.riad-stage) .mud-dialog) .mud-tabs-tabbar .mud-tab.mud-tab-active .mud-icon-root { opacity: 1; }
/* The open tab joins what is below it: a strip of the panel's colour covers the lift and the row's line. */
.riad-stage .tabs:not(.tabs-filter) > :is(a, button):is(.on, .active, [aria-current="page"])::after,
:is(.riad-stage, body:has(.riad-stage) .mud-dialog) .mud-tabs-tabbar .mud-tab.mud-tab-active::after {
    content: ""; position: absolute; inset-inline: 0; bottom: -6px; height: 7px; background: var(--surface);
}
@media (prefers-reduced-motion: reduce) {
    .riad-stage .tabs:not(.tabs-filter) > :is(a, button),
    :is(.riad-stage, body:has(.riad-stage) .mud-dialog) .mud-tabs-tabbar .mud-tab { transition: none; }
}
:is(.riad-stage, body:has(.riad-stage) .mud-dialog) .mud-tabs-tabbar {
    background: transparent; border-bottom: 1px solid var(--line); padding-inline-start: 16px; box-shadow: none;
}
:is(.riad-stage, body:has(.riad-stage) .mud-dialog) .mud-tabs-tabbar .mud-tabs-tabbar-wrapper { gap: 6px; align-items: flex-end; padding-top: 10px; }
:is(.riad-stage, body:has(.riad-stage) .mud-dialog) .mud-tabs-tabbar .mud-tab-slider { display: none; }
:is(.riad-stage, body:has(.riad-stage) .mud-dialog) .mud-tabs-tabbar .mud-tab-icon-text { margin-inline-end: 0; }
/* Under a building's tab row, the page's first panel or toolbar joins the open tab: no gap, its top border is the row's line. */
.riad-main:has(> .riad-ws .riad-ws-pages) > .page .v6.ws-body { padding-block-start: 0; }
.riad-main:has(> .riad-ws .riad-ws-pages) > .page .v6.ws-body > :first-child:is(.panel, .card, .tab-toolbar) { margin-top: -1px; }

/* ---------- The toolbar under the tabs (SYN-421) ------------------------------------------------------------------
   One rule for the controls a page puts under its tabs (Bookings' week, the filter chips): a band in the panel's colour
   joined to the open tab, the same height and padding everywhere, a start group and an optional .end group. When a
   panel follows straight after, the two are one box and the toolbar's line divides them. A panel's own first head under
   the tabs takes the same height and padding. */
.v6 .tab-toolbar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; min-height: 60px; padding: 12px 18px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 0;
}
.v6 .tab-toolbar > .end { margin-inline-start: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.v6 .tab-toolbar .tb-step { display: inline-flex; align-items: center; gap: 4px; }
.v6 .tab-toolbar .tb-step .label { min-width: 15.5em; text-align: center; font-weight: 600; padding-inline: 8px; }
/* A directional icon (chevrons, arrows) mirrors in Arabic (SYN-426 rules). */
.v6 .dir { display: inline-flex; flex: none; }
[dir="rtl"] .v6 .dir { transform: scaleX(-1); }
.v6 .tab-toolbar:has(+ :is(.panel, .card)) { border-end-start-radius: 0; border-end-end-radius: 0; }
.v6 .tab-toolbar + :is(.panel, .card) { margin-top: -24px; border-top: 0; border-start-start-radius: 0; border-start-end-radius: 0; }
.riad-main:has(> .riad-ws .riad-ws-pages) > .page .v6.ws-body > .panel:first-child > .panel-head:first-child { min-height: 60px; padding: 12px 18px; }
@media (max-width: 767px) {
    .v6 .tab-toolbar { padding: 10px 12px; }
    .v6 .tab-toolbar .tb-step { width: 100%; justify-content: space-between; }
    .v6 .tab-toolbar .tb-step .label { min-width: 0; flex: 1; }
}

/* SYN-409 (riad-navy finances.html .empty): the empty state's tile in the navy tint, its title in Instrument Serif. */
.riad-stage .empty-mark { width: 52px; height: 52px; border-radius: 12px; background: var(--blue-tint); color: var(--blue); font-size: 22px; }
.riad-stage .empty-title { font-family: var(--f-serif); font-weight: 400; font-size: 24px; line-height: 1.2; }
[dir="rtl"] .riad-stage .empty-title { font-family: var(--f-ar); font-weight: 600; font-size: 1.2rem; }
.riad-stage .mud-typography-caption { color: var(--ink-3); }
.riad-stage :is(.field-input, .input, input, textarea, select) { color: var(--ink); }
.riad-stage :is(.field-input, .input, input, textarea)::placeholder { color: var(--ink-3); opacity: 1; }
.riad-stage .stat-value { color: var(--ink) !important; }
.riad-stage .kpi .value { color: var(--ink) !important; }
/* Inline 10-11 px in the kept markup (lot codes, card meta) comes up to the floor. */
.riad-stage :is([style*="font-size: 9"], [style*="font-size: 10"], [style*="font-size: 11"], [style*="font-size:9"], [style*="font-size:10"], [style*="font-size:11"]) { font-size: .82rem !important; }

/* SYN-363, UI gate, second pass: MudBlazor alerts and text buttons in the v6 tones, the Classique empty-state stripes
   flat, the teal notes in the theme's teal at full opacity, and the page's own font for what MudBlazor puts outside the
   stage (popovers live under body). */
body:has(.riad-stage) { font-family: 'Inter', system-ui, sans-serif; }
[dir="rtl"] body:has(.riad-stage), body:has(.riad-stage[dir="rtl"]) { font-family: 'Cairo', 'Inter', sans-serif; }
.riad-stage :is(.mud-alert-message, .mud-alert-message .mud-typography) { color: var(--ink); }
.riad-stage :is(.mud-button-text-primary, .mud-button-outlined-primary) { color: var(--blue); }
.riad-stage .mud-button-text-default { color: var(--ink-2); }
.riad-stage .placeholder { background: var(--sunk); }
.riad-stage [style*="color: var(--syndic-teal)"] { color: var(--teal) !important; }
.riad-stage [style*="opacity: 0.8"] { opacity: 1 !important; }

/* SYN-363: on a phone, a chart drawn at desktop width scrolls inside its card instead of widening the page (the
   SuperAdmin dashboard was 891 px wide at 390). */
@container (max-width: 767px) {
    .riad-stage .tbl-wrap { overflow-x: auto; max-width: 100%; }
    /* A chart drawn at desktop width (ApexCharts keeps its first size) scrolls inside its card. */
    .riad-stage :has(> .apexcharts-canvas) { overflow-x: auto; max-width: 100%; }
}

/* SYN-363, UI gate, third pass: MudBlazor field labels and error text buttons at AA contrast; the wizard's photo
   placeholder flat (the Classique one is striped). */
.riad-stage :is(.mud-input-label, .mud-input-helper-text, .mud-input-helper-text *) { color: var(--ink-2) !important; }
/* A field in error: MudBlazor paints its label and help with --mud-palette-error (!important, more specific), under
   AA on the dark surface; the Riad danger ink keeps the error readable in both themes (SYN-363 UI gate). */
.riad-stage .mud-input-control > .mud-input-control-input-container > .mud-input-label-inputcontrol.mud-input-error,
.riad-stage .mud-input-helper-text.mud-input-error { color: var(--crit) !important; }
/* MudBlazor paints a shrunk field label's notch with its own surface; inside the Riad stage that is the v6 surface,
   so the label keeps its contrast in the dark theme. */
.riad-stage { --mud-palette-surface: var(--surface); --mud-palette-background: var(--bg); }
.riad-stage .mud-button-text-error { color: var(--crit); }
.riad-stage .v6-placeholder { display: grid; place-items: center; background: var(--sunk); color: var(--ink-2); }

/* SYN-363 (v6 Services.html): a services category as a v6 panel and its guides as the rows of its list. */
.riad-stage .v6-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); margin-top: 20px; }
.riad-stage .v6-panel-head { margin: 0; padding: 14px 18px; border-bottom: 1px solid var(--line); font-size: 1.07rem; font-weight: 600; }
.riad-stage .v6-list { display: flex; flex-direction: column; }
.riad-stage .v6-row { padding: 14px 18px; border-top: 1px solid var(--line); }
.riad-stage .v6-row:first-child { border-top: 0; }

/* SYN-363 (Settings.html): the settings list beside the open settings page; above it on a phone. */
.riad-settings { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 24px; align-items: start; padding-top: 28px; }
.riad-settings-nav { display: flex; flex-direction: column; gap: 2px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); position: sticky; top: 16px; }
.riad-stage .riad-settings-nav a { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 7px 10px; border-radius: var(--r-md); color: var(--ink-2); font-weight: 500; text-decoration: none; }
.riad-stage .riad-settings-nav a:hover { background: var(--sunk); color: var(--ink); }
.riad-stage .riad-settings-nav a.on { background: var(--blue-tint); color: var(--blue); font-weight: 600; }
.riad-settings-body { min-width: 0; }
@container (max-width: 959px) {
    .riad-settings { grid-template-columns: minmax(0, 1fr); padding-top: 16px; }
    .riad-settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}

/* SYN-363: the shared PageHead in the v6 head's type (syndic.css .page-head): every existing page under Riad gets it,
   the pages rebuilt to v6 (.v6) have their own. */
.riad-stage .page-head { align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
/* SYN-409: page titles, card titles and big figures in Instrument Serif (Cairo in Arabic); tables, buttons and forms
   stay in Inter. */
.riad-stage .page-title { font-family: var(--f-serif); font-size: 34px; line-height: 1.05; font-weight: 400; letter-spacing: 0; }
[dir="rtl"] .riad-stage .page-title { font-family: var(--f-ar); font-weight: 600; font-size: 2rem; line-height: 1.25; }
.riad-stage .page-head .page-sub, .riad-stage .page-head .lede { margin-top: 6px; }

/* ---------- Page-title tile (SYN-409, riad-navy finances.html .title .ico) -----------------------------------------
   A navy rounded tile with the page's white line icon (riad-page-icons.css, set by the shell as data-page-icon) beside
   the title and its subtitle. Inside a building only the workspace head carries it, so a page never shows two. */
.riad-stage[data-page-icon] .riad-ws > .page-head > .riad-wsh,
.riad-stage[data-page-icon]:not(:has(.riad-ws)) .riad-main .page-head > div:first-child {
    display: grid; grid-template-columns: 48px minmax(0, 1fr); column-gap: 14px; align-items: center;
}
.riad-stage[data-page-icon] .riad-ws > .page-head > .riad-wsh::before,
.riad-stage[data-page-icon]:not(:has(.riad-ws)) .riad-main .page-head > div:first-child::before {
    content: ""; grid-row: 1 / span 4; align-self: center; width: 48px; height: 48px; border-radius: 12px;
    background: var(--navy) var(--riad-page-icon) center / 26px 26px no-repeat;
}
@media (max-width: 767px) {
    .riad-stage[data-page-icon] .riad-ws > .page-head > .riad-wsh,
    .riad-stage[data-page-icon]:not(:has(.riad-ws)) .riad-main .page-head > div:first-child { grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; }
    .riad-stage[data-page-icon] .riad-ws > .page-head > .riad-wsh::before,
    .riad-stage[data-page-icon]:not(:has(.riad-ws)) .riad-main .page-head > div:first-child::before { width: 40px; height: 40px; border-radius: 10px; background-size: 22px 22px; }
}

.riad-stage :is(.card-title, .v6 .panel-head h2, .v6 .h2-page) { font-family: var(--f-serif); font-weight: 400; font-size: 21px; letter-spacing: 0; }
[dir="rtl"] .riad-stage :is(.card-title, .v6 .panel-head h2, .v6 .h2-page) { font-family: var(--f-ar); font-weight: 600; font-size: 1.07rem; }
.riad-stage :is(.kpi .value, .stat-value) { font-family: var(--f-serif); font-weight: 400; letter-spacing: 0; }
[dir="rtl"] .riad-stage :is(.kpi .value, .stat-value) { font-family: var(--f-ar); font-weight: 600; }
.riad-stage .page-sub { font-size: 1rem; color: var(--ink-2); margin-top: 6px; max-width: 68ch; }
@container (max-width: 767px) {
    .riad-stage .page-title { font-size: 1.45rem; }
}

/* ---------- Today (SYN-330) ------------------------------------------ */
/* prototype.html "Today" styles, now used by the resident Home only (Pages/Residents/ResidentHome.razor, v6 in SYN-364); the manager Today is v6 (.v6, SYN-363). */

.rt { padding-block: 2.2em 3.5em; }
.rt-eyebrow { font-size: .74em; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.rt-hello { font-family: var(--f-serif); font-weight: 400; font-size: 2.6em; line-height: 1.05; margin: .12em 0 .2em; letter-spacing: -.01em; text-wrap: balance; color: var(--ink); }
[dir="rtl"] .rt-hello { font-family: var(--f-ar); font-size: 2.1em; line-height: 1.3; }
.rt-lede { color: var(--ink-2); margin: 0 0 1.8em; font-size: 1.02em; }
.rt-note { color: var(--ink-3); font-size: .88em; margin: -1.2em 0 1.8em; }
.rt-muted { color: var(--ink-3); margin: .4em 0 0; }
.rt-split { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 2.4em; align-items: start; }
.rt-stack { display: flex; flex-direction: column; gap: 1.8em; min-width: 0; }
.rt-panel { background: var(--surface); border: 1px solid var(--line); border-radius: .9em; }
.rt-block { padding: 1.1em 1.2em; }
.rt-block + .rt-block { border-top: 1px solid var(--line); }

.rt-group { margin-top: 1.4em; }
.rt-group:first-child { margin-top: 0; }
.rt-gl { display: flex; align-items: center; gap: .6em; font-size: .74em; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--ink-3); margin: 0 0 .5em; }
.rt-gl i { width: .55em; height: .55em; border-radius: 50%; }
.rt-q { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 1em; align-items: center; padding: .85em 0; border-top: 1px solid var(--line); }
.rt-q:last-child { border-bottom: 1px solid var(--line); }
.rt-s { width: .22em; align-self: stretch; border-radius: 2px; }
.rt-s.rt-crit, .rt-gl i.rt-crit { background: var(--riad-crit); }
.rt-s.rt-warn, .rt-gl i.rt-warn { background: var(--warn); }
.rt-s.rt-info, .rt-gl i.rt-info { background: var(--riad-blue); }
.rt-s.rt-ok, .rt-gl i.rt-ok { background: var(--riad-teal); }
.rt-t { font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.rt-m { display: flex; flex-wrap: wrap; gap: .25em .8em; color: var(--ink-3); font-size: .86em; margin-top: .1em; }
.rt-m b { color: var(--ink-2); font-weight: 600; }
.riad-stage .rt-btn {
    display: inline-flex; align-items: center; gap: .45em; padding: .45em .85em; border-radius: .55em; font-weight: 600; font-size: .88em;
    white-space: nowrap; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); text-decoration: none;
}
.riad-stage .rt-btn:hover { border-color: var(--ink-3); }
.riad-stage .rt-btn.rt-pri { background: var(--riad-blue); border-color: var(--riad-blue); color: var(--riad-blue-ink); }
.riad-stage .rt-btn.rt-pri:hover { filter: brightness(1.08); }
.riad-stage .rt-btn:focus-visible,
.riad-stage .rt-minib:focus-visible,
.riad-stage .rt-kvhead:focus-visible { outline: 2px solid var(--riad-blue); outline-offset: 2px; }
.rt-clear { padding: 2.4em 1em; text-align: center; border-block: 1px solid var(--line); }
.rt-serif { font-family: var(--f-serif); font-size: 2em; color: var(--riad-teal); }
.rt-clear p { color: var(--ink-3); margin: .3em 0 0; }

.rt-fig { font-family: var(--f-serif); font-size: 2.6em; line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; margin-top: .35em; color: var(--ink); }
.rt-fig small { font-family: var(--f-sans); font-size: .34em; color: var(--ink-3); letter-spacing: 0; margin-inline-start: .3em; }
.rt-figsub { color: var(--ink-3); font-size: .88em; margin-top: .35em; }
.rt-bar { height: .42em; border-radius: 99px; background: var(--sunk); overflow: hidden; margin-top: .9em; display: flex; }
.rt-bar i { display: block; height: 100%; background: var(--riad-teal); }
.riad-stage .rt-kvhead { display: flex; align-items: baseline; justify-content: space-between; gap: 1em; margin-top: .4em; color: var(--ink); text-decoration: none; }
.riad-stage .rt-kvhead:hover b { color: var(--riad-blue); }
.rt-kv { display: flex; justify-content: space-between; gap: 1em; padding: .42em 0; font-size: .93em; }
.rt-kv span { color: var(--ink-2); }
.rt-kv b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: end; color: var(--ink); }
.rt-pill { display: inline-flex; align-items: center; font-size: .76em; font-weight: 600; padding: .12em .6em; border-radius: 999px; white-space: nowrap; }
.rt-pill.rt-ok { background: var(--riad-teal-tint); color: var(--riad-teal); }
.rt-pill.rt-warn { background: var(--tint-warn); color: var(--warn); }
.rt-pill.rt-crit { background: var(--tint-crit); color: var(--riad-crit); }
.rt-pill.rt-info { background: var(--tint-blue); color: var(--riad-blue); }
.rt-sec { font-size: 1em; font-weight: 600; margin: 0 0 .6em; display: flex; align-items: baseline; gap: .6em; color: var(--ink); }
.rt-sec span { color: var(--ink-3); font-weight: 400; font-size: .9em; }
.riad-stage .rt-minib { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6em; padding: .6em 0; border-top: 1px dashed var(--line); font-size: .92em; color: var(--ink); text-decoration: none; }
.riad-stage .rt-minib:first-of-type { border-top: 0; }
.riad-stage .rt-minib:hover .rt-n { color: var(--riad-blue); }
.rt-n { font-weight: 500; }
.rt-a { color: var(--ink-3); font-size: .86em; }

@container (max-width: 1099px) {
    .rt-split { grid-template-columns: minmax(0, 1fr); }
}

@container (max-width: 767px) {
    .rt { padding-block: 1.4em 2em; }
    .rt-hello { font-size: 2.1em; }
    .rt-q { grid-template-columns: auto minmax(0, 1fr); }
    .riad-stage .rt-q .rt-btn { grid-column: 2; justify-self: start; }
}

/* ---------- Medium and compact --------------------------------------- */

@container (max-width: 1099px) {
    .riad-stage .riad-search { min-width: 0; flex: 0 1 auto; }
    .riad-search-txt { display: none; }
}

@container (max-width: 767px) {
    .riad-rail { display: none; }
    .riad-tabbar { display: grid; }
    .riad-col { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
    .riad-top { padding: 10px 12px; gap: 6px; }
    /* The current place only: the trail would push the icons off a 390 px screen (SYN-360). */
    .riad-crumbs { flex-wrap: nowrap; overflow: hidden; flex: 1 1 0; }
    .riad-top-end { gap: 4px; flex: none; }
    .riad-crumbs > :not(:last-child) { display: none; }
    .riad-here { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .riad-stage .riad-search { margin-inline-start: 0; padding: 8px; background: transparent; }
    .riad-stage .riad-search kbd { display: none; }
    /* Pages that lay cards out in an inline 3- or 4-column grid (the reports hub, …) stack them on a phone, where
       three columns of 110 px push their buttons off the screen. */
    .riad-stage .page div[style*="grid-template-columns: repeat(3"],
    .riad-stage .page div[style*="grid-template-columns: repeat(4"] { grid-template-columns: minmax(0, 1fr) !important; }
}

@media (prefers-reduced-motion: reduce) {
    .riad-stage * { transition: none !important; animation: none !important; }
}
