/*
 * Team Forge shell theme: the look of the Neon handoff prototype (the designer's app shell) for the top bar and the
 * left nav. The colors are not set here: they are the public theme tokens (--app-*) from the shared platform UI
 * (packages/platform-ui/theme), so the Appearance picker and the theme editor restyle the shell and the MFEs
 * together. This file only adds what no token reaches:
 *
 *   1. Neon's documented custom properties (--neon-fun-*, --neon-theme-*), fed from the tokens.
 *   2. The sections marked DEVIATION (some NON-NEON: DEV-00X, recorded in poc-app-shell/deviations.json): the nav
 *      rail and its brand and pin toggle, the Applications drawer docked beside the rail, the messaging takeover, the
 *      footer and the mobile menu. Neon 4.7 paints the rail and its items with fixed colors that no token reaches, has
 *      no brand slot and no left drawer, so those few rules target Neon's markup. Re-check them on a Neon upgrade; the
 *      unversioned `neon-app-nav` attribute and `neon-app-nav-*` classes are used so the selectors survive a version
 *      bump.
 *
 * This file is served from /public and linked from src/index.html. It is unlayered, so it must never define a
 * --app-* token (an unlayered value would beat the theme layer and the theme could no longer change it).
 */

:root {
  /* 1. Neon's documented properties: a 76px top bar (the nav's top control and scroll area follow it; the header
     MFE fills the slot), the page canvas and the selected nav item. */
  --neon-fun-app-header-min-height: 76px;
  --neon-theme-main-canvas: var(--app-surface);
  --neon-theme-app-nav-selected-background: var(--app-selected);

  /* Shell-only values with no public token: the rail's widths and the brand badge. */
  --tf-nav-width: 72px;
  --tf-nav-width-expanded: 192px;
  --tf-brand-badge-size: 38px;
  --tf-brand-badge-radius: 12px;

  /* The designer's slate nav icons and the pale initials mark (light theme); other themes use their own tokens. */
  --tf-nav-icon: #64748b;
  --tf-avatar-bg: #dbe7ff;
}

:root[data-app-theme]:not([data-app-theme="light"]) {
  --tf-nav-icon: var(--app-text-muted);
  --tf-avatar-bg: var(--app-selected);
}

@media (max-width: 1100px) {
  :root {
    --neon-fun-app-header-min-height: 56px;
    --tf-nav-width: 56px;
    --tf-brand-badge-size: 34px;
    --tf-brand-badge-radius: 10px;
  }
}

/*
 * DEVIATION: the page scrolls inside the content area.
 * Why: Neon's layout gives the content area the height left under the header but leaves it overflow: visible,
 * so a tall page makes the whole document scroll and the header and the nav scroll away with it.
 * Neon option: none found for 4.7 (the layout has no scroll setting).
 * The content area is addressed by its fixed id, since its class name carries the Neon version.
 */
main#app-shell_main-injection-point {
  min-block-size: 0;
  overflow-y: auto;
}

/*
 * DEVIATION: MFEs that fill their parent (the messaging inbox sizes itself `height: 100%`).
 * Why: the content wrapper grows to fit its content, so 100% resolves to the content's own height and the inbox
 * is taller than the screen. Real MPH gives it a fixed-height Neon detail layout instead.
 * Neon option: none for the app layout's scroll wrapper. Only a page that holds the inbox is changed; every other
 * page keeps scrolling normally. (The messaging takeover below gives the inbox its height itself.)
 */
main#app-shell_main-injection-point [class*="layout-scrollable"] > [class*="page-padding"]:has(.messenger-inbox) {
  flex: 1 1 0;
  min-block-size: 0;
  box-sizing: border-box;
}

/*
 * DEVIATION: first paint of the header bar and the rail.
 * Why: until the header and the rail mount, Neon draws its own placeholder in each container (its :empty states: a teal
 * header bar and a white 56px rail, both with a skeleton pattern), so every load flashed the old colors and the rail
 * grew from 56px to 72px. This file is linked in the page head, so these rules apply to the first frame: the
 * placeholders take the theme's header color and the final rail width, and drop the pattern.
 * Neon option: none (the placeholder colors are fixed in Neon's stylesheet). The repeated attribute out-ranks Neon's
 * selectors, including its collapsed-nav variant, without !important.
 */
[class*="app-layout-master"][class*="app-layout-master"][class*="app-layout-master"] > [class*="app-layout-header-bar"]:empty {
  background: var(--app-header-bg);
  border-block-end: 0;
}

@media (min-width: 769px) {
  [class*="app-layout-master"][class*="app-layout-master"][class*="app-layout-master"][class*="app-layout-master"] :is([class*="app-layout-nav"], [class*="app-layout-nav"] > *):empty {
    inline-size: var(--tf-nav-width);
    background: var(--app-header-bg);
  }
}

/*
 * DEVIATION: nav surfaces.
 * Why: Neon paints the rail, the toggle and every item white (fixed colors), so the rail cannot match the top
 * bar's cool grey through a token.
 * Neon option: none (no background token for the desktop nav).
 * Specificity beats Neon's selectors by one class, so no !important is needed.
 */
[neon-app-nav] .neon-app-nav-desktop,
[neon-app-nav] .neon-app-nav-desktop button.pds-app-nav-desktop-hamburger-button {
  background-color: var(--app-header-bg);
}

[neon-app-nav] .neon-app-nav-desktop ul.neon-app-nav-desktop-primary-nav-items li.neon-app-nav-desktop-primary-list-item :is(.neon-app-nav-desktop-primary-clickable, .neon-app-nav-desktop-primary-expandable-button) {
  background-color: var(--app-header-bg);
  color: var(--app-text-muted);
}

[neon-app-nav] .neon-app-nav-desktop ul.neon-app-nav-desktop-primary-nav-items li.neon-app-nav-desktop-primary-list-item :is(.neon-app-nav-desktop-primary-clickable, .neon-app-nav-desktop-primary-expandable-button):hover {
  background-color: var(--app-hover);
  color: var(--app-text);
}

/* Neon fills a focused item with a fixed light grey, which is unreadable on a dark theme. */
[neon-app-nav] .neon-app-nav-desktop ul.neon-app-nav-desktop-primary-nav-items li.neon-app-nav-desktop-primary-list-item :is(.neon-app-nav-desktop-primary-clickable, .neon-app-nav-desktop-primary-expandable-button):focus:not(.neon-app-nav-is-active) {
  background-color: var(--app-hover);
  color: var(--app-text);
}

/* The selected item keeps Neon's own selected background (token above); only its text turns navy. */
[neon-app-nav] .neon-app-nav-desktop ul.neon-app-nav-desktop-primary-nav-items li.neon-app-nav-desktop-primary-list-item :is(.neon-app-nav-desktop-primary-clickable, .neon-app-nav-desktop-primary-expandable-button).neon-app-nav-is-active {
  color: var(--app-accent);
}

/*
 * DEVIATION: nav item text and icon colors.
 * Why: Neon draws nav labels in its own font and icons in its own dark ink; the prototype uses Inter text and
 * slate icons that turn navy when selected.
 * Neon option: --neon-theme-app-nav-icon is mapped by ui-core but not read by Neon 4.7's nav. Neon sets labels
 * with a `font` shorthand under a long selector, so the attribute is doubled to out-rank it without !important;
 * only the family changes, Neon's sizes and weights stay.
 */
[neon-app-nav][neon-app-nav] .neon-app-nav-desktop ul.neon-app-nav-desktop-primary-nav-items li.neon-app-nav-desktop-primary-list-item :is(.neon-app-nav-primary-item-text, .neon-app-nav-desktop-primary-expandable-button-heading) {
  font-family: var(--app-font-family, "Inter", Roboto, Arial, sans-serif);
}

[neon-app-nav] .neon-app-nav-desktop :is(.neon-app-nav-desktop-primary-clickable, .neon-app-nav-desktop-primary-expandable-button) svg {
  fill: var(--tf-nav-icon);
}

[neon-app-nav] .neon-app-nav-desktop :is(.neon-app-nav-desktop-primary-clickable, .neon-app-nav-desktop-primary-expandable-button):hover svg {
  fill: var(--tf-nav-icon);
}

[neon-app-nav] .neon-app-nav-desktop :is(.neon-app-nav-desktop-primary-clickable, .neon-app-nav-desktop-primary-expandable-button).neon-app-nav-is-active svg {
  fill: var(--app-accent);
}

/*
 * DEVIATION: nav flyout panel colors.
 * Why: a group's flyout (Calendar, Platform Settings) is drawn by Neon in a fixed white panel with fixed dark text and
 * icons, so on a dark theme the panel stays white and the selected row (a dark fill from the theme) shows dark text
 * on dark.
 * Neon option: none (no background or text token for the desktop menu panel).
 * The panel, its links and their icons read the theme tokens, so every theme restyles them.
 */
[neon-app-nav][neon-app-nav] .neon-app-nav-desktop article.neon-desktop-menu.neon-desktop-menu {
  background-color: var(--app-surface-raised);
  color: var(--app-text);
}

[neon-app-nav] .neon-app-nav-desktop article.neon-desktop-menu a.neon-app-nav-desktop-menu-anchor {
  color: var(--app-text);
}

[neon-app-nav] .neon-app-nav-desktop article.neon-desktop-menu a.neon-app-nav-desktop-menu-anchor svg {
  fill: var(--app-text);
}

[neon-app-nav] .neon-app-nav-desktop article.neon-desktop-menu a.neon-app-nav-desktop-menu-anchor:is(:hover, :focus-visible) {
  background-color: var(--app-hover);
  color: var(--app-text);
}

[neon-app-nav] .neon-app-nav-desktop article.neon-desktop-menu a.neon-app-nav-desktop-menu-anchor.neon-app-nav-is-active {
  background-color: var(--app-selected);
  color: var(--app-accent);
}

[neon-app-nav] .neon-app-nav-desktop article.neon-desktop-menu a.neon-app-nav-desktop-menu-anchor.neon-app-nav-is-active svg {
  fill: var(--app-accent);
}

/*
 * DEVIATION: rail width and icon alignment.
 * Why: Neon's rail is 56px collapsed and puts a 16px inset on every item, which moves the icons 8px when the rail
 * expands. The design has a 72px rail (56px at 1100px and below) with the icons on the badge's centerline in both
 * states, so the padding is the same in both.
 * Neon option: none (the widths and the item padding are fixed values). The host's minimum width keeps the page from
 * shifting when the rail opens as an overlay on hover.
 */
@media (min-width: 769px) {
  [neon-app-nav] {
    min-inline-size: var(--tf-nav-width);
  }

  [neon-app-nav]:not(.neon-app-nav-desktop-expanded) .neon-app-nav-desktop:not(.neon-app-nav-desktop-hover, .neon-app-nav-desktop-hover-lock) {
    inline-size: var(--tf-nav-width);
  }

  [neon-app-nav][neon-app-nav] .neon-app-nav-desktop ul.neon-app-nav-desktop-primary-nav-items li.neon-app-nav-desktop-primary-list-item :is(.neon-app-nav-desktop-primary-clickable, .neon-app-nav-desktop-primary-expandable-button) {
    padding-inline-start: calc((var(--tf-nav-width) - 24px) / 2);
  }
}

/*
 * DEVIATION: labels while the rail is collapsed.
 * Why: Neon hides them with display: none, which also hides them from screen readers. They are kept in the accessibility
 * tree and made invisible instead.
 * Neon option: none.
 */
@media (min-width: 769px) {
  [neon-app-nav]:not(.neon-app-nav-desktop-expanded) .neon-app-nav-desktop:not(.neon-app-nav-desktop-hover, .neon-app-nav-desktop-hover-lock) :is(.neon-app-nav-primary-item-text, .neon-app-nav-desktop-primary-expandable-button-heading, .neon-app-nav-desktop-primary-expandable-caret) {
    display: block;
    opacity: 0;
    pointer-events: none;
  }
}

/*
 * NON-NEON: DEV-002 (DEVIATION): brand slot (src/components/NavBrand.tsx).
 * Why: NeonAppNav has no brand slot, so the PowerSchool "P" badge is a fixed element laid over the rail's
 * toggle area, which is exactly one top-bar height tall. It grows to the rail's width when the rail expands
 * (hover, focus, pinned, a flyout or the Applications drawer: Neon adds one of the classes below) and shows the
 * wordmark; it is hidden while Neon's own toggle has keyboard focus (DEV-005), so that toggle stays reachable.
 * Alignment rule: the badge and every nav icon share one centerline (the padding below), collapsed or expanded.
 * Neon option: none.
 */
.tf-nav-brand {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 6001; /* Neon's navigation layer is 6000; menus (7000) and dialogs stay above. */
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  block-size: var(--neon-fun-app-header-min-height);
  inline-size: var(--tf-nav-width);
  padding-inline-start: calc((var(--tf-nav-width) - var(--tf-brand-badge-size)) / 2);
  overflow: hidden;
  background-color: var(--app-header-bg);
  color: var(--app-text);
  text-decoration: none;
  transition: inline-size 0.2s;
}

.tf-nav-brand__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  inline-size: var(--tf-brand-badge-size);
  block-size: var(--tf-brand-badge-size);
  border-radius: var(--tf-brand-badge-radius);
  background-color: var(--app-accent);
}

.tf-nav-brand__mark {
  fill: var(--app-primary-text);
}

.tf-nav-brand__label {
  font-family: var(--app-font-family, "Inter", Roboto, Arial, sans-serif);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  white-space: nowrap;
}

/* The sign-in page's top bar: the same height, color and layout as the signed-in header. The badge is centered in the
   rail's width and the title starts where the school name starts once signed in. */
.tf-login-header {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  block-size: var(--neon-fun-app-header-min-height);
  padding-inline: 0 2rem;
  background-color: var(--app-header-bg);
  color: var(--app-header-text);
  font-family: var(--app-font-family, "Inter", Roboto, Arial, sans-serif);
}

.tf-login-header__brand {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  inline-size: var(--tf-nav-width);
}

.tf-login-header__name {
  padding-inline-start: 1.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--app-accent);
}

/* The sign-in form's Neon controls follow the theme tokens, as the MFEs' do in team-forge-mfes.css. The doubled class
   out-ranks Neon's label, badge and input rules, which are fixed colors. */
.tf-login.tf-login :is(.neon-input-field-label, [class*="input-field-label"]) {
  color: var(--app-text);
}

.tf-login.tf-login :is(.neon-input-field-badge, [class*="input-field-badge"]) {
  color: var(--app-text-muted);
  border-color: var(--app-text-muted);
}

.tf-login.tf-login input {
  background-color: var(--app-input-bg);
  color: var(--app-text);
}

.tf-login.tf-login [class*="text-field-input-container"] {
  border-color: var(--app-control-border);
}

.tf-login button.neon-button[class*="-button-secondary"] {
  background-color: var(--app-surface-raised);
  border-color: var(--app-accent);
  color: var(--app-accent);
}

.tf-login button.neon-button[class*="-button-secondary"]:hover:not(:disabled) {
  background-color: var(--app-hover);
}

.tf-nav-brand .tf-nav-brand__label {
  display: none;
}

.tf-nav-brand:focus-visible {
  outline: 2px solid var(--app-accent);
  outline-offset: -2px;
}

body:has([neon-app-nav] :is(.neon-app-nav-desktop-hover, .neon-app-nav-desktop-hover-lock), [neon-app-nav].neon-app-nav-desktop-expanded) :is(.tf-nav-brand, .tf-nav-pin) {
  inline-size: var(--tf-nav-width-expanded);
}

body:has([neon-app-nav] :is(.neon-app-nav-desktop-hover, .neon-app-nav-desktop-hover-lock), [neon-app-nav].neon-app-nav-desktop-expanded) .tf-nav-brand {
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.08);
}

body:has([neon-app-nav] :is(.neon-app-nav-desktop-hover, .neon-app-nav-desktop-hover-lock), [neon-app-nav].neon-app-nav-desktop-expanded) :is(.tf-nav-brand__label, .tf-nav-pin__label) {
  display: inline;
}

body:has(.pds-app-nav-desktop-hamburger-button:focus-visible) .tf-nav-brand {
  visibility: hidden;
}

/*
 * NON-NEON: DEV-005 (DEVIATION): Neon's own expand/collapse toggle.
 * Why: it sits at the top of the rail, where the brand goes. It stays in the layout under the brand (so the nav
 * keeps its top-bar-high header), is not clickable there, and shows only when it has keyboard focus.
 * Neon option: none (NeonAppNav has no prop to hide or move the toggle). The visible toggle is DEV-009.
 */
[neon-app-nav] .neon-app-nav-desktop button.pds-app-nav-desktop-hamburger-button {
  inline-size: var(--tf-nav-width);
}

/*
 * NON-NEON: DEV-009 (DEVIATION): visible pin toggle at the bottom of the rail (src/components/RailPinToggle.tsx).
 * Why: touch and keyboard users need a visible way to keep the rail open. It clicks Neon's own toggle, so the
 * pinned state stays Neon's (neon-app-nav-is-expanded in localStorage).
 * Neon option: none.
 */
.tf-nav-pin {
  position: fixed;
  inset-block-end: 0;
  inset-inline-start: 0;
  z-index: 6001;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  block-size: 3rem;
  inline-size: var(--tf-nav-width);
  padding-inline: calc((var(--tf-nav-width) - 24px) / 2) 1rem;
  border: 0;
  overflow: hidden;
  white-space: nowrap;
  background-color: var(--app-header-bg);
  color: var(--app-text-muted);
  font-family: var(--app-font-family, "Inter", Roboto, Arial, sans-serif);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: inline-size 0.2s, background-color 0.15s, color 0.15s;
}

.tf-nav-pin svg {
  flex-shrink: 0;
  fill: var(--tf-nav-icon);
}

.tf-nav-pin:hover {
  background-color: var(--app-hover);
  color: var(--app-text);
}

.tf-nav-pin:focus-visible {
  outline: 2px solid var(--app-focus);
  outline-offset: -2px;
}

.tf-nav-pin .tf-nav-pin__label {
  display: none;
}

/* The last nav items must scroll clear of the pin toggle. */
[neon-app-nav] .neon-app-nav-desktop ul.neon-app-nav-desktop-primary-nav-items {
  padding-block-end: 3rem;
}

/*
 * NON-NEON: DEV-008 (DEVIATION): the Applications drawer docked on the left, beside the rail.
 * Why: the real application-menu MFE is a Neon modal drawer, which only opens on the right. Its markup is in the
 * page (no shadow root), so the drawer is moved with host CSS. The shell keeps the rail open (expanded) while the
 * drawer is open, and the rail (Neon's navigation layer, 6000) sits above the drawer and its backdrop, so the rail
 * casts its shadow onto the drawer. The drawer's header is the top bar's height and color. Below 768px it fills the
 * width from the left edge.
 * Neon option: none (NeonModalDrawer has no placement option).
 */
.tf-apps-drawer {
  display: contents;
}

dynamic-component[data-module="./application-menu"] [neon-modal-drawer] .neon-drawer-container .neon-overlay {
  inset-inline: var(--tf-nav-width-expanded) 0;
  z-index: 5950;
  background-color: rgba(15, 23, 42, 0.24);
}

dynamic-component[data-module="./application-menu"] [neon-modal-drawer] .neon-drawer-container .neon-drawer {
  inset-inline: var(--tf-nav-width-expanded) auto;
  inline-size: min(29rem, calc(100vw - var(--tf-nav-width-expanded)));
  z-index: 5951;
  background-color: var(--app-surface);
  box-shadow: 6px 0 24px rgba(15, 23, 42, 0.14);
}

/* Neon slides the drawer in from the right and waits for the end of the slide-out before it reports closing, so the
   slide runs from the left here and keeps the same attributes and events. */
dynamic-component[data-module="./application-menu"] [neon-modal-drawer][data-animate] .neon-drawer-container .neon-drawer {
  animation: tf-apps-drawer-in 200ms ease-in-out;
}

dynamic-component[data-module="./application-menu"] [neon-modal-drawer][data-animate-out] .neon-drawer-container .neon-drawer {
  animation: tf-apps-drawer-out 200ms ease-in-out forwards;
}

dynamic-component[data-module="./application-menu"] [neon-modal-drawer] header.neon-modal-drawer-title {
  box-sizing: border-box;
  block-size: var(--neon-fun-app-header-min-height);
  min-block-size: var(--neon-fun-app-header-min-height);
  padding-block: 0;
  padding-inline: 1.5rem 1rem;
  border-block-end: 1px solid var(--app-border);
  background-color: var(--app-header-bg);
  color: var(--app-header-text);
  font-family: var(--app-font-family, "Inter", Roboto, Arial, sans-serif);
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

body.tf-apps-open [neon-app-nav] .neon-app-nav-desktop {
  box-shadow: 6px 0 18px rgba(0, 0, 0, 0.12);
}

/* Applications is not a page, so while its drawer is open the item looks selected (Neon's own selected colors). */
body.tf-apps-open #nav-applications {
  background-color: var(--app-selected);
  color: var(--app-accent);
}

body.tf-apps-open #nav-applications svg {
  fill: var(--app-accent);
}

@keyframes tf-apps-drawer-in {
  from {
    transform: translateX(-100%);
  }

  to {
    transform: translateX(0);
  }
}

@keyframes tf-apps-drawer-out {
  from {
    transform: translateX(0);
  }

  to {
    transform: translateX(-100%);
  }
}

/* Reduced motion: the slide still runs (Neon waits for its end) but takes no time. */
@media (prefers-reduced-motion: reduce) {
  dynamic-component[data-module="./application-menu"] [neon-modal-drawer]:is([data-animate], [data-animate-out]) .neon-drawer-container .neon-drawer {
    animation-duration: 1ms;
  }

  .tf-nav-brand,
  .tf-nav-pin,
  [neon-app-nav] .neon-app-nav-desktop {
    transition: none;
  }
}

@media (max-width: 768px) {
  dynamic-component[data-module="./application-menu"] [neon-modal-drawer] .neon-drawer-container .neon-overlay {
    inset-inline: 0;
  }

  dynamic-component[data-module="./application-menu"] [neon-modal-drawer] .neon-drawer-container .neon-drawer {
    inset-inline: 0 auto;
    inline-size: min(29rem, 100vw);
  }
}

/*
 * NON-NEON: DEV-010 (DEVIATION): the messaging takeover (src/components/MessagingTakeover.tsx).
 * Why: My PowerHub opens messaging full screen from the top bar (a Neon detail layout with a navy bar and a back
 * button). The shell mounts the real inbox in a fixed overlay above the rail and the top bar (below Neon's menus,
 * 7000, and dialogs). The inbox sizes itself `height: 100%`, so each wrapper between the overlay and the inbox is
 * given the full height.
 * Neon option: none for an overlay outside the app layout.
 */
.tf-messaging {
  position: fixed;
  inset: 0;
  z-index: 6500;
  display: flex;
  flex-direction: column;
  background-color: var(--app-surface-raised);
  color: var(--app-text);
  font-family: var(--app-font-family, "Inter", Roboto, Arial, sans-serif);
}

.tf-messaging__bar {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  box-sizing: border-box;
  block-size: 3.75rem;
  padding-inline: 1rem;
  background-color: var(--app-accent);
  color: var(--app-primary-text);
}

.tf-messaging__back {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0.625rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

.tf-messaging__back:hover {
  background-color: color-mix(in srgb, currentcolor 14%, transparent);
}

.tf-messaging__back:focus-visible {
  outline: 2px solid currentcolor;
  outline-offset: 2px;
}

.tf-messaging__body {
  flex: 1 1 0;
  min-block-size: 0;
  overflow: hidden;
}

.tf-messaging__body :is(dynamic-component, [neon-react-root]) {
  display: block;
  block-size: 100%;
}

/*
 * The coming-soon dialog's message (src/components/ComingSoonDialog.tsx). Neon renders a dialog body without a font
 * when the host page sets none, so the message sets the theme's.
 */
.tf-coming-soon {
  margin: 0;
  font-family: var(--app-font-family, "Inter", Roboto, Arial, sans-serif);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--app-text);
}

/*
 * NON-NEON: DEV-006 (DEVIATION): footer (src/components/ShellFooter.tsx).
 * Why: NeonFooter is a tall three-column address card; the design has one slim line (a COPPA requirement). It is the
 * last child of the content area, which is a flex column, and scrolls with the page.
 * Neon option: none.
 */
.tf-footer {
  order: 99;
  flex: 0 0 auto;
  margin-block-start: auto;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.625rem 1.5rem;
  font-family: var(--app-font-family, "Inter", Roboto, Arial, sans-serif);
  font-size: 12px;
  line-height: 1.5;
  color: var(--app-text-muted);
}

.tf-footer__legal {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.tf-footer__link {
  color: inherit;
  text-decoration: none;
}

.tf-footer__link:hover {
  text-decoration: underline;
}

.tf-footer__link:focus-visible {
  outline: 2px solid var(--app-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/*
 * NON-NEON: DEV-004 (DEVIATION): mobile menu (src/components/MobileNav.tsx).
 * Why: at 768px and below Neon shows its own mobile menu: a dark-teal hamburger with no logo slot. It is hidden, and
 * the nav's grid column is given no width, so the top bar starts at the left edge and leaves room for the shell's
 * neutral menu button, which opens a slide-out drawer with the logo.
 * Neon option: none (the mobile menu cannot be recolored per item or given a logo).
 */
.tf-mobile-nav-trigger {
  position: fixed;
  inset-block-start: 0;
  inset-inline-start: 0;
  z-index: 5900; /* above the top bar, below the Applications drawer (5950) and the mobile menu (6600) */
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  block-size: var(--neon-fun-app-header-min-height);
  inline-size: 3rem;
}

.tf-mobile-nav__backdrop {
  position: fixed;
  inset: 0;
  z-index: 6600;
  display: flex;
  justify-content: flex-start;
  background-color: rgba(0, 0, 0, 0.4);
}

.tf-mobile-nav {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  inline-size: min(19rem, 82vw);
  block-size: 100%;
  background-color: var(--app-surface-raised);
  color: var(--app-text);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  font-family: var(--app-font-family, "Inter", Roboto, Arial, sans-serif);
}

.tf-mobile-nav:focus-visible {
  outline: none;
}

.tf-mobile-nav__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 0.75rem;
  min-block-size: 3.5rem;
  padding-inline: 1rem 0.5rem;
  border-block-end: 1px solid var(--app-border);
}

.tf-mobile-nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
}

.tf-mobile-nav__list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  overflow-y: auto;
  padding-block: 0.5rem;
}

.tf-mobile-nav__children {
  padding-inline-start: 1.25rem;
}

@media (max-width: 768px) {
  [neon-app-nav] nav.neon-app-nav-mobile {
    display: none;
  }

  [class*="app-layout-master"] [class*="app-layout-nav"]:has([neon-app-nav]),
  [class*="app-layout-master"] [class*="app-layout-nav"][class*="app-layout-nav"] [class*="-app-nav"] {
    inline-size: 0;
    min-inline-size: 0;
  }
}
