/* r1315: bounded owner for AppShell chrome only. Page layouts, specialized
   tables, authentication, marketing and state semantics remain elsewhere.
   Loaded only by AppShell; the original catalog/drawer controller is reused. */
html body[data-fe-workflow-shell="1"] {
    --fe-legal-dock-reserve: 0px;
    --fe-mobile-dock-reserve: var(--fe-bottom-nav-dock-reserve, 0px);
    --fe-cookie-bottom-offset: calc(var(--fe-mobile-dock-reserve) + 12px);
    background: var(--fe-canvas);
}
body[data-fe-workflow-shell="1"] .fe-shell-backdrop { display: none; }
body[data-fe-workflow-shell="1"] .sidebar {
    font-family: var(--fe-font-ui);
    background: var(--fe-surface);
}
.fe-workflow-primary { display: grid; gap: 4px; margin-bottom: 16px; }
.sidebar .fe-workflow-link {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 44px;
    padding: 10px 12px;
    font: 600 14px/1.4 var(--fe-font-ui);
}
.fe-workflow-link > span:not(.nav-pro-chip) { flex: 1; }
.fe-workflow-disclosure {
    border-top: 1px solid var(--fe-line);
    padding-block: 8px;
    margin: 0;
}
.fe-workflow-disclosure > summary {
    min-height: 44px;
    padding: 12px 8px;
    cursor: pointer;
    color: var(--fe-muted);
    font: 500 12px/1.5 var(--fe-font-ui);
}
.fe-workflow-disclosure > summary:hover { color: var(--fe-ink); }
.fe-workflow-disclosure > summary:focus-visible,
.fe-workflow-primary a:focus-visible {
    outline: 2px solid var(--fe-focus);
    outline-offset: 3px;
}
.fe-workflow-catalog .nav-group { margin-bottom: 8px; }
.sidebar .fe-workflow-owner { min-height: 44px; margin-block: 8px; }
body[data-fe-workflow-shell="1"] .fe-sidebar-pro-wrap { margin: 12px 0; }
body[data-fe-workflow-shell="1"] .mobile-header {
    background: var(--fe-surface) !important;
    border-bottom-color: var(--fe-line) !important;
    box-shadow: none;
}
/* Legal copy stays intact, but stops competing with the mobile navigation.
   This is the sole AppShell footer/dock owner, including narrow screens. */
body[data-fe-workflow-shell="1"] .fe-disclaimer-bar {
    position: relative;
    inset: auto;
    width: auto;
    height: auto;
    max-height: none;
    margin-left: 240px;
    padding: 20px 24px calc(20px + var(--fe-bottom-nav-dock-reserve, 0px));
    color: var(--fe-muted);
    background: var(--fe-canvas);
    font: 400 12px/1.7 var(--fe-font-ui);
    white-space: normal;
    overflow: visible;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
body[data-fe-workflow-shell="1"] .fe-disclaimer-bar a,
body[data-fe-workflow-shell="1"] .fe-disclaimer-bar .fe-cookie-choice-link {
    min-height: 44px;
    color: var(--fe-interaction);
}
body[data-fe-workflow-shell="1"] .fe-bottom-nav {
    background: var(--fe-surface);
    border-color: var(--fe-line);
}
.fe-bottom-nav .fe-icon { width: 19px; height: 19px; }
@media (max-width: 1024px) {
    body[data-fe-workflow-shell="1"] .fe-disclaimer-bar { margin-left: 0; }
}
@media (max-width: 768px) {
    body[data-fe-workflow-shell="1"],
    body[data-fe-workflow-shell="1"]:has(.fe-bottom-nav) {
        --fe-legal-dock-reserve: 0px;
        --fe-mobile-dock-reserve: var(--fe-bottom-nav-dock-reserve, 0px);
    }
    body[data-fe-workflow-shell="1"] .fe-disclaimer-bar {
        padding: 16px max(16px, env(safe-area-inset-right, 0px))
            calc(16px + var(--fe-bottom-nav-dock-reserve, 0px))
            max(16px, env(safe-area-inset-left, 0px));
        text-align: left;
    }
}
body.fe-focus-mode[data-fe-workflow-shell="1"] .fe-disclaimer-bar { margin-left: 0; }

/* ==========================================================================
   r1329 member shell. One header, one grouped drawer, one tab bar / rail,
   one Free|Pro badge, one setup checklist. Tokens are the signup tokens
   (design-tokens.css); new VALUES are scoped to the AppShell and never reach
   served reports (body.fe-generated-report keeps its formatting). Reports
   still share the drawer and tab-bar markup, so drawer rules below are
   written to render sensibly there too.
   ========================================================================== */

/* -- Signup language inside the member shell (auth radii, one type family). */
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) {
    --fe-radius-control: 12px;
    --fe-radius-panel: 16px;
    --t-r-md: 12px;
    --t-r-lg: 16px;
    --font-mono: var(--fe-font-ui);
    --font-display: var(--fe-font-ui);
    --fe-shell-header-h: 56px;
    --fe-shell-rail-w: 84px;
    --fe-shell-drawer-w: 240px;
    --t-seam: linear-gradient(90deg, transparent, rgba(47, 227, 208, .45), transparent);
    --t-seam-strong: linear-gradient(90deg, transparent, rgba(47, 227, 208, .7), transparent);
    font-variant-numeric: tabular-nums;
}
/* The header's bottom edge replaces the content-frame seam above page titles. */
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-content-frame::before { display: none; }
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) :is(.form-group label, .fe-c-panel__kicker, .fe-c-label) {
    font-family: var(--fe-font-ui);
}
/* The display face named literally in fe-terminal.css also becomes Inter in the member shell. */
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) :is(
    .dashboard-event-title, .fight-card .card-title, .fe-thread-card__title, .sentiment-watch-card__title,
    .fe-public-profile-hero h1, .page-header h1, .fe-trust-metric__book, .card-title, .fe-empty-state__title
) {
    font-family: var(--fe-font-ui);
}
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-c-page-header__subtitle {
    font-size: 16px;
    line-height: 1.55;
    color: var(--fe-secondary);
}
/* One button language with register/login: mint fill, accent ink, radius 12, Inter 700. */
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .btn {
    border-radius: var(--fe-radius-control);
    font-family: var(--fe-font-ui);
    font-weight: 700;
    letter-spacing: 0;
}
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .btn.btn-lg {
    min-height: 52px;
    padding: 10px 20px;
    font-size: 17px;
}

/* -- Free | Pro badge (matches the pricing ribbon: pill, 1px line). */
.fe-plan-badge {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 20px;
    padding: 0 8px;
    border: 1px solid var(--fe-line);
    border-radius: 999px;
    background: transparent;
    color: var(--fe-secondary);
    font: 650 12px/1 var(--fe-font-ui);
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}
.fe-plan-badge--pro {
    border-color: rgba(47, 227, 208, .42);
    background: rgba(47, 227, 208, .08);
    color: var(--fe-interaction);
}
[data-theme="light"] .fe-plan-badge--pro { border-color: rgba(0, 110, 104, .38); background: rgba(0, 110, 104, .06); }
.fe-plan-badge__note { font-weight: 500; opacity: .85; }
.fe-plan-badge--lock { min-height: 18px; padding: 0 6px; font-size: 12px; margin-left: auto; }

/* -- Drawer (desktop column, tablet/phone overlay, served-report drawer). */
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar {
    display: flex;
    flex-direction: column;
    width: var(--fe-shell-drawer-w, 240px);
    box-sizing: border-box;
    background: var(--fe-surface);
    border-right: 1px solid var(--fe-line);
    font-family: var(--fe-font-ui);
    overscroll-behavior: contain;
}
/* Served reports keep report-workspace.css's own drawer offset under their header. */
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .sidebar {
    padding: 12px 0 calc(16px + env(safe-area-inset-bottom, 0px));
}
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .sidebar-brand--simple {
    padding: 0 12px 8px;
    margin-bottom: 4px;
    border-bottom: 0;
}
.fe-drawer__groups { display: grid; gap: 4px; padding: 0 0 8px; }
.fe-drawer-group { display: grid; gap: 1px; padding: 8px 0 4px; }
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-drawer-group__label {
    margin: 0;
    padding: 4px 20px 6px;
    color: var(--fe-secondary);
    font: 650 12px/1.4 var(--fe-font-ui);
    letter-spacing: 0;
    text-transform: none;
}
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar :is(.fe-drawer-link, .fe-drawer-more__summary) {
    display: flex !important;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    min-height: 40px;
    margin: 0 8px !important;
    padding: 8px 12px !important;
    border: 0 !important;
    border-radius: var(--fe-radius-control, 12px);
    background: transparent;
    color: var(--fe-secondary);
    font: 500 14px/1.35 var(--fe-font-ui);
    text-decoration: none;
    transform: none !important;
    box-shadow: none;
    cursor: pointer;
}
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar :is(.fe-drawer-link, .fe-drawer-more__summary):hover {
    padding-left: 12px !important;
    background: var(--fe-raised);
    color: var(--fe-ink);
}
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-drawer-link.active {
    background: var(--fe-raised);
    color: var(--fe-ink);
    font-weight: 650;
}
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-drawer-link.active::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 10px;
    bottom: 10px;
    width: 3px;
    height: auto;
    transform: none;
    border-radius: 0 3px 3px 0;
    background: var(--fe-interaction);
    box-shadow: none;
}
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar :is(.fe-drawer-link, .fe-drawer-more__summary) .fe-icon {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0 !important;
    color: currentColor;
    opacity: .85;
}
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-drawer-link.active .fe-icon { color: var(--fe-interaction); opacity: 1; }
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-drawer-link::after { content: none !important; display: none !important; }
.fe-drawer-link__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* r1330 (decision A): the drawer's Current card keeps its label whole and truncates the event name. */
.fe-drawer-link--card .fe-drawer-link__label { flex: 0 0 auto; }
.fe-drawer-link__meta { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fe-muted); font: 500 12px/1.3 var(--fe-font-ui); }
.fe-drawer-count {
    flex: 0 0 auto;
    min-width: 20px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--fe-interaction);
    color: var(--fe-on-interaction);
    font: 700 11px/1.4 var(--fe-font-ui);
    text-align: center;
}
.fe-drawer-count--attention { background: var(--fe-pending); color: #1e1606; }
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-drawer-more > summary { list-style: none; }
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-drawer-more > summary::-webkit-details-marker { display: none; }
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-drawer-more__summary { color: var(--fe-muted); font-size: 13px; }
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-drawer-more__summary::after {
    content: "";
    width: 8px;
    height: 8px;
    margin-left: auto;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    transition: transform .15s ease;
}
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-drawer-more[open] > .fe-drawer-more__summary::after { transform: rotate(45deg); }
.fe-drawer-more__count { color: var(--fe-muted); font: 500 12px/1 var(--fe-font-ui); }
.fe-drawer-more[open] { padding-bottom: 4px; }
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-drawer-more .fe-drawer-link { padding-left: 40px !important; }
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-drawer-more .fe-drawer-link:hover { padding-left: 40px !important; }
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-drawer-more .fe-drawer-link .fe-icon { display: none; }
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-drawer-help .fe-drawer-link { padding-left: 40px !important; }
.fe-drawer-shortcuts { margin: 4px 8px 0; border-top: 1px solid var(--fe-line); }
.fe-drawer-link--upgrade { color: var(--fe-interaction) !important; }

/* Account footer: the account links (r1331: the identity row and Sign Out sit at the top). */
.fe-drawer-account {
    display: grid;
    gap: 1px;
    margin-top: auto;
    padding: 12px 0 4px;
    border-top: 1px solid var(--fe-line);
}
html[data-theme] body[data-fe-workflow-shell="1"] .fe-account-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    margin: 0 8px 4px;
    padding: 6px 10px;
    box-sizing: border-box;
    border-radius: var(--fe-radius-control, 12px);
    color: var(--fe-ink);
    text-decoration: none;
}
html[data-theme] body[data-fe-workflow-shell="1"] .fe-account-identity:hover { background: var(--fe-raised); }
.fe-account-identity__avatar { display: flex; flex: 0 0 32px; }
.fe-account-identity .fe-identity-avatar { --identity-size: 32px; background: var(--fe-sunken); border-color: var(--fe-line); box-shadow: none; text-shadow: none; }
.fe-account-identity .fe-identity-avatar::before,
.fe-account-identity .fe-identity-avatar::after { display: none; }
.fe-account-identity__copy { display: grid; gap: 1px; flex: 1 1 auto; min-width: 0; }
.fe-account-identity__name { color: var(--fe-ink); font: 650 14px/1.3 var(--fe-font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-account-identity__handle { color: var(--fe-muted); font: 400 12px/1.4 var(--fe-font-ui); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* r1331 (owner decision Oct-5): the v7 placement. The identity row and the one quiet
   Sign Out sit directly under the logo, above a hairline that separates them from the
   nav groups. Sign Out is a quiet text control indented under the name, with a 44px
   target at every pointer and width. Shared with served reports. */
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-drawer-account-top {
    display: grid;
    gap: 0;
    margin: 0 0 4px;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--fe-line);
}
html[data-theme] body[data-fe-workflow-shell="1"] .fe-drawer-account-top .fe-account-identity { margin: 0 8px; }
html[data-theme] body[data-fe-workflow-shell="1"] .fe-drawer-account-top .fe-identity-avatar { width: 32px; height: 32px; flex: 0 0 32px; }
html[data-theme] body[data-fe-workflow-shell="1"] .fe-drawer-account-top .fe-sidebar-signout { display: flex; margin: 0 8px 0 52px; }
html[data-theme] body[data-fe-workflow-shell="1"] .fe-drawer-account-top .fe-sidebar-signout__button {
    display: inline-flex;
    align-items: center;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 0 8px;
    border: 0;
    border-radius: var(--fe-radius-control, 12px);
    background: transparent;
    box-shadow: none;
    color: var(--fe-secondary);
    font: 500 13px/1.35 var(--fe-font-ui);
    text-align: left;
    cursor: pointer;
}
html[data-theme] body[data-fe-workflow-shell="1"] .fe-drawer-account-top .fe-sidebar-signout__button:hover { background: var(--fe-raised); color: var(--fe-ink); }
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-sidebar-theme-wrap { padding: 8px 20px 0; }
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar :is(a, button, summary):focus-visible { outline: 2px solid var(--fe-focus); outline-offset: -2px; }
@media (pointer: coarse) {
    html[data-theme] body[data-fe-workflow-shell="1"] .sidebar :is(.fe-drawer-link, .fe-drawer-more__summary) { min-height: 44px; }
}

/* -- Header: one bar at every width (AppShell only). */
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .mobile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    box-sizing: border-box;
    height: calc(var(--fe-shell-header-h) + env(safe-area-inset-top, 0px));
    min-height: 0;
    padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
    background: var(--fe-surface) !important;
    border-bottom: 1px solid var(--fe-line) !important;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-app-header__brand {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 6px 4px;
    margin-left: -4px;
}
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-app-header__brand .fe-logo { width: 121px; height: 20px; }
.fe-app-header__context {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
}
.fe-app-header__section {
    flex: 0 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--fe-ink);
    font: 650 15px/1.2 var(--fe-font-ui);
    white-space: nowrap;
}
.fe-app-header__event {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 32px;
    padding: 4px 10px;
    border: 1px solid var(--fe-line);
    border-radius: 999px;
    color: var(--fe-secondary);
    font: 500 13px/1.2 var(--fe-font-ui);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
a.fe-app-header__event:hover { border-color: var(--fe-control-line); color: var(--fe-ink); }
.fe-app-header__event-date { color: var(--fe-muted); }
.fe-app-header__actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .mobile-header .fe-clock-chip {
    display: none;
    position: static;
    inset: auto;
    z-index: auto;
    transform: none;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
    box-sizing: border-box;
    border: 1px solid var(--fe-line);
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    color: var(--fe-secondary);
    font: 500 12px/1 var(--fe-font-ui);
    letter-spacing: normal;
}
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .mobile-header .fe-clock-chip__dot { animation: none; box-shadow: none; background: var(--fe-interaction); }
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .mobile-header .fe-clock-chip__window { color: var(--fe-muted); font: inherit; }
.fe-app-header__search {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 44px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--fe-control-line);
    border-radius: var(--fe-radius-control, 12px);
    background: var(--fe-sunken);
    color: var(--fe-secondary);
    font: 500 14px/1 var(--fe-font-ui);
    cursor: pointer;
}
.fe-app-header__search:hover { color: var(--fe-ink); border-color: var(--fe-secondary); }
.fe-app-header__search .fe-icon { width: 17px; height: 17px; flex: 0 0 17px; }
.fe-app-header__kbd {
    padding: 2px 6px;
    border: 1px solid var(--fe-line);
    border-radius: 6px;
    color: var(--fe-muted);
    font: 600 12px/1.2 var(--fe-font-ui);
}
.fe-app-header__upgrade,
.fe-app-header__start {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--fe-interaction);
    border-radius: var(--fe-radius-control, 12px);
    background: var(--fe-interaction);
    color: var(--fe-on-interaction) !important;
    font: 700 14px/1 var(--fe-font-ui);
    text-decoration: none;
    white-space: nowrap;
}
.fe-app-header__upgrade:hover,
.fe-app-header__start:hover { filter: brightness(.94); }
.fe-app-header__signin {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 6px;
    color: var(--fe-ink);
    font: 600 14px/1 var(--fe-font-ui);
    text-decoration: none;
}
.fe-app-header__account {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 4px 6px;
    border-radius: var(--fe-radius-control, 12px);
    color: var(--fe-ink);
    text-decoration: none;
}
.fe-app-header__account:hover { background: var(--fe-raised); }
.fe-app-header__account .fe-identity-avatar { --identity-size: 32px; background: var(--fe-sunken); border-color: var(--fe-line); box-shadow: none; text-shadow: none; }
.fe-app-header__account .fe-identity-avatar::before,
.fe-app-header__account .fe-identity-avatar::after { display: none; }
.fe-app-header__dot {
    position: absolute;
    top: 6px;
    left: 30px;
    width: 8px;
    height: 8px;
    border: 2px solid var(--fe-surface);
    border-radius: 50%;
    background: var(--fe-interaction);
}
body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .mobile-header :is(a, button):focus-visible { outline: 2px solid var(--fe-focus); outline-offset: 2px; }
/* The drawer toggle stays in the DOM (drawer controller + More contract) but
   the tab bar / rail own "More" wherever the drawer is off-canvas. */
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .mobile-header .hamburger { display: none; }

/* Content clears the header; the desktop drawer keeps its column. */
@media (min-width: 1025px) {
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .mobile-header {
        left: var(--fe-shell-drawer-w);
        padding-left: 28px;
        padding-right: 28px;
    }
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-app-header__brand { display: none; }
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .main-content { padding-top: calc(var(--fe-shell-header-h) + 28px); }
    html[data-theme] body.fe-focus-mode[data-fe-workflow-shell="1"]:not(.fe-generated-report) .mobile-header { left: 0; }
}
@media (min-width: 1280px) {
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .mobile-header .fe-clock-chip { display: inline-flex; }
}
@media (max-width: 1024px) {
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .main-content {
        padding-top: calc(var(--fe-shell-header-h) + 24px + env(safe-area-inset-top, 0px)) !important;
    }
    /* The drawer opens below the header instead of under it. */
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .sidebar {
        top: calc(var(--fe-shell-header-h) + env(safe-area-inset-top, 0px));
        padding-top: 12px;
    }
}
@media (max-width: 768px) {
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .mobile-header { gap: 8px; }
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-app-header__brand { width: 30px; overflow: hidden; }
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-app-header__brand .fe-logo { width: 145px; height: 24px; }
    .fe-app-header__search-label,
    .fe-app-header__kbd,
    .fe-app-header__event-date,
    .fe-setup-chip__label { display: none; }
    /* Plan stays announced (role=img "Pro member") while the avatar carries the space. */
    .fe-app-header__plan { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
    .fe-app-header__search { padding: 0; justify-content: center; width: 44px; min-height: 44px; border-color: transparent; background: transparent; }
    .fe-app-header__upgrade,
    .fe-app-header__start { min-height: 34px; padding: 0 12px; font-size: 13px; }
    .fe-app-header__event { display: none; }
}

/* -- Tab bar (phones) / rail (tablets) / hidden on desktop. */
html[data-theme] body[data-fe-workflow-shell="1"] .fe-bottom-nav.fe-tabbar { display: none; }
@media (max-width: 768px) {
    html[data-theme] body[data-fe-workflow-shell="1"] .fe-bottom-nav.fe-tabbar {
        display: flex;
        align-items: stretch;
        box-sizing: border-box;
        min-height: var(--fe-bottom-nav-dock-reserve, calc(56px + env(safe-area-inset-bottom, 0px)));
        padding: 2px max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px));
        background: var(--fe-surface);
        border-top: 1px solid var(--fe-line);
    }
    html[data-theme] body[data-fe-workflow-shell="1"] .fe-bottom-nav.fe-tabbar .fe-bottom-nav__item--rail { display: none; }
}
html[data-theme] body[data-fe-workflow-shell="1"] .fe-tabbar .fe-bottom-nav__item {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px;
    border: 0;
    background: none;
    color: var(--fe-muted);
    font: 600 12px/1.1 var(--fe-font-ui);
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
html[data-theme] body[data-fe-workflow-shell="1"] .fe-tabbar .fe-bottom-nav__item .fe-icon { width: 21px; height: 21px; }
html[data-theme] body[data-fe-workflow-shell="1"] .fe-tabbar .fe-bottom-nav__item.is-active { color: var(--fe-ink); }
html[data-theme] body[data-fe-workflow-shell="1"] .fe-tabbar .fe-bottom-nav__item.is-active .fe-icon { color: var(--fe-interaction); }
html[data-theme] body[data-fe-workflow-shell="1"] .fe-tabbar .fe-bottom-nav__item.is-active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 30%;
    right: 30%;
    height: 2px;
    border-radius: 0 0 2px 2px;
    background: var(--fe-interaction);
}
html[data-theme] body[data-fe-workflow-shell="1"] .fe-tabbar .fe-bottom-nav__item:focus-visible { outline: 2px solid var(--fe-focus); outline-offset: -4px; border-radius: 12px; }
.fe-bottom-nav__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 768px) {
    html[data-theme] body[data-fe-workflow-shell="1"] .fe-tabbar .fe-bottom-nav__more.is-section-phone { color: var(--fe-ink); }
}
@media (min-width: 769px) and (max-width: 1024px) {
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-bottom-nav.fe-tabbar {
        display: flex;
        flex-direction: column;
        gap: 4px;
        position: fixed;
        top: calc(var(--fe-shell-header-h) + env(safe-area-inset-top, 0px));
        left: 0;
        bottom: 0;
        z-index: 120;
        width: calc(var(--fe-shell-rail-w) + env(safe-area-inset-left, 0px));
        box-sizing: border-box;
        padding: 10px 6px calc(10px + env(safe-area-inset-bottom, 0px)) calc(6px + env(safe-area-inset-left, 0px));
        overflow-y: auto;
        background: var(--fe-surface);
        border-right: 1px solid var(--fe-line);
    }
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-tabbar .fe-bottom-nav__item {
        flex: 0 0 auto;
        min-height: 60px;
        border-radius: var(--fe-radius-control, 12px);
    }
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-tabbar .fe-bottom-nav__item:hover { background: var(--fe-raised); color: var(--fe-ink); }
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-tabbar .fe-bottom-nav__item.is-active { background: var(--fe-raised); }
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-tabbar .fe-bottom-nav__item.is-active::before { top: 14px; bottom: 14px; left: 0; right: auto; width: 3px; height: auto; border-radius: 0 2px 2px 0; }
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-tabbar .fe-bottom-nav__more { margin-top: auto; }
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-tabbar .fe-bottom-nav__more.is-section-rail { color: var(--fe-ink); }
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .main-content {
        margin-left: calc(var(--fe-shell-rail-w) + env(safe-area-inset-left, 0px)) !important;
        width: auto !important;
    }
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-disclaimer-bar {
        margin-left: calc(var(--fe-shell-rail-w) + env(safe-area-inset-left, 0px));
    }
    html[data-theme] body.fe-nav-open[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-bottom-nav.fe-tabbar { visibility: hidden; }
}

/* -- Phones: "More" presents the same #sidebar drawer as a bottom sheet. */
@media (max-width: 768px) {
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .sidebar {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-height: min(86dvh, calc(100dvh - var(--fe-shell-header-h) - env(safe-area-inset-top, 0px) - 12px));
        padding: 8px 0 calc(16px + env(safe-area-inset-bottom, 0px));
        border-right: 0;
        border-top: 1px solid var(--fe-line);
        border-radius: 16px 16px 0 0;
        transform: translateY(105%);
        box-shadow: var(--fe-shadow-overlay);
        overflow-y: auto;
    }
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .sidebar.open { transform: translateY(0); }
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .sidebar::before {
        content: "";
        display: block;
        flex: 0 0 auto;
        width: 40px;
        height: 4px;
        margin: 2px auto 10px;
        border-radius: 999px;
        background: var(--fe-line);
    }
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .sidebar .sidebar-brand--simple { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    html[data-theme] body[data-fe-workflow-shell="1"] .sidebar { transition: none !important; }
}
html[data-motion="reduce"] body[data-fe-workflow-shell="1"] .sidebar { transition: none !important; }

/* -- Setup checklist (Home) and chip (header): the signup step language. */
html[data-theme] body[data-fe-workflow-shell="1"] .fe-setup {
    display: grid;
    gap: 16px;
    margin: 0 0 24px;
    padding: 20px 22px;
    border: 1px solid var(--fe-line);
    border-radius: var(--fe-radius-panel, 16px);
    background: var(--fe-surface);
    color: var(--fe-ink);
    font-family: var(--fe-font-ui);
}
.fe-setup__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.fe-setup__heading { display: grid; gap: 6px; min-width: 0; }
.fe-setup .fn-steps { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; list-style: none; color: var(--fe-muted); font: 600 13px/1.4 var(--fe-font-ui); }
.fe-setup .fn-steps li { display: inline-flex; align-items: center; }
.fe-setup .fn-steps li + li::before { content: "\00B7"; margin: 0 8px; color: var(--fe-line); }
.fe-setup .fn-steps .is-done { color: var(--fe-ink); }
.fe-setup .fn-steps .is-done span:first-child::before { content: "\2713\00A0"; color: var(--fe-interaction); }
.fe-setup .fn-steps [aria-current="step"] { color: var(--fe-interaction); }
.fe-setup__title { margin: 0; color: var(--fe-ink); font: 750 22px/1.25 var(--fe-font-ui); letter-spacing: -.01em; }
.fe-setup__lede { margin: 0; color: var(--fe-secondary); font: 400 15px/1.5 var(--fe-font-ui); max-width: 60ch; }
.fe-setup__dismiss {
    flex: 0 0 auto;
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--fe-radius-control, 12px);
    background: transparent;
    color: var(--fe-secondary);
    font: 600 14px/1 var(--fe-font-ui);
    cursor: pointer;
}
.fe-setup__dismiss:hover { background: var(--fe-raised); color: var(--fe-ink); }
.fe-setup__steps { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.fe-setup__step { display: flex; gap: 12px; align-items: flex-start; }
.fe-setup__num {
    display: grid;
    place-items: center;
    flex: 0 0 24px;
    height: 24px;
    border: 1px solid var(--fe-line);
    border-radius: 50%;
    color: var(--fe-ink);
    font: 700 12px/1 var(--fe-font-ui);
}
.fe-setup__copy { display: grid; gap: 2px; min-width: 0; }
.fe-setup__link { color: var(--fe-ink); font: 650 15px/1.45 var(--fe-font-ui); text-decoration: underline; text-decoration-color: var(--fe-line); text-underline-offset: 4px; }
.fe-setup__link:hover { text-decoration-color: var(--fe-interaction); }
.fe-setup__detail { color: var(--fe-secondary); font: 400 14px/1.5 var(--fe-font-ui); }
.fe-setup__actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
html[data-theme] body[data-fe-workflow-shell="1"] .fe-setup .fe-setup__primary { min-height: 48px; padding: 10px 20px; font-size: 16px; }
.fe-setup :is(a, button):focus-visible { outline: 2px solid var(--fe-focus); outline-offset: 3px; }
@media (min-width: 900px) {
    .fe-setup__steps { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
    .fe-setup__step { padding-right: 8px; }
}
.fe-setup-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 12px 0 8px;
    border: 1px solid rgba(47, 227, 208, .42);
    border-radius: 999px;
    background: rgba(47, 227, 208, .08);
    color: var(--fe-ink);
    font: 600 13px/1 var(--fe-font-ui);
    text-decoration: none;
    white-space: nowrap;
}
.fe-setup-chip:hover { border-color: var(--fe-interaction); }
.fe-setup-chip__ring { width: 12px; height: 12px; border: 2px solid var(--fe-interaction); border-radius: 50%; box-sizing: border-box; }
.fe-setup-chip__count { color: var(--fe-interaction); font-weight: 700; }
@media (max-width: 768px) {
    html[data-theme] body[data-fe-workflow-shell="1"] .fe-setup { padding: 16px; }
    .fe-setup__title { font-size: 20px; }
    .fe-setup-chip { min-height: 36px; padding: 0 10px; }
    html[data-theme] body[data-fe-workflow-shell="1"] .fe-setup .fe-setup__primary { width: 100%; justify-content: center; }
}
@media (max-width: 480px) {
    body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .mobile-header .fe-setup-chip { display: none; }
}

/* -- r1329: one Free|Pro badge and one chip palette inside the member shell. */
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-pro-chip {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 20px !important;
    padding: 0 8px !important;
    border: 1px solid rgba(47, 227, 208, .42) !important;
    border-radius: 999px !important;
    background: rgba(47, 227, 208, .08) !important;
    color: var(--fe-interaction) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    font: 650 12px/1 var(--fe-font-ui) !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    animation: none !important;
}
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-pro-chip::before,
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-pro-chip::after { display: none !important; }
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .chip.chip-teal { background: rgba(47, 227, 208, .08); border-color: rgba(47, 227, 208, .35); color: var(--fe-interaction); }
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .chip.chip-green { background: transparent; border-color: var(--fe-line); color: var(--fe-positive); }
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .chip.chip-red { background: transparent; border-color: var(--fe-line); color: var(--fe-negative); }
html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .chip.chip-yellow { background: transparent; border-color: var(--fe-line); color: var(--fe-pending); }
@media (max-width: 768px) {
    html.fe-keyboard-open body[data-fe-workflow-shell="1"] .fe-bottom-nav.fe-tabbar { display: none; }
}
/* r1329: the Pro lock badge keeps the historical nav-pro-chip marker but the one-badge look. */
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-plan-badge--lock,
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar-quick-link .fe-plan-badge--lock {
    min-height: 18px !important;
    padding: 0 6px !important;
    margin-left: auto !important;
    border: 1px solid rgba(47, 227, 208, .42) !important;
    border-radius: 999px !important;
    background: rgba(47, 227, 208, .08) !important;
    color: var(--fe-interaction) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    font: 650 12px/1 var(--fe-font-ui) !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
}

/* Local r1405 navigation proposal: existing shell, clearer paths and targets. */
.fe-nav-directory { display: none; }
html[data-theme] body[data-fe-workflow-shell="1"] .fe-tabbar .fe-bottom-nav__item {
    color: var(--fe-secondary);
}
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar :is(.nav-link, .sidebar-more__summary, .theme-toggle) {
    min-height: 44px;
    box-sizing: border-box;
}
html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-sidebar-signout__button {
    min-height: 44px;
    min-width: 44px;
}
body[data-fe-workflow-shell="1"] :is(a, button, input, select, textarea, summary) {
    scroll-margin-block: calc(var(--fe-shell-header-h, 56px) + 52px) calc(var(--fe-bottom-nav-dock-reserve, 0px) + 24px);
}
@media (max-width: 1024px) {
    html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-nav-directory {
        display: grid;
        gap: 8px;
        position: sticky;
        top: -8px;
        z-index: 3;
        flex: 0 0 auto;
        padding: 8px 16px 12px;
        background: var(--fe-surface);
        border-bottom: 1px solid var(--fe-line);
        margin-bottom: 12px;
    }
    .fe-nav-directory__heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
    .fe-nav-directory__heading strong { color: var(--fe-ink); font-size: 16px; }
    .fe-nav-directory button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 44px;
        padding: 8px 12px;
        border: 1px solid var(--fe-line);
        border-radius: 8px;
        background: var(--fe-raised);
        color: var(--fe-secondary);
        font: 600 13px/1.25 var(--fe-font-ui);
        cursor: pointer;
    }
    .fe-nav-directory__heading button { border-color: transparent; background: transparent; color: var(--fe-ink); }
    .fe-nav-directory__heading .fe-icon { width: 16px; height: 16px; }
    .fe-nav-directory__jumps { display: flex; flex-wrap: wrap; gap: 6px; }
    .fe-nav-directory button:hover { color: var(--fe-ink); border-color: var(--fe-focus); }
    html[data-theme] body[data-fe-workflow-shell="1"] .sidebar [data-fe-drawer-group] { scroll-margin-top: var(--fe-nav-directory-h, 184px); }
    html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-drawer-group__label { color: var(--fe-secondary); }
    html[data-theme] body[data-fe-workflow-shell="1"] .sidebar .fe-drawer-link { min-height: 48px; }
}
@media (max-width: 768px) {
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .sidebar {
        max-height: min(86svh, calc(100svh - var(--fe-shell-header-h) - env(safe-area-inset-top, 0px) - 12px));
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }
    html[data-theme] body[data-fe-workflow-shell="1"] .main-content :is(input, select, textarea) { font-size: max(16px, 1em); }
}
@media (min-width: 769px) and (max-width: 1024px) and (max-height: 500px) {
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-tabbar .fe-bottom-nav__item {
        min-height: 44px;
        flex-direction: column;
        font-size: 11px;
        gap: 2px;
    }
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) .fe-tabbar .fe-bottom-nav__item .fe-icon { width: 16px; height: 16px; }
}

@media (min-width: 769px) and (max-width: 1024px) {
    html[data-theme] body[data-fe-workflow-shell="1"] .sidebar { width: min(420px, calc(100vw - 84px)); }
}
@media (min-width: 769px) and (max-width: 1024px) and (max-height: 500px) {
    html[data-theme] body[data-fe-workflow-shell="1"]:not(.fe-generated-report) { --fe-shell-rail-w: 100px; }
}
