/* App shell: sidebar, top bar, user block, store switcher, search, shell dialogs and error surfaces.
   Owned by W1-SHELL. Tokens only. Desktop (>= 1024px): fixed sidebar. Below: off-canvas drawer + hamburger. */

/* =========================================================================================
   Frame
   ========================================================================================= */
.ft-shell {
  min-height: 100vh;
  background: var(--ft-bg);
  color: var(--ft-text);
}

.ft-shell__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  margin-inline-start: var(--ft-sidebar-width);
  overflow-x: clip;
}

.ft-shell__content {
  flex: 1;
  width: 100%;
  max-width: calc(var(--ft-content-max) + 2 * var(--ft-space-10));
  margin-inline: auto;
  padding: var(--ft-space-8) var(--ft-space-10) var(--ft-space-12);
  box-sizing: border-box;
}

.ft-shell__scrim { display: none; }

/* Drawer container for page MudDrawers: supplies their size variables so they are fixed overlays. A closed drawer
   parks off-screen (right: -width), and Chrome counts fixed boxes in the page's scrollable overflow, which made pages
   400-460px too wide. Take closed drawers out of layout; animate display discretely so open/close still slide. */
.ft-shell__drawers { display: block; }
.ft-shell__drawers .mud-drawer.mud-drawer--closed:not(.mud-drawer-mini) { display: none; }

@supports (transition-behavior: allow-discrete) {
  .ft-shell__drawers .mud-drawer.mud-drawer:not(.mud-drawer-mini):not(.mud-drawer--initial) {
    transition: left var(--ft-duration-slow) var(--ft-ease), right var(--ft-duration-slow) var(--ft-ease),
                display var(--ft-duration-slow) allow-discrete;
  }

  @starting-style {
    .ft-shell__drawers .mud-drawer.mud-drawer--open.mud-drawer-pos-right:not(.mud-drawer-mini) {
      right: calc(-1 * var(--mud-drawer-width, var(--mud-drawer-width-right)));
    }

    .ft-shell__drawers .mud-drawer.mud-drawer--open.mud-drawer-pos-left:not(.mud-drawer-mini) {
      left: calc(-1 * var(--mud-drawer-width, var(--mud-drawer-width-left)));
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .ft-shell__drawers .mud-drawer.mud-drawer:not(.mud-drawer-mini):not(.mud-drawer--initial) { transition: none; }
}

/* =========================================================================================
   Sidebar
   ========================================================================================= */
.ft-sidebar {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  width: var(--ft-sidebar-width);
  padding: var(--ft-space-5) var(--ft-space-4) var(--ft-space-4);
  border-inline-end: 1px solid var(--ft-border);
  background: var(--ft-surface);
  box-sizing: border-box;
}

.ft-sidebar__head {
  display: flex;
  align-items: flex-start;
  gap: var(--ft-space-2);
}

/* Close button: phone/tablet drawer only. */
.ft-sidebar__close { display: none; flex: none; margin-inline-start: auto; }

.ft-sidebar__brand {
  display: flex;
  flex: 1;
  min-width: 0;
  align-items: center;
  gap: var(--ft-space-3);
  padding: var(--ft-space-1) var(--ft-space-1) var(--ft-space-6);
  color: var(--ft-text);
  text-decoration: none;
}

.ft-sidebar__brand:focus-visible {
  border-radius: var(--ft-radius-sm);
  outline: var(--ft-focus-width) solid var(--ft-focus);
  outline-offset: var(--ft-focus-offset);
}

.ft-sidebar__logo {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: transparent;
}

.ft-sidebar__logo img { width: 28px; height: 28px; display: block; }

.ft-sidebar__brand-name {
  font-size: var(--ft-text-2xl);
  font-weight: var(--ft-weight-extrabold);
  letter-spacing: var(--ft-tracking-tight);
  line-height: var(--ft-leading-tight);
}

.ft-sidebar__nav {
  flex: 1;
  min-height: 0;
  margin-inline: calc(-1 * var(--ft-space-1));
  padding-inline: var(--ft-space-1);
  overflow-y: auto;
  scrollbar-width: thin;
  /* Scroll-edge fade so a clipped list reads as scrollable. */
  mask-image: linear-gradient(to bottom, transparent 0, var(--ft-text) var(--ft-space-2),
                              var(--ft-text) calc(100% - var(--ft-space-6)), transparent 100%);
}

.ft-sidebar__caption {
  margin: var(--ft-space-6) var(--ft-space-2) var(--ft-space-2);
  color: var(--ft-text-subtle);
  font-size: 11px;
  font-weight: var(--ft-weight-bold);
  letter-spacing: var(--ft-tracking-wide);
  text-transform: uppercase;
}

.ft-sidebar__caption:first-child { margin-top: 0; }

/* Collapsible group caption (ADMIN). */
.ft-sidebar__caption--toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: calc(100% - 2 * var(--ft-space-2));
  min-height: var(--ft-control-md);
  margin-bottom: 0;
  padding: 0 var(--ft-space-2);
  margin-inline: 0;
  border: 0;
  border-radius: var(--ft-radius-sm);
  background: transparent;
  font-family: inherit;
  text-align: start;
  cursor: pointer;
  box-sizing: content-box;
}

.ft-sidebar__caption--toggle:hover { background: var(--ft-hover); color: var(--ft-text-muted); }
.ft-sidebar__caption--toggle:focus-visible { outline: var(--ft-focus-width) solid var(--ft-focus); outline-offset: -2px; }
.ft-sidebar__caption-chevron { font-size: 18px !important; }

/* Store switcher in the drawer footer: phone/tablet only (the top bar has room for it on desktop). */
.ft-sidebar__store { display: none; }

.ft-sidebar__list {
  display: flex;
  flex-direction: column;
  gap: var(--ft-space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* =========================================================================================
   User block (sidebar footer)
   ========================================================================================= */
.ft-user-block {
  display: flex;
  align-items: center;
  gap: var(--ft-space-1);
  margin-top: var(--ft-space-3);
  padding-top: var(--ft-space-3);
  border-top: 1px solid var(--ft-border);
}

.ft-user-block__menu { flex: 1; min-width: 0; }
.ft-user-block__menu > .mud-menu-activator { display: block; width: 100%; }

.ft-user-block__trigger {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: flex-start;
  gap: var(--ft-space-3);
  width: 100%;
  min-height: var(--ft-control-md);
  padding: var(--ft-space-1) var(--ft-space-2);
  border: 0;
  border-radius: var(--ft-radius-md);
  background: transparent;
  color: var(--ft-text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.ft-user-block__trigger:hover { background: var(--ft-hover); }

.ft-user-block__trigger:focus-visible {
  outline: var(--ft-focus-width) solid var(--ft-focus);
  outline-offset: -2px;
}

.ft-user-block__text { display: flex; flex-direction: column; min-width: 0; }

.ft-user-block__name,
.ft-user-block__role {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ft-user-block__name { font-size: var(--ft-text-sm); font-weight: var(--ft-weight-bold); }
.ft-user-block__role { color: var(--ft-text-muted); font-size: var(--ft-text-xs); }
.ft-user-block__settings { flex: none; color: var(--ft-text-muted); }

/* Settings pages: the user block is the active area, styled like an active nav item. */
.ft-user-block.is-active .ft-user-block__trigger,
.ft-user-block.is-active .ft-user-block__settings { background: var(--ft-nav-active); color: var(--ft-text); }

/* Popover menu (user menu). Rendered by MudPopoverProvider inside .ft-root. */
.ft-root .ft-menu {
  width: calc(var(--ft-sidebar-width) - 2 * var(--ft-space-4));
  min-width: 0;
  max-width: calc(var(--ft-sidebar-width) - 2 * var(--ft-space-4));
  border: 1px solid var(--ft-border);
}
.ft-root .ft-menu .ft-menu__list { padding: var(--ft-space-1); }
.ft-root .ft-menu .mud-menu-item { min-height: var(--ft-control-md); border-radius: var(--ft-radius-sm); }
.ft-root .ft-menu .mud-menu-item .mud-icon-root { color: var(--ft-text-muted); font-size: 20px; }
.ft-root .ft-menu .mud-menu-item-text { display: flex; align-items: center; gap: var(--ft-space-2); }

.ft-menu__caption {
  margin: var(--ft-space-2) var(--ft-space-3) var(--ft-space-1);
  color: var(--ft-text-subtle);
  font-size: 11px;
  font-weight: var(--ft-weight-bold);
  letter-spacing: var(--ft-tracking-wide);
  text-transform: uppercase;
}

.ft-menu__label { flex: 1; font-size: var(--ft-text-md); font-weight: var(--ft-weight-semibold); }
.ft-root .ft-menu .ft-menu__item.is-selected .ft-menu__label { color: var(--ft-text); }
.ft-root .ft-menu .ft-menu__check { color: var(--ft-accent-text); }
.ft-menu__divider { margin: var(--ft-space-1) 0; border: 0; border-top: 1px solid var(--ft-border); }
.ft-menu__form { margin: 0; }

.ft-menu__button {
  display: flex;
  align-items: center;
  gap: var(--ft-space-3);
  width: 100%;
  min-height: var(--ft-control-md);
  padding: 0 var(--ft-space-3);
  border: 0;
  border-radius: var(--ft-radius-sm);
  background: transparent;
  color: var(--ft-text);
  font: inherit;
  text-align: start;
  cursor: pointer;
}

.ft-menu__button:hover { background: var(--ft-hover); }
.ft-menu__button:focus-visible { outline: var(--ft-focus-width) solid var(--ft-focus); outline-offset: -2px; }
.ft-menu__icon { color: var(--ft-text-muted); font-size: 20px !important; }

/* =========================================================================================
   Top bar
   ========================================================================================= */
.ft-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--ft-topbar-height);
  border-bottom: 1px solid var(--ft-border);
  background: var(--ft-bg);
}

.ft-topbar__inner {
  display: flex;
  align-items: center;
  gap: var(--ft-space-3);
  height: 100%;
  max-width: calc(var(--ft-content-max) + 2 * var(--ft-space-10));
  margin-inline: auto;
  padding-inline: var(--ft-space-10);
  box-sizing: border-box;
}

.ft-topbar__toggle { display: none; flex: none; }
.ft-topbar__spacer { flex: 1; }

/* Store switcher */
.ft-store-switcher {
  display: inline-flex;
  align-items: center;
  gap: var(--ft-space-2);
  min-width: 0;
  max-width: 320px;
  height: 40px;
  padding: 0 var(--ft-space-3);
  border: 1px solid var(--ft-border);
  border-radius: var(--ft-radius-md);
  background: var(--ft-surface);
  color: var(--ft-text);
  font: inherit;
  font-size: var(--ft-text-sm);
  font-weight: var(--ft-weight-bold);
  cursor: pointer;
  transition: border-color var(--ft-duration-fast) var(--ft-ease), background-color var(--ft-duration-fast) var(--ft-ease);
}

.ft-store-switcher:hover { border-color: var(--ft-border-strong); }
.ft-store-switcher:focus-visible { outline: var(--ft-focus-width) solid var(--ft-focus); outline-offset: var(--ft-focus-offset); }
.ft-store-switcher--static { cursor: default; }
.ft-store-switcher--static:hover { border-color: var(--ft-border); }
.ft-store-switcher__icon { flex: none; color: var(--ft-text-muted); font-size: 18px !important; }
.ft-store-switcher__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ft-store-switcher__chevron {
  flex: none;
  color: var(--ft-text-muted);
  font-size: 18px !important;
  transition: transform var(--ft-duration-fast) var(--ft-ease);
}

.ft-store-switcher.is-open .ft-store-switcher__chevron { transform: rotate(180deg); }

.ft-store-switcher--block { display: flex; width: 100%; max-width: none; height: var(--ft-control-md); }
.ft-store-switcher--block .ft-store-switcher__label { flex: 1; text-align: start; }

/* Search (a button styled as a field; opens the search dialog) */
.ft-search {
  display: inline-flex;
  align-items: center;
  gap: var(--ft-space-2);
  width: 320px;
  height: var(--ft-control-md);
  padding: 0 var(--ft-space-2) 0 var(--ft-space-3);
  border: 1px solid var(--ft-border);
  border-radius: var(--ft-radius-md);
  background: var(--ft-surface);
  color: var(--ft-text-subtle);
  font: inherit;
  font-size: var(--ft-text-sm);
  text-align: start;
  cursor: text;
  transition: border-color var(--ft-duration-fast) var(--ft-ease);
}

.ft-search:hover { border-color: var(--ft-border-strong); }
.ft-search:focus-visible { outline: var(--ft-focus-width) solid var(--ft-focus); outline-offset: var(--ft-focus-offset); }
.ft-search__icon { flex: none; font-size: 18px !important; }
.ft-search__placeholder { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ft-search__kbd {
  flex: none;
  padding: 2px 6px;
  border: 1px solid var(--ft-border-strong);
  border-radius: 6px;
  background: var(--ft-surface-2);
  color: var(--ft-text-muted);
  font-family: var(--ft-font-family);
  font-size: 11px;
  font-weight: var(--ft-weight-bold);
}

/* =========================================================================================
   Shell dialogs (store picker, search)
   ========================================================================================= */
.ft-root .ft-dialog .ft-dialog__content { padding: var(--ft-space-6); }

.ft-dialog__header { display: flex; align-items: flex-start; gap: var(--ft-space-2); }
.ft-dialog__header > :first-child { flex: 1; min-width: 0; }
.ft-dialog__close { flex: none; margin-block-start: calc(-1 * var(--ft-space-2)); margin-inline-end: calc(-1 * var(--ft-space-2)); }
.ft-search-dialog .ft-dialog__close { margin-block-start: 0; }

.ft-dialog__title {
  margin: 0 0 var(--ft-space-4);
  font-size: var(--ft-text-xl);
  font-weight: var(--ft-weight-extrabold);
  letter-spacing: var(--ft-tracking-tight);
}

.ft-store-picker__surface,
.ft-search-dialog__surface { display: flex; flex-direction: column; gap: var(--ft-space-3); min-height: 0; }

.ft-store-picker__toolbar { display: flex; align-items: flex-start; gap: var(--ft-space-2); }
.ft-store-picker__search { flex: 1; min-width: 0; }

.ft-store-picker__filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--ft-space-2);
}

.ft-store-picker__results,
.ft-search-dialog__results {
  display: flex;
  flex-direction: column;
  gap: var(--ft-space-3);
  max-height: min(26rem, 60vh);
  overflow-y: auto;
}

.ft-store-picker__results {
  /* Scroll-edge fade, as on the sidebar nav. */
  mask-image: linear-gradient(to bottom, transparent 0, var(--ft-text) var(--ft-space-2),
                              var(--ft-text) calc(100% - var(--ft-space-6)), transparent 100%);
}

.ft-store-picker__group { flex: none; }

.ft-store-picker__heading {
  display: flex;
  align-items: center;
  gap: var(--ft-space-2);
  padding: var(--ft-space-2) var(--ft-space-3);
  color: var(--ft-text-muted);
  font-size: var(--ft-text-xs);
  font-weight: var(--ft-weight-extrabold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: default;
  user-select: none;
}
.ft-store-picker__heading-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ft-store-picker__heading-meta { margin-left: auto; font-weight: var(--ft-weight-medium); text-transform: none; letter-spacing: 0; }

.ft-store-picker__row.is-current { background: var(--ft-accent-soft); }

.ft-store-picker__row.is-focused,
.ft-search-dialog__row.is-focused {
  background: var(--ft-hover);
  box-shadow: inset 3px 0 0 var(--ft-accent);
}

.ft-store-picker__code { color: var(--ft-text-muted); font-family: var(--ft-font-mono); font-size: var(--ft-text-xs); }
.ft-store-picker__check { color: var(--ft-accent-text); }

.ft-search-dialog__meta { margin: 0; color: var(--ft-text-muted); font-size: var(--ft-text-sm); }
.ft-search-dialog__loading { display: flex; justify-content: center; padding: var(--ft-space-10); color: var(--ft-accent); }

/* =========================================================================================
   Error surfaces
   ========================================================================================= */
.ft-error-card { max-width: 640px; margin: var(--ft-space-10) auto; }

.ft-error-card__details {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--ft-space-1) var(--ft-space-4);
  margin: var(--ft-space-4) 0 0;
  padding-top: var(--ft-space-4);
  border-top: 1px solid var(--ft-border);
  font-size: var(--ft-text-sm);
}

.ft-error-card__details dt { color: var(--ft-text-muted); font-weight: var(--ft-weight-bold); }
.ft-error-card__details dd { min-width: 0; margin: 0; }

.ft-error-card__trace {
  max-height: 240px;
  margin: 0;
  overflow: auto;
  font-family: var(--ft-font-mono);
  font-size: var(--ft-text-xs);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ft-error-page { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.ft-error-page__code { margin: 0 0 var(--ft-space-3); color: var(--ft-text-muted); font-size: var(--ft-text-sm); }
.ft-error-page__actions { justify-content: center; }

/* =========================================================================================
   Responsive: off-canvas sidebar below 1024px
   ========================================================================================= */
@media (max-width: 1023.98px) {
  .ft-shell__main { margin-inline-start: 0; }
  .ft-topbar__toggle { display: inline-flex; }
  .ft-sidebar__close { display: inline-flex; }
  .ft-sidebar__store { display: block; margin-top: var(--ft-space-3); }

  .ft-sidebar {
    z-index: 1150;
    box-shadow: var(--ft-elevation-3);
    visibility: hidden;
    transform: translateX(-100%);
    transition: transform var(--ft-duration-slow) var(--ft-ease), visibility 0s linear var(--ft-duration-slow);
  }

  .ft-sidebar:dir(rtl) { transform: translateX(100%); }

  .ft-shell.is-nav-open .ft-sidebar {
    visibility: visible;
    transform: none;
    transition: transform var(--ft-duration-slow) var(--ft-ease), visibility 0s;
  }

  .ft-shell.is-nav-open .ft-shell__scrim {
    position: fixed;
    inset: 0;
    z-index: 1140;
    display: block;
    border: 0;
    background: var(--ft-scrim);
    cursor: pointer;
  }
}

@media (max-width: 767.98px) {
  .ft-topbar__inner { gap: var(--ft-space-2); padding-inline: var(--ft-space-4); }
  .ft-shell__content { padding: var(--ft-space-5) var(--ft-space-4) var(--ft-space-10); }
  .ft-store-switcher { flex: 0 1 auto; height: var(--ft-control-md); }

  .ft-search {
    flex: none;
    justify-content: center;
    width: var(--ft-control-md);
    padding: 0;
    color: var(--ft-text);
    cursor: pointer;
  }

  .ft-search__placeholder,
  .ft-search__kbd {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .ft-search__icon { font-size: 20px !important; }
  .ft-root .ft-dialog .ft-dialog__content { padding: var(--ft-space-4); }

  /* Shell dialog rows: titles wrap, and chips/codes drop under the title instead of squeezing it. */
  .ft-store-picker__row { flex-wrap: wrap; row-gap: var(--ft-space-1); }
  .ft-store-picker__row .ft-list-row__text { flex-basis: calc(100% - 2 * var(--ft-space-10)); }
  .ft-store-picker__row .ft-list-row__title { white-space: normal; overflow-wrap: anywhere; }

  /* Search rows: the type chip sits inline at the end of the title line, so the detail line below gets the full
     width and wraps to two lines; barcodes and label counts show. */
  .ft-search-dialog__row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "leading title trailing" "leading meta meta";
    align-items: center;
    row-gap: 2px;
    min-height: 0;
  }

  .ft-search-dialog__row .ft-list-row__leading { grid-area: leading; }
  .ft-search-dialog__row .ft-list-row__text { display: contents; }
  .ft-search-dialog__row .ft-list-row__title { grid-area: title; white-space: normal; overflow-wrap: anywhere; }
  .ft-search-dialog__row .ft-list-row__trailing { grid-area: trailing; }
  .ft-search-dialog__row .ft-list-row__meta {
    grid-area: meta;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .ft-store-picker__row .ft-list-row__trailing {
    flex-basis: 100%;
    flex-wrap: wrap;
    padding-inline-start: calc(var(--ft-space-10) + var(--ft-space-3));
  }
}

@media (prefers-reduced-motion: reduce) {
  .ft-sidebar,
  .ft-shell.is-nav-open .ft-sidebar { transition: none; }
}

/* ---------- Legal footer (FtLegalFooter): small, muted, never sticky ---------- */
.ft-legal-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--ft-space-1) var(--ft-space-4);
  padding-block: var(--ft-space-4);
  color: var(--ft-text-muted);
  font-size: var(--ft-text-sm);
}

.ft-legal-footer__links { display: flex; flex-wrap: wrap; justify-content: center; margin: 0; padding: 0; list-style: none; }

.ft-legal-footer__link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding-inline: var(--ft-space-2);
  color: var(--ft-text-muted);
  border-radius: 4px;
  text-decoration: underline;
}

.ft-legal-footer__link:hover { color: var(--ft-text); }

.ft-legal-footer__link:focus-visible {
  outline: var(--ft-focus-width) solid var(--ft-focus);
  outline-offset: var(--ft-focus-offset);
}

.ft-shell__content .ft-legal-footer { margin-top: var(--ft-space-10); border-top: 1px solid var(--ft-border); }

/* =========================================================================================
   Phones (< 768px): bottom navigation + More sheet. The drawer and hamburger stay for 768-1023px.
   ========================================================================================= */
.ft-bottomnav,
.ft-sheet,
.ft-sheet__scrim,
.ft-topbar__title { display: none; }

@media (max-width: 767.98px) {
  .ft-shell { --ft-bottomnav-height: 60px; }

  .ft-topbar__toggle,
  .ft-topbar .ft-search,
  .ft-topbar__spacer { display: none; }

  .ft-topbar__title {
    display: block;
    flex: none;
    max-width: 40%;
    overflow: hidden;
    color: var(--ft-text);
    font-size: var(--ft-text-xl);
    font-weight: var(--ft-weight-extrabold);
    letter-spacing: var(--ft-tracking-tight);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ft-topbar .ft-store-switcher { flex: 0 1 auto; margin-inline-start: auto; }
  .ft-topbar .ft-store-switcher__label { flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .ft-shell__content { padding-bottom: calc(var(--ft-bottomnav-height) + env(safe-area-inset-bottom, 0px) + var(--ft-space-6)); }
  .ft-shell__content .ft-legal-footer { display: none; }

  .ft-bottomnav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 1100;
    display: block;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--ft-border);
    background: var(--ft-surface);
  }

  .ft-bottomnav__list { display: flex; margin: 0; padding: 0; list-style: none; }
  .ft-bottomnav__cell { flex: 1 1 0; min-width: 0; }

  .ft-bottomnav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    min-height: var(--ft-bottomnav-height);
    padding: var(--ft-space-1) 0;
    border: 0;
    background: transparent;
    color: var(--ft-text-muted);
    font: inherit;
    font-size: var(--ft-text-xs);
    font-weight: var(--ft-weight-bold);
    text-decoration: none;
    cursor: pointer;
  }

  .ft-bottomnav__item:focus-visible { outline: var(--ft-focus-width) solid var(--ft-focus); outline-offset: -3px; }
  .ft-bottomnav__item.is-active { color: var(--ft-text); }
  .ft-bottomnav__icon { font-size: 22px !important; }
  .ft-bottomnav__item { position: relative; }
  .ft-bottomnav__badge { position: absolute; top: 4px; left: calc(50% + 6px); }
  .ft-bottomnav__item.is-active .ft-bottomnav__icon {
    box-sizing: content-box;
    padding: 2px var(--ft-space-4);
    border-radius: var(--ft-radius-lg);
    background: var(--ft-accent);
    color: var(--ft-accent-ink);
  }

  .ft-sheet__scrim {
    position: fixed;
    inset: 0;
    z-index: 1160;
    display: block;
    border: 0;
    background: var(--ft-scrim);
  }

  .ft-sheet {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 1170;
    display: block;
    max-height: 90dvh;
    overflow-y: auto;
    padding: var(--ft-space-2) var(--ft-space-4) calc(var(--ft-space-4) + env(safe-area-inset-bottom, 0px));
    border: 1px solid var(--ft-border);
    border-bottom: 0;
    border-radius: var(--ft-radius-xl) var(--ft-radius-xl) 0 0;
    background: var(--ft-surface);
    color: var(--ft-text);
    box-shadow: var(--ft-elevation-3);
  }

  .ft-sheet__grip { width: 40px; height: 4px; margin: 0 auto var(--ft-space-2); border-radius: 2px; background: var(--ft-border-strong); }
  .ft-sheet__head { display: flex; align-items: center; justify-content: space-between; }
  .ft-sheet__title { margin: 0; font-size: var(--ft-text-xl); font-weight: var(--ft-weight-extrabold); letter-spacing: var(--ft-tracking-tight); }
  .ft-sheet__body { display: flex; flex-direction: column; gap: var(--ft-space-1); padding-block: var(--ft-space-2); }
  .ft-sheet__form { margin: 0; }

  .ft-sheet__row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: var(--ft-space-3);
    width: 100%;
    min-height: 48px;
    padding: 0 var(--ft-space-3);
    border: 0;
    border-radius: var(--ft-radius-md);
    background: transparent;
    color: var(--ft-text);
    font: inherit;
    font-size: var(--ft-text-md);
    font-weight: var(--ft-weight-bold);
    text-align: start;
    text-decoration: none;
    cursor: pointer;
  }

  .ft-sheet__row:hover,
  .ft-sheet__row.is-active { background: var(--ft-surface-2); }
  .ft-sheet__row:focus-visible { outline: var(--ft-focus-width) solid var(--ft-focus); outline-offset: var(--ft-focus-offset); }
  .ft-sheet__row-icon { color: var(--ft-text-muted); }
  .ft-sheet .ft-store-switcher--block { height: 48px; margin-bottom: var(--ft-space-1); }
  .ft-sheet .ft-legal-footer { margin-top: var(--ft-space-2); padding-top: var(--ft-space-3); border-top: 1px solid var(--ft-border); }
}
