/*
 * portal-chrome.css — EmDash chrome injected into Odoo-served pages by the
 * beta portal-router (docs/PORTAL-ODOO.md §5.4, option 2B).
 *
 * Hand-copied subset of site/src/styles/tokens.css + the site/src/components/
 * chrome/Nav.astro and Footer.astro <style> blocks — NOT a live import. Odoo
 * pages don't run the Astro build, so nothing here updates automatically when
 * tokens.css or the components change; keep this in sync by hand until it
 * becomes a build step (see the "Not yet solved" note in the router).
 *
 * Every rule is scoped under .tt-chrome, the wrapper the two partial endpoints
 * (site/src/pages/portal-chrome/header.astro, footer.astro) render around the
 * real <Nav>/<Footer> components — so this can never leak onto the rest of an
 * Odoo page, and Odoo's own CSS can never reach inside it either way (Odoo
 * doesn't know these class names). This is the ".tt-chrome scope" option from
 * §5.2, not the "tt- prefix every class" one — Nav.astro/Footer.astro ship
 * unmodified.
 *
 * Two rules when copying a component's CSS in here, both learned the hard way
 * on 2026-09-10:
 *   1. Strip every `:global()`. It is Astro compiler syntax; a browser reads
 *      it as an unknown pseudo-class and discards the whole rule.
 *   2. Bring the reset too. Without global.css's reset, Odoo's Bootstrap
 *      reboot is what fills the gap, with different margins and an inline
 *      <img> — and the copy silently drifts from the original.
 * Verify with scripts/portal-chrome-diff.mjs, which measures the same
 * elements on a real EmDash page and on a proxied Odoo page.
 *
 * Known gaps (fine for the 2B spike, not for the real build in §8 Phase C.12):
 *   - The mobile drawer's html:has() scroll-lock rule is dropped — it targets
 *     Odoo's own <html>, which this stylesheet must never reach into.
 *   - SiteSearch is hidden rather than rendered (see its note below).
 *   - --nav-h is published by Nav's own script; --cookie-h has no consumer on
 *     an Odoo page (nothing else here is fixed to the bottom edge).
 */

/* ---------------------------------------------------------------------------
   Tokens — subset needed by .nav/.foot, declared ON .tt-chrome (not :root) so
   nothing here is visible to, or overridden by, the rest of the Odoo page.
   ------------------------------------------------------------------------ */

.tt-chrome {
  /* primitives */
  --teal-50:  #f0f9f8;
  --teal-100: #d9efec;
  --teal-200: #b3e0d9;
  --teal-300: #7ecabf;
  --teal-400: #38ada0;
  --teal-500: #0d9184;
  --teal-600: #008478;
  --teal-700: #006e68;
  --teal-800: #005c5d;
  --teal-900: #004749;
  --teal-950: #002e30;

  --ink-50:  #f6f7f8;
  --ink-100: #eceff1;
  --ink-200: #d9dee2;
  --ink-300: #b9c2c9;
  --ink-400: #8b98a3;
  --ink-500: #64717c;
  --ink-600: #4a555f;
  --ink-700: #38424a;
  --ink-800: #283138;
  --ink-900: #1d252c;
  --ink-950: #12171b;

  /* semantic — Classic only; Odoo pages never carry [data-palette="expressive"] */
  --color-text:               var(--ink-900);
  --color-text-muted:         var(--ink-500);
  --color-text-inverse:       #ffffff;
  --color-text-muted-inverse: var(--ink-400);
  --color-bg:                 #ffffff;
  --color-surface:            var(--ink-50);
  --color-surface-raised:     #ffffff;
  --color-surface-inverse:         var(--ink-900);
  --color-surface-inverse-raised:  var(--ink-800);
  --color-border:             var(--ink-200);
  --color-border-strong:      var(--ink-500);
  --color-accent:             var(--teal-600);
  --color-accent-fill:        var(--teal-600);
  --color-accent-fill-hover:  var(--teal-700);
  --color-accent-hover:       var(--teal-700);
  --color-accent-active:      var(--teal-800);
  --color-accent-on:          #ffffff;
  --color-border-accent:      var(--teal-200);
  --color-accent-text:        var(--teal-700);
  --color-accent-subtle:      var(--teal-100);

  /* shadows */
  --shadow-sm: 0 2px 6px color-mix(in oklab, var(--ink-900) 8%, transparent),
               0 1px 2px color-mix(in oklab, var(--ink-900) 5%, transparent);
  --shadow-lg: 0 14px 32px color-mix(in oklab, var(--ink-900) 14%, transparent),
               0 4px 8px color-mix(in oklab, var(--ink-900) 8%, transparent);
  --shadow-md: 0 6px 16px color-mix(in oklab, var(--ink-900) 10%, transparent),
               0 2px 4px color-mix(in oklab, var(--ink-900) 6%, transparent);

  /* type */
  --font-sans: Raleway, system-ui, -apple-system, "Segoe UI", sans-serif;
  --weight-normal:   400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-extra:    800;
  --tracking-heading: -0.018em;
  --tracking-base: -0.011em;
  --tracking-wide:  0.06em;
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-md:   0.9375rem;
  --text-base: clamp(1rem, 0.94rem + 0.19vw, 1.0625rem);
  --text-lg:   clamp(1.125rem, 1.01rem + 0.38vw, 1.25rem);
  --text-xl:   clamp(1.25rem, 1.02rem + 0.75vw, 1.5rem);
  --leading-normal: 1.6;
  --leading-tight:  1.15;
  --color-link:       var(--teal-700);
  --color-link-hover: var(--teal-800);

  /* spacing / layout */
  --space-px: 1px;
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --section-y-tight: clamp(2.25rem, 5vw, 4.5rem);
  --container: 75rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-full: 50%;
  --radius-pill: 999px;
  --duration-base: 200ms;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);

  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-normal);
  line-height: var(--leading-normal);
  letter-spacing: var(--tracking-base);
  color: var(--color-text);
}

@font-face {
  font-family: "Raleway";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/raleway-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Raleway";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/raleway-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------------------------------------------------------------------
   Reset — global.css's, scoped to .tt-chrome.

   Not optional and not cosmetic: without it Odoo's Bootstrap reboot is the
   reset in force inside the injected chrome, and its values differ. Measured
   2026-09-10 against the same components on a real EmDash page: the footer
   address paragraphs came out 17px white with a 16px bottom margin instead of
   14px muted with none (Bootstrap's `p { margin-bottom: 1rem }` plus the
   dropped rules below), the legal line gained 16px, and the nav bar rendered
   75px instead of 72 because the wordmark stayed an inline image and kept its
   baseline descender space.
   ------------------------------------------------------------------------ */
.tt-chrome *,
.tt-chrome *::before,
.tt-chrome *::after { box-sizing: border-box; }
/* Specificity 0,1,0 — beats Bootstrap's bare `p`/`ul` element rules, loses to
   every 0,2,0 component rule in this file. Same trade global.css makes. */
.tt-chrome * { margin: 0; }
.tt-chrome img,
.tt-chrome picture,
.tt-chrome video,
.tt-chrome canvas,
.tt-chrome svg { display: block; max-width: 100%; height: auto; }
.tt-chrome input,
.tt-chrome button,
.tt-chrome textarea,
.tt-chrome select { font: inherit; letter-spacing: inherit; color: inherit; }
/* `font-family` and `color` are inherited properties global.css never has to
   restate — but Odoo's theme styles `h1..h6` directly, and ANY matching rule
   beats inheritance regardless of specificity. Without these two the footer's
   widget heading took Odoo's font stack and its near-black heading colour, on
   the near-black footer. */
.tt-chrome h1,
.tt-chrome h2,
.tt-chrome h3,
.tt-chrome h4,
.tt-chrome h5,
.tt-chrome h6 {
  font-family: inherit;
  color: inherit;
  font-weight: var(--weight-bold);
  line-height: var(--leading-tight);
  text-wrap: balance;
}
.tt-chrome strong,
.tt-chrome b { font-weight: var(--weight-bold); }
.tt-chrome a { color: var(--color-link); text-decoration-thickness: 1px; text-underline-offset: 0.15em; }
.tt-chrome a:hover { color: var(--color-link-hover); }

.tt-chrome .container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------------------------------------------------------------------------
   Nav — copied from site/src/components/chrome/Nav.astro, selectors prefixed.
   ------------------------------------------------------------------------ */

.tt-chrome .nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-bg);
  transition: transform 240ms var(--ease-out, ease), box-shadow 240ms ease;
  will-change: transform;
  color: var(--color-text);
  border-bottom: var(--space-px) solid var(--color-border);
}
.tt-chrome .nav[data-hidden="true"] { transform: translateY(-100%); }
.tt-chrome .nav[data-scrolled="true"] { box-shadow: var(--shadow-sm); }
.tt-chrome .nav[data-nav-open="true"],
.tt-chrome .nav[data-search-open="true"] { transform: none !important; }

.tt-chrome .nav__skip {
  position: absolute;
  inset-inline-start: var(--space-4);
  top: calc(var(--space-16, 4rem) * -1);
  z-index: 60;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  background: var(--color-accent-fill);
  color: var(--color-accent-on);
  text-decoration: none;
}
.tt-chrome .nav__skip:focus-visible { top: var(--space-3); color: var(--color-accent-on); }

.tt-chrome .nav__bar {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  min-height: 72px;
}

.tt-chrome .nav__brand { display: flex; align-items: center; flex: 0 0 auto; }
.tt-chrome .nav__brand img { height: 26px; width: auto; }
.tt-chrome .nav__wordmark { font-weight: var(--weight-extra); font-size: var(--text-xl); }

.tt-chrome .nav__menu { margin-inline-start: auto; }
.tt-chrome .nav__panels { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-3); }
.tt-chrome .nav__panel { position: relative; }

.tt-chrome .nav__summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  font-weight: var(--weight-medium);
  font-size: var(--text-base);
  cursor: pointer;
  list-style: none;
}
.tt-chrome .nav__summary::-webkit-details-marker { display: none; }
.tt-chrome .nav__summary:hover { color: var(--color-accent-text); }
.tt-chrome .nav__details[open] .nav__summary { color: var(--color-accent-text); }
.tt-chrome .nav__details[open] .nav__summary i { transform: rotate(180deg); }
.tt-chrome .nav__summary i { font-size: 0.75em; transition: transform var(--duration-base) var(--ease-out); }

.tt-chrome .nav__drop {
  position: absolute;
  top: calc(100% + var(--space-1));
  inset-inline-start: 0;
  z-index: 55;
  width: 14rem;
  max-width: calc(100vw - var(--gutter) * 2);
  padding: var(--space-3);
  background: var(--color-surface-raised);
  border: var(--space-px) solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.tt-chrome .nav__drop--wide {
  width: 38rem;
  inset-inline-start: 50%;
  transform: translateX(-50%);
}

.tt-chrome .nav__links { list-style: none; padding: 0; display: grid; gap: var(--space-1); }
/* Column by column, not row by row — the row count rides on the <ul> as
   --nav-rows, written by Nav.astro from the link count (see its comment). */
.tt-chrome .nav__drop--wide .nav__links {
  grid-auto-flow: column;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(var(--nav-rows, 1), auto);
}

.tt-chrome .nav__links a {
  display: block;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
}
.tt-chrome .nav__links a:hover,
.tt-chrome .nav__links a:focus-visible { background: var(--color-surface); }
.tt-chrome .nav__link-label {
  display: block;
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-base);
}
.tt-chrome .nav__link-desc {
  display: block;
  margin-block-start: var(--space-1);
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
  color: var(--color-text-muted);
}
.tt-chrome .nav__links a:hover .nav__link-label,
.tt-chrome .nav__links a[aria-current="page"] .nav__link-label { color: var(--color-accent-text); }
.tt-chrome .nav__links a[aria-current="page"] { background: var(--color-accent-subtle); }

.tt-chrome .nav__drawer-contact { display: none; }

.tt-chrome .nav__toggle,
.tt-chrome .nav__search-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text);
  font-size: var(--text-xl);
  cursor: pointer;
}
.tt-chrome .nav__toggle:hover,
.tt-chrome .nav__toggle:focus-visible,
.tt-chrome .nav__search-toggle:hover,
.tt-chrome .nav__search-toggle:focus-visible { color: var(--color-accent-text); background: var(--color-surface); }

.tt-chrome .nav[data-js] .nav__search-toggle { display: inline-flex; }
.tt-chrome .nav__search-toggle { font-size: var(--text-lg); }
.tt-chrome .nav[data-search-open="true"] .nav__search-toggle { color: var(--color-accent-text); }

/* The portal header runs Nav with `searchMode="link"` (docs/PORTAL-ODOO.md §5.2):
   the same magnifier, in the same slot, as a plain anchor to /search — no overlay
   to mount and no second stylesheet to keep in sync. It has no script to set
   `data-js`, so unlike the button variant it shows unconditionally. */
.tt-chrome .nav__search-toggle--link { display: inline-flex; }

/* Sign in and the contact control. These live in Nav.astro's scoped stylesheet, which
   an Odoo page never loads — without the copy the button lost its `order` and jumped in
   front of the phone, so the two navs disagreed on the one thing chrome parity is about. */
.tt-chrome .nav__contact { position: relative; flex: 0 0 auto; }

.tt-chrome .nav__portal {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
}
.tt-chrome .nav__portal:hover,
.tt-chrome .nav__portal:focus-visible { color: var(--color-accent-text); }
.tt-chrome .nav__portal i { font-size: var(--text-sm); }

/* Every glyph is in the markup for all three clusters; the cluster decides which shows.
   The injected chrome only ever renders cluster `a`, but the rules travel with it so the
   copy cannot disagree with the component. */
.tt-chrome .nav__portal-key,
.tt-chrome .nav__portal-face { display: none; }
.tt-chrome .nav[data-cluster="b"] .nav__portal-key { display: inline-block; }
.tt-chrome .nav[data-cluster="c"] .nav__portal-face { display: inline-block; font-size: var(--text-xl); }
.tt-chrome .nav[data-cluster="c"] .nav__portal-label { display: none; }
/* C — the default since round 4 — puts BOTH portal states at the far end of the bar. */
@media (min-width: 64rem) {
  .tt-chrome .nav[data-cluster="c"] .nav__portal,
  .tt-chrome .nav[data-cluster="c"] .nav__account { order: 4; }
}

.tt-chrome .nav__search-toggle { color: var(--color-text); }

/* "Contact us" — the bar's one action since D121, a <details> opening into the three
   routes. Hand-copied from Nav.astro: `font-family` and `line-height` restated because
   Odoo's Bootstrap styles <summary> and <button> on its own. */
.tt-chrome .nav__contact-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 38px;
  padding: 0 var(--space-4);
  border: var(--space-px) solid transparent;
  border-radius: var(--radius-md);
  background: var(--color-surface-inverse);
  color: var(--color-text-inverse);
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-base);
  line-height: var(--leading-normal);
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
  transition: background-color var(--duration-base) var(--ease-out);
}
.tt-chrome .nav__contact-toggle::-webkit-details-marker { display: none; }
.tt-chrome .nav__contact-toggle:hover { background: var(--color-surface-inverse-raised); }
.tt-chrome .nav[data-cluster="b"] .nav__contact-toggle {
  background: transparent;
  border-color: var(--color-accent);
  color: var(--color-accent-text);
}
.tt-chrome .nav[data-cluster="b"] .nav__contact-toggle:hover { background: var(--color-accent-subtle); }
.tt-chrome .nav__contact-toggle i {
  font-size: var(--text-xs);
  opacity: 0.7;
  transition: transform var(--duration-base) var(--ease-out);
}
.tt-chrome .nav__contact[open] .nav__contact-toggle i { transform: rotate(180deg); }
@media (min-width: 64rem) {
  .tt-chrome .nav__portal { order: 2; }
  .tt-chrome .nav__contact { order: 3; }
}

/* The THREE portal states (D182). All three are in the markup on every page;
   `data-session` on the <header> picks one. On an Odoo page the router sets that
   attribute by fetching this partial as `/portal-chrome/header?session=user` or
   `?session=staff` — see edge/portal-router/src/session.ts — so the swap is
   server-side and there is no flicker and no probe.

   The first rule is negated rather than keyed on "anon" so that an unknown or
   missing value lands on the ANONYMOUS shape: an unknown value must never open an
   account menu, and here that is not theoretical — this sheet is loaded into
   somebody else's document.

   Hand-copied from Nav.astro's <style> block, with the three standing rules of
   this file applied: every `:global()` stripped (the browser drops the whole rule
   otherwise), inherited properties restated (Odoo's Bootstrap styles bare `a`, and
   any matching rule beats inheritance), and `list-style`/`padding` stated on the
   <ul> because the reset above only zeroes `margin`. */
.tt-chrome .nav:not([data-session="user"]):not([data-session="staff"]) .nav__account { display: none; }
.tt-chrome .nav[data-session="user"] .nav__portal,
.tt-chrome .nav[data-session="staff"] .nav__portal { display: none; }
/* A reseller never sees staff's menu and a staff member never sees the portal's:
   D182's whole point is that the two had been the same menu. */
.tt-chrome .nav[data-session="user"] .nav__account--staff { display: none; }
.tt-chrome .nav[data-session="staff"] .nav__account:not(.nav__account--staff) { display: none; }

.tt-chrome .nav__account {
  position: relative;
  flex: 0 0 auto;
}
.tt-chrome .nav__account-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  padding: 0 var(--space-4);
  border: var(--space-px) solid var(--color-accent);
  border-radius: var(--radius-pill);
  background: transparent;
  font-family: inherit;
  color: var(--color-accent-text);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-base);
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
  transition: background-color var(--duration-base) var(--ease-out);
}
.tt-chrome .nav__account-toggle::-webkit-details-marker { display: none; }
.tt-chrome .nav__account-toggle:hover { background: var(--color-accent-subtle); }
.tt-chrome .nav__account-toggle i:last-child {
  font-size: 0.75em;
  transition: transform var(--duration-base) var(--ease-out);
}
.tt-chrome .nav__account[open] .nav__account-toggle i:last-child { transform: rotate(180deg); }

.tt-chrome .nav__account-menu,
.tt-chrome .nav__contact-menu {
  position: absolute;
  top: calc(100% + var(--space-2));
  right: 0;
  z-index: 55;
  min-width: 14rem;
  max-width: min(18rem, calc(100vw - var(--gutter) * 2));
  list-style: none;
  margin: 0;
  padding: var(--space-2) 0;
  background: var(--color-surface-raised);
  border: var(--space-px) solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.tt-chrome .nav__account-menu a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  font-family: inherit;
  font-size: var(--text-md);
  font-weight: var(--weight-normal);
  color: var(--color-text);
  text-decoration: none;
}
.tt-chrome .nav__account-menu a:hover { background: var(--color-accent-subtle); color: var(--color-accent-text); }
.tt-chrome .nav__account-menu i {
  width: 1rem;
  text-align: center;
  color: var(--color-accent);
}
.tt-chrome .nav__account-sep {
  height: var(--space-px);
  margin: var(--space-2) 0;
  background: var(--color-border);
}
/* The contact card's rows — same card as the account menu, its own row anatomy. */
.tt-chrome .nav__contact-menu a {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: var(--space-3);
  align-items: center;
  padding: var(--space-3) var(--space-4);
  font-family: inherit;
  color: var(--color-text);
  text-decoration: none;
}
.tt-chrome .nav__contact-menu a:hover { background: var(--color-accent-subtle); }
.tt-chrome .nav__contact-menu a:hover .nav__contact-label { color: var(--color-accent-text); }
.tt-chrome .nav__contact-menu i {
  grid-row: 1 / span 2;
  width: 1rem;
  text-align: center;
  color: var(--color-accent);
}
.tt-chrome .nav__contact-label {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
}
.tt-chrome .nav__contact-detail {
  grid-column: 2;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}
@media (min-width: 64rem) {
  .tt-chrome .nav__account { order: 2; }
}

@media (max-width: 63.99rem) {
  .tt-chrome .nav__bar { flex-wrap: wrap; padding-block: var(--space-3); gap: var(--space-3); }

  /* The card's anchor moves on mobile — see the long note in Nav.astro. `right: 0`
     against the toggle hangs the card off the LEFT edge of a 390px screen once the bar
     wraps and the toggle lands alone at the start of a line. */
  .tt-chrome .nav__account { position: static; }
  .tt-chrome .nav__account-menu {
    top: auto;
    right: var(--gutter);
    margin-block-start: var(--space-2);
  }

  .tt-chrome .nav__brand { margin-inline-end: auto; }
  .tt-chrome .nav__toggle { display: inline-flex; }
  .tt-chrome .nav__menu { margin-inline-start: 0; width: 100%; }
  .tt-chrome .nav__panels { flex-direction: column; gap: 0; width: 100%; }
  .tt-chrome .nav__panel { border-block-start: var(--space-px) solid var(--color-border); }
  .tt-chrome .nav__summary { justify-content: space-between; padding-inline: 0; }

  /* The panel card unwraps into a flat list in flow — see Nav.astro. */
  .tt-chrome .nav__drop,
  .tt-chrome .nav__drop--wide {
    position: static;
    width: auto;
    max-width: none;
    transform: none;
    padding: 0 0 var(--space-4);
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .tt-chrome .nav__drop--wide .nav__links {
    grid-auto-flow: row;
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  /* Sign in stays in the bar at every width; the contact control leaves it and its
     three routes become the drawer's foot. */
  .tt-chrome .nav__contact { display: none; }

  .tt-chrome .nav[data-nav-open] .nav__menu {
    position: absolute;
    inset-inline: 0;
    top: 100%;
    width: auto;
    height: calc(100dvh - var(--nav-h, 72px));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--color-bg);
    padding-inline: var(--gutter);
    padding-block-end: var(--space-12);
  }
  .tt-chrome .nav[data-nav-open="false"] .nav__menu { display: none; }

  .tt-chrome .nav[data-nav-open="true"] .nav__menu { display: flex; flex-direction: column; }
  .tt-chrome .nav[data-nav-open="true"] .nav__drawer-contact { margin-block-start: auto; }

  .tt-chrome .nav__drawer-contact {
    display: flex;
    flex-direction: column;
    border-block-start: var(--space-px) solid var(--color-border);
  }
  .tt-chrome .nav__drawer-contact a {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-height: 44px;
    padding-block: var(--space-3);
    font-size: var(--text-base);
    color: var(--color-text);
    text-decoration: none;
  }
  .tt-chrome .nav__drawer-contact i { color: var(--color-accent); }
  .tt-chrome .nav__drawer-detail {
    margin-inline-start: auto;
    font-size: var(--text-sm);
    font-weight: var(--weight-normal);
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
  }
  .tt-chrome .nav[data-nav-open] .nav__drawer-contact a { font-weight: var(--weight-semibold); }

  .tt-chrome .nav[data-nav-open] .nav__summary {
    min-height: 52px;
    padding-block: var(--space-4);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
  }
  .tt-chrome .nav[data-nav-open] .nav__summary i { font-size: 0.9em; }
  .tt-chrome .nav[data-nav-open] .nav__panel:first-child { border-block-start: 0; }

  .tt-chrome .nav[data-nav-open] .nav__panel { min-width: 0; }

  .tt-chrome .nav[data-nav-open] .nav__links { gap: 0; }
  .tt-chrome .nav[data-nav-open] .nav__links a { padding-block: var(--space-3); }

  /* Dropped on purpose: the source rule is `:global(html:has(.nav[data-nav-open="true"]))
     { overflow: hidden; }` — reaching into Odoo's own <html> is out of scope for injected
     chrome. The drawer still opens/closes; the page behind it can still scroll. */
}

/* ---------------------------------------------------------------------------
   Footer — copied from site/src/components/chrome/Footer.astro.
   The footer always carries data-tone="inverse" (D40): dark, Classic, no
   palette switch — same tokens redeclared here rather than relying on a
   [data-tone="inverse"] selector Odoo's DOM will never match against :root.
   ------------------------------------------------------------------------ */

/* The footer's own tone block, so descendants this file doesn't style by hand
   (widget links, widget copy) resolve the same tokens they would on a real
   page instead of inheriting the light-ground values. */
.tt-chrome [data-tone="inverse"] {
  --color-bg:             var(--ink-900);
  --color-surface:        var(--ink-900);
  --color-surface-raised: var(--ink-800);
  --color-text:           #ffffff;
  --color-text-muted:     var(--ink-400);
  --color-border:         var(--ink-700);
  --color-border-strong:  var(--ink-500);
  --color-accent-text:    var(--teal-400);
  --color-link:           var(--teal-400);
  --color-link-hover:     var(--teal-300);
}

.tt-chrome .foot {
  position: relative;
  z-index: 3; /* above the curtain chain — see Footer.astro */
  background: var(--color-surface);
  color: var(--color-text);
  border-block-start: var(--space-px) solid var(--color-border);
}

.tt-chrome .foot__main { padding-block: var(--space-10); }
.tt-chrome .foot__intro {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-6);
  padding-block-end: var(--space-6);
  border-block-end: var(--space-px) solid var(--color-border);
}
.tt-chrome .foot__brand { display: inline-flex; flex: none; margin-block-start: var(--space-2); }
.tt-chrome .foot__brand img { display: block; width: clamp(8rem, 12vw, 10rem); height: auto; }
.tt-chrome .foot__contact { display: flex; gap: clamp(var(--space-6), 4vw, var(--space-12)); }
.tt-chrome .foot__eyebrow {
  margin: 0 0 var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent-text);
}
.tt-chrome .foot__contact-lines { display: grid; justify-items: start; gap: var(--space-1); }
.tt-chrome .foot__phone { display: inline-flex; gap: var(--space-2); color: var(--color-text); font-size: var(--text-sm); font-weight: var(--weight-semibold); text-decoration: none; white-space: nowrap; }
.tt-chrome .foot__phone span { color: var(--color-text-muted); font-weight: var(--weight-medium); }
.tt-chrome .foot__phone:hover { color: var(--color-accent-text); }
.tt-chrome .foot__email { color: var(--color-text-muted); font-size: var(--text-sm); text-decoration: none; }
.tt-chrome .foot__email:hover { color: var(--color-accent-text); }
.tt-chrome .foot__address h2, .tt-chrome .foot__address h3 { display: none; }
.tt-chrome .foot__address p { margin: 0; font-size: var(--text-sm); line-height: 1.55; color: var(--color-text-muted); }
.tt-chrome .foot__social { display: flex; align-items: center; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.tt-chrome .foot__social a { display: grid; place-items: center; width: var(--space-8); height: var(--space-8); color: var(--color-text-muted); text-decoration: none; font-size: var(--text-lg); }
.tt-chrome .foot__social a:hover { color: var(--color-accent-text); }
.tt-chrome .foot__columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8) var(--space-6); padding-block-start: var(--space-8); }
.tt-chrome .foot__column { min-width: 0; display: grid; grid-row: span 2; grid-template-rows: subgrid; align-content: start; }
.tt-chrome .foot__title {
  margin: 0 0 var(--space-3);
  line-height: var(--leading-tight);
  padding-block-end: var(--space-2);
  border-block-end: var(--space-px) solid var(--color-border);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text);
}
.tt-chrome .foot__links { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); align-content: start; }
.tt-chrome .foot__links li { min-width: 0; }
.tt-chrome .foot__links a { font-size: var(--text-sm); line-height: 1.45; color: var(--color-text-muted); text-decoration: none; }
.tt-chrome .foot__links a:hover { color: var(--color-accent-text); text-decoration: underline; text-underline-offset: 0.2em; }
@media (min-width: 48rem) { .tt-chrome .foot__columns { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 70rem) { .tt-chrome .foot__columns { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
@media (max-width: 63.99rem) { .tt-chrome .foot__intro { flex-wrap: wrap; } }
@media (max-width: 39.99rem) {
  .tt-chrome .foot__intro { display: grid; gap: var(--space-6); }
  .tt-chrome .foot__contact { flex-wrap: wrap; gap: var(--space-5) var(--space-8); }
  .tt-chrome .foot__columns { gap: var(--space-6); padding-block-start: var(--space-6); }
}
.tt-chrome .foot__legal-band { background: var(--color-surface); border-block-start: var(--space-px) solid var(--color-border); }
.tt-chrome .foot__legal-in { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-3) var(--space-8); padding-block: var(--space-4); }
.tt-chrome .foot__legal { margin: 0; font-size: var(--text-sm); color: var(--color-text-muted); white-space: nowrap; }
.tt-chrome .foot__legal-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); list-style: none; margin: 0; padding: 0; }
.tt-chrome .foot__legal-links a { color: var(--color-text-muted); font-size: var(--text-sm); text-decoration: none; }
.tt-chrome .foot__legal-links a:hover { color: var(--color-accent-text); text-decoration: underline; text-underline-offset: 0.2em; }

/* The credential artwork keeps its light ground inside otherwise-dark chrome. */
.tt-chrome [data-tone="light"] {
  --color-bg: #ffffff;
  --color-surface: var(--ink-50);
  --color-text: var(--ink-900);
  --color-text-muted: var(--ink-500);
  --color-border: var(--ink-200);
  --color-accent-text: var(--teal-700);
}
.tt-chrome .foot__base {
  background: var(--color-bg);
  padding-block: var(--space-4);
}
.tt-chrome .foot__base-in {
  display: flex;
  align-items: center;
  justify-content: center;
}
.tt-chrome .foot__creds {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-8);
}
.tt-chrome .foot__creds a { display: flex; align-items: center; }
/* One line on a phone — see Footer.astro (D126). */
@media (max-width: 47.99rem) {
  .tt-chrome .foot__creds {
    flex-wrap: nowrap;
    width: 100%;
    justify-content: space-between;
    gap: var(--space-3);
  }
  .tt-chrome .foot__creds img { height: calc(var(--cred-h, var(--space-8)) * 0.75); }
}
.tt-chrome .foot__creds img {
  height: var(--cred-h, var(--space-8));
  width: auto;
  object-fit: contain;
}

.tt-chrome .foot__top {
  position: absolute;
  inset-inline-end: var(--gutter);
  top: calc(var(--space-6) * -1);
  display: grid;
  place-items: center;
  width: var(--space-12, 3rem);
  height: var(--space-12, 3rem);
  border-radius: var(--radius-full);
  background: var(--color-accent-fill);
  color: var(--color-accent-on);
  text-decoration: none;
  box-shadow: var(--shadow-md);
}
.tt-chrome .foot__top:hover { background: var(--color-accent-fill-hover); color: var(--color-accent-on); }

/* ---------------------------------------------------------------------------
   Cookie bar — the real EmDash CookieBar (site/src/components/chrome/
   CookieBar.astro), replacing Odoo's native #website_cookies_bar entirely
   (router: site/src/pages/portal-chrome/cookiebar.astro + the #website_cookies_bar
   HTMLRewriter rule). Not a recolour of Odoo's popup — Odoo's own bar reads
   from Odoo's Bootstrap theme (a paler, unaligned teal, no shadow) and having
   two different-looking consent bars between the migrated site and the portal
   was the actual complaint (2026-09-10), not just a colour mismatch.

   Same .tt-chrome scoping as the rest of this file; .btn* below is Button.astro's
   CSS, needed because CookieBar's Reject/Accept are <Button>s and this partial
   doesn't go through Base.astro's own bundling (see header.astro's rationale).
   ------------------------------------------------------------------------ */
.tt-chrome .cookiebar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 90;
  background: var(--color-surface-inverse);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-lg);
}
.tt-chrome .cookiebar[hidden] { display: none; }
.tt-chrome .cookiebar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
}
.tt-chrome .cookiebar__text { font-size: var(--text-sm); margin: 0; }
.tt-chrome .cookiebar__text a {
  margin-inline-start: var(--space-2);
  color: var(--color-text-inverse);
  text-decoration: underline;
}
.tt-chrome .cookiebar__actions { display: flex; gap: var(--space-3); flex-shrink: 0; }
.tt-chrome .cookiebar__actions .cookiebar__reject {
  color: var(--color-text-inverse);
  border-color: var(--color-border-strong);
}
.tt-chrome .cookiebar__actions .cookiebar__reject:hover {
  background: var(--color-surface-inverse-raised);
  border-color: var(--color-text-inverse);
}

/* Button.astro subset: pill shape, sm and md sizes, primary + secondary variants —
   CookieBar's Reject/Accept and, since the 2026-09-11 nav restructure, the bar's
   "Book Consultation" (sm) and the mobile drawer's copy of it (md). */
.tt-chrome .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-base);
  text-decoration: none;
  border: var(--space-px) solid transparent;
  cursor: pointer;
  transition: background-color var(--duration-base) var(--ease-out),
              color var(--duration-base) var(--ease-out),
              border-color var(--duration-base) var(--ease-out);
}
.tt-chrome .btn--pill { border-radius: var(--radius-pill); }
.tt-chrome .btn--rounded { border-radius: var(--radius-md); }
.tt-chrome .btn--sm { min-height: 32px; padding: 0 var(--space-4); font-size: var(--text-sm); }
.tt-chrome .btn--md { min-height: 44px; padding: 0 var(--space-6); font-size: var(--text-base); }
.tt-chrome .btn--primary { background: var(--color-accent-fill); color: var(--color-accent-on); }
.tt-chrome .btn--primary:hover { background: var(--color-accent-fill-hover); color: var(--color-accent-on); }
.tt-chrome .btn--secondary { color: var(--color-accent-text); border-color: var(--color-accent); background: transparent; }
.tt-chrome .btn--secondary:hover { background: var(--color-accent-subtle); }
/* The header's call to action is `ink` since round 3: the chrome's only filled element,
   near-black rather than teal so it never competes with the accent inside a page. */
.tt-chrome .btn--ink { background: var(--color-surface-inverse); color: var(--color-text-inverse); }
.tt-chrome .btn--ink:hover { background: var(--color-surface-inverse-raised); color: var(--color-text-inverse); }

/* ---------------------------------------------------------------------------
   The app shell — the reseller portal's rail beside an Odoo-rendered body
   (D112 point 5).

   The router wraps Odoo's `<main>` in `.tt-portal` and injects
   /portal-chrome/rail into the first column (edge/portal-router/src/index.ts).
   So the geometry below is the page-mode half of site/src/layouts/
   PortalLayout.astro, and the rail itself is a de-scoped copy of
   site/src/components/chrome/PortalSidebar.astro's <style> — same standing
   caveat as the rest of this file: an Odoo page does not run the Astro build,
   so nothing here updates on its own. `scripts/portal-chrome-diff.mjs`
   measures both against /channel-connect, which is the same rail rendered by
   Astro.

   TWO THINGS THIS SECTION DOES DIFFERENTLY, both deliberate:

   1. `.tt-portal` is NOT `.tt-chrome`. The shell contains Odoo's entire page
      body, and .tt-chrome carries a reset plus inherited type and colour —
      landing that on Odoo's markup would undo portal-body.css's whole tuning.
      So the shell declares only the custom properties it needs (no inherited
      properties, nothing that cascades into the body as a style), and
      .tt-chrome stays on the rail alone, where the partial renders it.
   2. Level 2 (the active page's screens) never appears here: an Odoo page has
      no screens, so the router asks for the rail with `groups={[]}`. Its rules
      are copied anyway — inert, but a partial copy is the thing that drifts
      silently — and the one rule that HAS to differ is called out below.
   ------------------------------------------------------------------------ */

.tt-portal {
  /* The subset the two columns need. Same values as .tt-chrome's block above
     and as portal-body.css's :root, which is what Odoo's body already reads —
     so these inherit into it without changing a single computed value. */
  --space-px: 1px;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-16: 4rem;
  --color-bg:      #ffffff;
  --color-surface: var(--ink-50, #f6f7f8);
  --color-border:  var(--ink-200, #d9dee2);
  --shadow-sm: 0 2px 6px color-mix(in oklab, #1d252c 8%, transparent),
               0 1px 2px color-mix(in oklab, #1d252c 5%, transparent);

  /* The content column's own gutter, published here and consumed by
     portal-body.css — which is where Odoo's `.container` stops centring itself
     and takes this instead (PortalLayout hands the gutter to a Section the same
     way). One source of truth, including the narrow-viewport step below. */
  --shell-gutter: var(--space-16);

  display: grid;
  /* 280px like the live /cilantro rail and like PortalLayout: narrower and
     "Channel Connect" wraps, which is the longest label the rail carries. */
  grid-template-columns: 280px minmax(0, 1fr);
  background: var(--color-surface);
  /* A short Odoo body — /my/orders with no orders is one alert — must not leave
     the rail's panel stopping mid-page. Asks for the fold as a minimum and
     grows past it, exactly as page mode does. --nav-h is published on <html> by
     Nav's own script (measured 73px on beta, 2026-09-11); the fallback is only
     reached if that script never runs. */
  min-height: calc(100dvh - var(--nav-h, 4.5rem));
}

.tt-portal__rail {
  /* The rail sticks BELOW our header, which is sticky itself and slides away on
     a scroll down — so this is an offset, not a reserved gap. Consumed by
     `.portal-rail`'s own `top` (below), which is where the component puts it. */
  --rail-top: calc(var(--nav-h, 4.5rem) + var(--space-6));
  padding-inline: var(--space-5);
  border-inline-end: var(--space-px) solid var(--color-border);
  background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-surface) 100%);
  box-shadow: var(--shadow-sm);
  z-index: 1;
}

/* The partial's own .tt-chrome wrapper generates no box: `.portal-rail` sticks
   to the scroll, and a wrapper sized to its content would give it nothing to
   travel inside. Custom properties and inherited type still reach the rail
   through it, which is the only job it has. */
.tt-portal__rail-inner { display: contents; }

/* Odoo's <main>, renamed by the router into the shell's content column. The
   radial wash is PortalLayout's — white at the top-left, settling into the
   surface tint. */
.tt-portal__main {
  background: radial-gradient(140% 160% at 0% 0%,
    var(--color-bg) 0%, var(--color-surface) 100%);
}

/* ---- The rail itself: PortalSidebar.astro's <style>, de-scoped ----------- */

.tt-chrome .portal-rail {
  position: sticky;
  top: var(--rail-top, var(--space-8));
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  padding-block: var(--space-8);
}

.tt-chrome .portal-rail__brand { display: inline-flex; margin-block-end: var(--space-6); }
.tt-chrome .portal-rail__brand img { width: auto; max-width: 180px; height: auto; max-height: 48px; object-fit: contain; }

/* The wordmark variant — what the injected rail actually renders (the partial passes
   `brandText`, not `logo`). The `img` rule above is inert here and kept for the same
   reason level 2 is: a partial copy is what drifts silently. */
.tt-chrome .portal-rail__brand--text {
  align-items: center;
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-heading);
  color: var(--color-text);
  text-decoration: none;
  padding-inline: var(--space-4);
}
.tt-chrome .portal-rail__brand--text:hover { color: var(--color-accent-text); }

.tt-chrome .portal-rail__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-block-end: var(--space-3);
}

.tt-chrome .portal-rail__list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.tt-chrome .portal-rail__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text);
  text-decoration: none;
  transition: background-color var(--duration-base) var(--ease-out),
              color var(--duration-base) var(--ease-out);
}
.tt-chrome .portal-rail__link i {
  width: 1.25em;
  text-align: center;
  color: var(--color-accent);
}
.tt-chrome .portal-rail__link:hover { background: var(--color-accent-subtle); }

/* The active pill: near-black with a mint glyph, not an accent fill. On an Odoo
   page only `page` can occur — `true` is level 2's screen state, and there is
   no level 2 here — but both are copied for the reason in the header. Level 2
   overrides this to a quieter accent tint further down. */
.tt-chrome .portal-rail__link[aria-current="true"],
.tt-chrome .portal-rail__link[aria-current="page"] {
  background: var(--color-surface-inverse);
  color: var(--color-text-inverse);
  box-shadow: var(--shadow-md);
}
.tt-chrome .portal-rail__link[aria-current="true"] i,
.tt-chrome .portal-rail__link[aria-current="page"] i { color: var(--color-border-accent); }

/* Level 2, inert here (see the header): copied so this stays diffable against
   the component rather than quietly becoming a different rail. */
.tt-chrome .portal-rail__screens {
  margin-block: var(--space-1);
  margin-inline-start: var(--space-6);
  padding-inline-start: var(--space-3);
  border-inline-start: var(--space-px) solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.tt-chrome .portal-rail__title--sub { margin-block-end: var(--space-2); }
.tt-chrome .portal-rail__link--sub {
  padding-block: var(--space-2);
  font-weight: var(--weight-medium);
  color: var(--color-text-muted);
}

/* The active SCREEN's quieter state, also inert here — a tint of the accent rather than
   a second near-black pill under level 1's. Copied for diffability (see the header). */
.tt-chrome .portal-rail__link--sub[aria-current="true"],
.tt-chrome .portal-rail__link--sub[aria-current="page"] {
  background: var(--color-accent-subtle);
  color: var(--color-accent-text);
  font-weight: var(--weight-semibold);
  box-shadow: none;
}
.tt-chrome .portal-rail__link--sub[aria-current="true"] i,
.tt-chrome .portal-rail__link--sub[aria-current="page"] i { color: var(--color-accent-text); }

/* THE ONE RULE THAT HAS TO DIFFER FROM THE COMPONENT.
   PortalSidebar splits level 1 around the active entry into two <ul>s so that
   level 2 can sit between them, and at the mobile breakpoint it places the
   screens explicitly at row 2 of a two-row grid — which is what pushes the two
   halves into row 1 beside each other. With no screens element to place, that
   grid's `grid-auto-flow: column` fills column 1 rows 1 and 2 instead, and the
   rail's two halves stack vertically: "Channel Connect · New quote · Orders"
   above "Tickets · Account". Every Odoo page is that case. So when the group
   has no screens, it is a plain flex list — a column on desktop (where the
   component's block layout would leave a 0px seam at the split, against 4px
   between every other pill) and one row in the mobile strip below. */
.tt-chrome .portal-rail__group--rows:not(:has(.portal-rail__screens)) {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

@media (max-width: 61.9375rem) {
  .tt-portal {
    grid-template-columns: minmax(0, 1fr);
    /* The strip takes its own height and the body takes the rest. Without this the
       two rows SHARE the shell's min-height, and a short Odoo body (/my/orders with
       no orders) left the rail strip 332px tall with its closing hairline stranded
       251px below the pills. */
    grid-template-rows: auto minmax(0, 1fr);
    /* The gutter closes up with the rail; --space-6 is what PortalLayout drops to. */
    --shell-gutter: var(--space-6);
  }
  .tt-portal__rail {
    position: sticky;
    top: 0;
    z-index: 10;
    padding-inline: var(--space-4);
    border-inline-end: 0;
    border-block-end: var(--space-px) solid var(--color-border);
    background: var(--color-bg);
    box-shadow: none;
  }
  /* `top: 0` is only right while the scroll-direction Nav has hidden itself; the
     moment it shows again both want the viewport's edge and the Nav's z-index
     wins, burying the rail under its height. Same fix as PortalLayout's and
     SectionNav's — step down by exactly --nav-h while the Nav says it is
     visible. Unconditional here, where the rail is always the portal's. */
  body:has(.nav[data-hidden="false"]) .tt-portal__rail { top: var(--nav-h, 4.5rem); }

  .tt-chrome .portal-rail__brand { margin-block-end: 0; flex-shrink: 0; }
  .tt-chrome .portal-rail__brand img { max-width: 104px; max-height: 32px; }
  .tt-chrome .portal-rail__brand--text {
    padding-inline: 0;
    font-size: var(--text-sm);
    white-space: nowrap;
  }
  .tt-chrome .portal-rail {
    position: static;
    flex-direction: row;
    gap: var(--space-4);
    overflow-x: auto;
    padding-block: var(--space-4);
    scrollbar-width: thin;
  }
  .tt-chrome .portal-rail:has(.portal-rail__group--rows) { align-items: flex-start; }
  .tt-chrome .portal-rail__group { display: flex; align-items: center; gap: var(--space-2); }
  .tt-chrome .portal-rail__title { display: none; }
  .tt-chrome .portal-rail__list { flex-direction: row; gap: var(--space-2); }
  .tt-chrome .portal-rail__list--pages > li { display: flex; align-items: center; gap: var(--space-2); }
  .tt-chrome .portal-rail__link {
    white-space: nowrap;
    border: var(--space-px) solid var(--color-border);
  }

  .tt-chrome .portal-rail__group--rows {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    grid-template-rows: auto auto;
    grid-auto-flow: column;
    align-items: center;
    gap: var(--space-2) var(--space-4);
  }
  /* …and the no-screens case (every Odoo page) is one row, not that grid. */
  .tt-chrome .portal-rail__group--rows:not(:has(.portal-rail__screens)) {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-2);
  }
  .tt-chrome .portal-rail__screens {
    grid-row: 2;
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: nowrap;
    margin: 0;
    padding-inline-start: 0;
    padding-block-start: var(--space-2);
    border-inline-start: 0;
    border-block-start: var(--space-px) solid var(--color-border);
    gap: var(--space-2);
    overflow-x: auto;
  }
  .tt-chrome .portal-rail__link--sub {
    padding-block: var(--space-1);
    font-size: var(--text-xs);
    border-color: transparent;
  }
}
