/* The app shell (Wave 3, P01): white sidebar and header on a pure white canvas, full-width pages, the profile menu
   with the portal switcher, notifications, the Ctrl K command palette, sign-in, error, focus-flow and editor shells.
   Shared by every portal and the Academy. Components live in ui.css.

   Sidebar states
     expanded (244 px)                    default
     rail (64 px, icons + tooltips)       .app.is-rail — "[" or the panel button toggles it; remembered per browser
                                          (localStorage "daass.rail" mirrored in the cookie daass_rail so the server
                                          renders it without a flash); desktop only (≥ 1001 px)
     sheet (off-canvas, ≤ 1000 px)        body.nav-open — backdrop, focus kept inside, Esc / swipe / backdrop close
   The nav shows a shadow under the head / over the foot while it scrolls (.sidebar.is-scrolled / .has-more). */

:root { --sidebar-w: 244px; --sidebar-rail-w: 64px; --topbar-h: 56px; --gutter: 32px; }

.skip-link { position: fixed; left: 12px; top: 12px; z-index: 600; padding: 8px 12px; border-radius: var(--radius); background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 600; transform: translateY(-200%); opacity: 0; pointer-events: none; }
.skip-link:focus { transform: none; opacity: 1; pointer-events: auto; box-shadow: var(--shadow-lg), var(--focus-ring-strong); }

.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }

/* ------------------------------------------------------------------ sidebar */
.sidebar { position: sticky; top: 0; height: 100vh; height: 100dvh; min-width: 0; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); z-index: 40; }
.sidebar-head { flex: none; position: relative; z-index: 2; display: flex; align-items: center; gap: 4px; height: var(--topbar-h); padding: 0 10px 0 12px; background: var(--surface); transition: box-shadow var(--t-fast) var(--ease); }
.sidebar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; height: 40px; padding: 0 6px; margin-left: -2px; border-radius: 8px; color: var(--text); transition: background var(--t-fast); }
.sidebar-brand:hover { background: var(--hover); }
.sidebar-brand:focus-visible { box-shadow: inset 0 0 0 2px var(--indigo-500); }
.brand-mark { position: relative; width: 28px; height: 28px; border-radius: 7px; background: #1B222B; display: grid; place-items: center; flex: none; overflow: hidden; box-shadow: 0 1px 2px rgba(17, 19, 24, .18), 0 0 0 1px rgba(17, 19, 24, .06); transition: opacity var(--t-fast); }
.brand-mark svg, .brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand-mark .wordmark { width: 22px; color: var(--gold-300); }
.sidebar-brand .brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sidebar-brand .p { display: block; font-size: 14px; font-weight: 600; line-height: 18px; letter-spacing: -.01em; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-brand .t { display: block; font-size: 11.5px; font-weight: 500; line-height: 14px; letter-spacing: .04em; color: var(--text-3); }
.env-badge { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px; background: var(--warning-bg); color: var(--warning); box-shadow: inset 0 0 0 1px rgba(181, 71, 8, .18); font-size: 10.5px; font-weight: 650; letter-spacing: .03em; flex: none; cursor: default; }
.sidebar-collapse { width: 28px; height: 28px; color: var(--text-4); opacity: 0; transition: opacity var(--t-fast), background var(--t-fast), color var(--t-fast); }
.sidebar:hover .sidebar-collapse, .sidebar-collapse:focus-visible, .sidebar-collapse[aria-expanded="false"] { opacity: 1; }
.sidebar-collapse:hover { color: var(--text); }
@media (hover: none) { .sidebar-collapse { opacity: 1; } }
.sidebar-head .sidebar-close { display: none; }

.nav { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 4px 12px 16px; scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color var(--t); }
.nav:hover, .nav:focus-within { scrollbar-color: var(--gray-300) transparent; }
.nav-label { display: flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 8px; margin-top: 12px; font-size: 12px; font-weight: 500; line-height: 16px; color: var(--text-3); white-space: nowrap; }
.nav-label:first-child, .nav-back + .nav-label { margin-top: 4px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 8px; margin: 1px 0; border-radius: 6px; color: var(--gray-600); font-size: 13.5px; font-weight: 500; line-height: 1; white-space: nowrap; text-decoration: none; transition: background var(--t-fast), color var(--t-fast); }
.nav-item > span:not(.count):not(.dot) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 18px; }
.nav-item .icon { width: 16px; height: 16px; color: var(--gray-400); transition: color var(--t-fast); }
.nav-item:hover { background: var(--gray-75); color: var(--text); }
.nav-item:hover .icon { color: var(--gray-600); }
.nav-item:active { background: var(--gray-100); }
.nav-item.active, .nav-item[aria-current="page"] { background: var(--indigo-50); color: var(--indigo-700); font-weight: 600; }
.nav-item.active .icon, .nav-item[aria-current="page"] .icon { color: var(--indigo-600); }
.nav-item:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--indigo-500); border-radius: 6px; }
.nav-item .count { margin-left: auto; min-width: 20px; height: 18px; padding: 0 6px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: 0; border-radius: 999px; background: var(--gray-100); color: var(--text-2); flex: none; transition: background var(--t-fast), color var(--t-fast); }
.nav-item:hover .count { background: var(--gray-150); }
.nav-item .count.is-alert, .nav-item .count.alert { background: var(--primary); color: #fff; }
.nav-item.active .count { background: var(--surface); color: var(--indigo-700); box-shadow: inset 0 0 0 1px var(--indigo-100); }
.nav-item .dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); flex: none; }
.nav-item .ext { margin-left: auto; width: 14px; height: 14px; color: var(--text-4); }
.nav-item.soon { opacity: .5; cursor: default; }
.nav-item.soon:hover { background: none; color: var(--gray-600); }
.nav-back { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; margin: 0 0 4px; border-radius: 6px; font-size: 13px; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.nav-back:hover { background: var(--gray-75); color: var(--text); }
.nav-back .icon { width: 15px; height: 15px; }
.nav-sub { margin: 2px 0 4px 17px; padding-left: 12px; border-left: 1px solid var(--border); }
.nav-sub .nav-item { height: 28px; font-size: 13px; }

.sidebar-foot { flex: none; position: relative; z-index: 6; border-top: 1px solid var(--border); padding: 8px 12px 12px; background: var(--surface); transition: box-shadow var(--t-fast) var(--ease); }
.sidebar.is-scrolled .sidebar-head { box-shadow: 0 1px 0 var(--border-subtle), 0 8px 12px -10px rgba(17, 19, 24, .22); }
.sidebar.has-more .sidebar-foot { box-shadow: 0 -8px 12px -10px rgba(17, 19, 24, .22); }
.me-button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 6px 8px; border-radius: 8px; background: none; border: 0; color: var(--text); text-align: left; transition: background var(--t-fast); }
.me-button:hover, .me-button[aria-expanded="true"] { background: var(--gray-75); }
.me-button:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--indigo-500); }
.me-button .who { min-width: 0; flex: 1; line-height: 1.3; }
.me-button .n { display: block; font-size: 13px; font-weight: 600; }
.me-button .r { display: block; font-size: 12px; color: var(--text-3); }
.me-button > .icon { color: var(--text-4); }
.sidebar-foot .menu { left: 12px; right: 12px; top: auto; bottom: calc(100% - 4px); max-height: min(76vh, 600px); overflow-y: auto; transform-origin: bottom left; }
.sidebar-foot .menu.open { animation-name: menu-in-up; }
.me-menu .menu-item { min-height: 32px; }
.me-menu .menu-who { display: none; align-items: center; gap: 10px; padding: 8px 10px 10px; margin: -4px -4px 4px; border-bottom: 1px solid var(--border); }
.me-menu .menu-who .n { font-size: 13px; font-weight: 600; line-height: 18px; }
.me-menu .menu-who .r { font-size: 12px; color: var(--text-3); line-height: 16px; }
.menu-item.current { color: var(--text); font-weight: 600; }
.menu-item.current .icon { color: var(--indigo-600); }
.menu-item .check-mark { margin-left: auto; color: var(--indigo-600) !important; }
.menu-item .ext { margin-left: auto; color: var(--text-4); }

/* legacy v2 suite switcher (kept for pages that still render it) */
.sidebar-top { padding: 12px 10px 6px; position: relative; }
.suite-button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; border: 0; background: none; text-align: left; color: var(--text); }
.suite-button:hover, .suite-button[aria-expanded="true"] { background: var(--hover); }
.suite-name { display: block; font-weight: 650; font-size: 13.5px; line-height: 1.25; }
.suite-kicker { display: block; font-size: 12px; color: var(--text-3); line-height: 1.3; }
.suite-button .chev { margin-left: auto; color: var(--text-4); }
.sidebar-top .menu { left: 10px; right: 10px; top: calc(100% - 2px); }
.suite-menu .menu-item { align-items: flex-start; padding: 8px 10px; }
.suite-menu .menu-item .mi-icon { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.suite-menu .menu-item .d { display: block; font-size: 12px; color: var(--text-3); }
.suite-menu .menu-item.current { background: var(--indigo-50); }
.suite-menu .menu-item.current .mi-icon { background: var(--indigo-600); color: #fff; }

/* ------------------------------------------------------------------ the rail (desktop only) */
@media (min-width: 1001px) {
  .app.is-rail { --sidebar-w: var(--sidebar-rail-w); }
  .app.is-animating { transition: grid-template-columns var(--t) var(--ease-out); }
  .app.is-rail .sidebar-head { justify-content: center; padding: 0 12px; }
  .app.is-rail .sidebar-brand { flex: none; width: 40px; height: 40px; padding: 0; margin: 0; justify-content: center; }
  .app.is-rail .brand-text, .app.is-rail .env-badge { display: none; }
  .app.is-rail .sidebar-collapse { position: absolute; left: 12px; top: calc((var(--topbar-h) - 40px) / 2); width: 40px; height: 40px; border-radius: 8px; opacity: 0; color: var(--text-2); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
  .app.is-rail .sidebar-head:hover .sidebar-collapse, .app.is-rail .sidebar-collapse:focus-visible { opacity: 1; }
  .app.is-rail .sidebar-head:hover .brand-mark { opacity: 0; }
  .app.is-rail .nav { padding: 4px 12px 16px; }
  .app.is-rail .nav-label { min-height: 0; height: 1px; padding: 0; margin: 12px 8px; font-size: 0; overflow: hidden; background: var(--border-subtle); }
  .app.is-rail .nav-label:first-child { margin-top: 8px; }
  .app.is-rail .nav-item, .app.is-rail .nav-back { width: 40px; height: 36px; padding: 0; gap: 0; justify-content: center; }
  .app.is-rail .nav-item > span:not(.count):not(.dot), .app.is-rail .nav-back > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .app.is-rail .nav-item .count { position: absolute; top: 2px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; box-shadow: 0 0 0 2px var(--surface); }
  .app.is-rail .nav-item.active .count { box-shadow: 0 0 0 2px var(--indigo-50), inset 0 0 0 1px var(--indigo-100); }
  .app.is-rail .nav-item .dot { position: absolute; top: 7px; right: 8px; margin: 0; box-shadow: 0 0 0 2px var(--surface); }
  .app.is-rail .nav-item .ext { display: none; }
  .app.is-rail .nav-sub { margin: 0; padding: 0; border: 0; }
  .app.is-rail .sidebar-foot { padding: 8px 12px 12px; }
  .app.is-rail .me-button { width: 40px; min-height: 40px; padding: 4px; justify-content: center; }
  .app.is-rail .me-button .who, .app.is-rail .me-button > .icon { display: none; }
  .app.is-rail .sidebar-foot .menu { left: 8px; right: auto; width: 272px; }
  .app.is-rail .me-menu .menu-who { display: flex; }
}

/* ------------------------------------------------------------------ header */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 var(--gutter); background: rgba(255, 255, 255, .9); backdrop-filter: saturate(1.8) blur(12px); -webkit-backdrop-filter: saturate(1.8) blur(12px); border-bottom: 1px solid var(--border); }
/* breadcrumbs show parents only (F-3): the page title is the H1 and is never repeated here */
.crumbs { display: flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--text-3); min-width: 0; white-space: nowrap; overflow: hidden; }
.crumbs a, .crumbs span { display: inline-flex; align-items: center; height: 28px; padding: 0 6px; border-radius: 6px; color: var(--text-3); transition: color var(--t-fast), background var(--t-fast); overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.crumbs a { flex-shrink: 1; }
.crumbs a:hover { color: var(--text); background: var(--hover); }
.crumbs > :first-child { color: var(--text-2); font-weight: 550; flex: none; margin-left: -6px; }
.crumbs .icon { color: var(--gray-300); width: 14px; height: 14px; flex: none; padding: 0; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.search-trigger { margin-left: auto; display: flex; align-items: center; gap: 8px; width: 264px; height: 32px; padding: 0 5px 0 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-xs); color: var(--text-3); font-size: 13px; text-align: left; transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast); }
.topbar-actions .search-trigger { margin-left: 0; }
.search-trigger:hover { border-color: var(--border-strong); color: var(--text-2); }
.search-trigger .icon { color: var(--text-4); }
.search-trigger span { flex: 1; }
.search-trigger kbd { height: 20px; }
.icon-button { position: relative; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; border: 0; background: none; color: var(--text-3); flex: none; transition: background var(--t-fast), color var(--t-fast); }
.icon-button:hover, .icon-button[aria-expanded="true"] { background: var(--hover); color: var(--text); }
.icon-button .dot { position: absolute; top: 6px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 2px var(--surface); }
.topbar .menu { right: 0; top: calc(100% + 8px); }
.menu-toggle { display: none; }

/* notifications popover */
.notif-menu { width: 400px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 48px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--border); }
.notif-head h2 { font-size: 14px; font-weight: 600; }
.notif-head .btn-link { font-size: 12.5px; font-weight: 550; }
.notif-list { max-height: min(64vh, 480px); overflow-y: auto; scrollbar-width: thin; }
.notif-item { position: relative; display: flex; gap: 12px; padding: 12px 16px 12px 28px; border-bottom: 1px solid var(--border-subtle); color: var(--text); transition: background var(--t-fast); }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover, .notif-item:focus-visible { background: var(--gray-50); outline: none; box-shadow: none; }
.notif-item.is-unread::before { content: ""; position: absolute; left: 12px; top: 19px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.notif-item .ni-icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--gray-50); border: 1px solid var(--border); color: var(--text-3); }
.notif-item .ni-icon .icon { width: 14px; height: 14px; }
.notif-item .ni-body { min-width: 0; flex: 1; }
.notif-item .ni-title { font-size: 13.5px; font-weight: 500; line-height: 1.4; }
.notif-item.is-unread .ni-title { font-weight: 600; }
.notif-item .ni-text { font-size: 13px; color: var(--text-3); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-item .ni-time { font-size: 12px; color: var(--text-3); white-space: nowrap; flex: none; font-variant-numeric: tabular-nums; }
.notif-empty { padding: 36px 16px 40px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.notif-empty strong { display: block; color: var(--text); font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.notif-empty .empty-mark { margin: 0 auto 12px; }
.notif-skeleton { display: flex; flex-direction: column; gap: 16px; padding: 16px; }
.notif-skeleton > div { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.notif-skeleton .skeleton-circle { width: 28px; height: 28px; }
.notif-skeleton .skeleton-text:first-child { width: 72%; }
.notif-skeleton .skeleton-text:last-child { width: 44%; }
.notif-skeleton > div:nth-child(2) .skeleton-text:first-child { width: 58%; }
.notif-skeleton > div:nth-child(2) .skeleton-text:last-child { width: 62%; }
.notif-foot { display: flex; justify-content: center; padding: 8px; border-top: 1px solid var(--border); }

/* ------------------------------------------------------------------ pages: full width, one gutter */
.page { width: 100%; max-width: none; margin: 0; padding: 24px var(--gutter) 64px; }
.page-narrow { max-width: 880px; }
.page.page-narrow { max-width: calc(880px + var(--gutter) * 2); }
.page-wide, .page.page-wide { max-width: none; }
.page-flush { padding: 0; max-width: none; }
.page.page-flush { padding: 0; }
.page-center { margin-left: auto; margin-right: auto; }
.main:focus { outline: none; }

/* ------------------------------------------------------------------ the sheet (≤ 1000 px) */
@media (max-width: 1000px) {
  :root { --gutter: 20px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 300px; max-width: 86vw; transform: translateX(-100%); visibility: hidden; transition: transform var(--t-slow) var(--ease-out), visibility 0s linear var(--t-slow); box-shadow: var(--shadow-lg); border-right: 0; z-index: 60; }
  body.nav-open .sidebar { transform: none; visibility: visible; transition: transform var(--t-slow) var(--ease-out); }
  body.nav-open { overflow: hidden; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: var(--backdrop, rgba(17, 19, 24, .38)); z-index: 55; animation: fade-in var(--t) var(--ease); }
  .sidebar-collapse { display: none; }
  .sidebar-head .sidebar-close { display: grid; width: 40px; height: 40px; margin-right: -4px; }
  .nav-item, .nav-back { height: 40px; font-size: 14px; }
  .nav-item .icon { width: 18px; height: 18px; }
  .menu-toggle { display: grid; margin-left: -8px; }
  .topbar { padding: 0 12px 0 var(--gutter); gap: 4px; }
  .topbar .icon-button { width: 40px; height: 40px; }
  .topbar .icon-button .dot { top: 9px; right: 10px; }
  .search-trigger { width: 40px; height: 40px; padding: 0; justify-content: center; border-color: transparent; background: none; box-shadow: none; color: var(--text-3); }
  .search-trigger:hover { background: var(--hover); border-color: transparent; }
  .search-trigger span, .search-trigger kbd { display: none; }
  .page { padding: 20px var(--gutter) 48px; }
}
@media (max-width: 640px) { .nav-item, .nav-back { height: 44px; } .me-button { min-height: 48px; } }
@media (max-width: 560px) { :root { --gutter: 16px; } .crumbs > :not(:last-child) { display: none; } .crumbs > :last-child { margin-left: 0; } }

/* ------------------------------------------------------------------ command palette (Ctrl K) */
.cmdk { position: fixed; inset: 0; z-index: 150; display: none; background: var(--backdrop, rgba(17, 19, 24, .38)); padding: 12vh 16px 16px; }
.cmdk.open { display: block; animation: fade-in var(--t-fast) var(--ease); }
.cmdk-panel { width: min(680px, 100%); margin: 0 auto; background: var(--surface); border-radius: 14px; box-shadow: 0 24px 64px -12px rgba(17, 19, 24, .32), 0 0 0 1px rgba(17, 19, 24, .08); overflow: hidden; animation: cmdk-in 160ms var(--ease-out); display: flex; flex-direction: column; max-height: min(76vh, 640px); }
@keyframes cmdk-in { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
.cmdk-input { flex: none; position: relative; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--border); }
.cmdk-input > .icon { color: var(--text-3); width: 18px; height: 18px; }
.cmdk-input input { flex: 1; min-width: 0; height: 56px; border: 0; outline: none; font-size: 15.5px; background: none; color: var(--text); }
.cmdk-input input::placeholder { color: var(--text-4); }
.cmdk-input input:focus-visible { box-shadow: none; outline: none; }
.cmdk-input input::-webkit-search-cancel-button { display: none; }
.cmdk-input .cmdk-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--gray-200); border-top-color: var(--primary); animation: spin .7s linear infinite; opacity: 0; transition: opacity var(--t-fast); }
.cmdk.is-loading .cmdk-spin { opacity: 1; }
.cmdk-scope { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--gray-75); color: var(--text-2); font-size: 12px; font-weight: 550; white-space: nowrap; }
.cmdk-results { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; scroll-padding: 36px 0 8px; scrollbar-width: thin; }
.cmdk-group { padding: 10px 10px 4px; font-size: 12px; font-weight: 500; color: var(--text-3); display: flex; align-items: center; justify-content: space-between; }
.cmdk-group + .cmdk-item { margin-top: 0; }
.cmdk-item { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 6px 10px; border-radius: 8px; color: var(--text); cursor: pointer; scroll-margin: 8px; }
.cmdk-item .cmdk-ci { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--border); color: var(--text-3); flex: none; box-shadow: var(--shadow-xs); }
.cmdk-item .cmdk-ci .icon { width: 15px; height: 15px; }
.cmdk-item .cmdk-ct { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.cmdk-item .cmdk-ct .cmdk-t { font-weight: 500; font-size: 13.5px; line-height: 20px; }
.cmdk-item .cmdk-ct .cmdk-s { font-size: 12.5px; line-height: 17px; color: var(--text-3); }
.cmdk-item .ck { color: var(--text-3); font-size: 12px; flex: none; display: inline-flex; align-items: center; gap: 4px; }
.cmdk-item .ck kbd { height: 20px; min-width: 20px; }
.cmdk-item .cmdk-cg { flex: none; font-size: 12px; color: var(--text-4); opacity: 0; transition: opacity var(--t-fast); display: inline-flex; align-items: center; gap: 4px; }
.cmdk-item.active, .cmdk-item[aria-selected="true"] { background: var(--gray-75); }
.cmdk-item.active .cmdk-ci { color: var(--primary); border-color: var(--indigo-200); background: var(--indigo-25); }
.cmdk-item.active .cmdk-cg { opacity: 1; }
.cmdk-item mark { background: none; color: var(--primary-text); font-weight: 650; padding: 0; }
.cmdk-foot { flex: none; display: flex; align-items: center; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); background: var(--gray-25); }
.cmdk-foot span { display: inline-flex; align-items: center; gap: 4px; }
.cmdk-foot .cmdk-count { margin-left: auto; font-variant-numeric: tabular-nums; }
.cmdk-empty { padding: 40px 24px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.cmdk-empty strong { display: block; color: var(--text); font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.cmdk-sk { display: flex; align-items: center; gap: 12px; padding: 8px 10px; }
.cmdk-sk .skeleton-text { flex: 1; max-width: 60%; }
.cmdk-sk:nth-child(3) .skeleton-text { max-width: 44%; }
.cmdk-sk .sk-ic { width: 28px; height: 28px; border-radius: 7px; flex: none; }
@media (max-width: 640px) {
  .cmdk { padding: 8px; }
  .cmdk-panel { max-height: calc(100dvh - 16px); border-radius: 12px; }
  .cmdk-input input { font-size: 16px; height: 52px; }
  .cmdk-foot { display: none; }
  .cmdk-item { min-height: 48px; }
}

/* ------------------------------------------------------------------ sign in (§4.9): the reading room, one 400 px card */
.auth { position: relative; isolation: isolate; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: 0 16px; background: #0B1F3A url("../img/site/reading-room.webp") center / cover no-repeat; }
.auth::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 37, 64, .78) 0%, rgba(10, 37, 64, .86) 50%, rgba(7, 22, 40, .94) 100%); }
.auth-center { flex: 1; display: grid; place-items: center; padding: 56px 0 32px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 0 0 28px; color: var(--navy-900); border-radius: 6px; }
.auth-brand .wordmark { width: 112px; color: var(--navy-900); }
.auth-brand::after { content: ""; width: 28px; height: 2px; border-radius: 1px; background: var(--gold-600); }
.auth-card { position: relative; width: min(400px, 100%); background: #FFFFFF; border-radius: 16px; padding: 40px 36px 36px; box-shadow: 0 1px 2px rgba(10, 37, 64, .08), 0 2px 6px rgba(4, 14, 28, .12), 0 32px 72px -12px rgba(4, 14, 28, .5); animation: auth-in 360ms var(--ease-out) both; }
@keyframes auth-in { from { opacity: 0; transform: translateY(8px); } }
.auth-card h1 { text-align: center; font-size: 21px; line-height: 28px; font-weight: 650; letter-spacing: -.018em; margin: 0; }
.auth-card > .lede, .auth-card .auth-lede { text-align: center; color: var(--text-3); margin: 8px 0 0; font-size: 14px; line-height: 21px; }
.auth-card .lede strong { color: var(--text); font-weight: 550; word-break: break-word; }
.auth-card > .empty-mark, .auth-card .auth-mark { width: 48px; height: 48px; border-radius: 12px; margin: 0 auto 16px; color: var(--indigo-600); background: var(--indigo-50); border: 1px solid var(--indigo-100); display: grid; place-items: center; }
.auth-card > .empty-mark .icon, .auth-card .auth-mark .icon { width: 22px; height: 22px; }
.auth-card .auth-mark.is-warn { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-border); }
.auth-card h1 + form, .auth-card .lede + form, .auth-card h1 + .callout, .auth-card .lede + .callout, .auth-card .lede + .btn, .auth-card h1 + .btn, .auth-card .lede + .auth-actions { margin-top: 28px; }
.auth-card .callout { margin-top: 20px; font-size: 13.5px; }
.auth-card .callout + form, .auth-card .callout + .btn, .auth-card .callout + .auth-actions { margin-top: 20px; }
.auth-card form { display: grid; gap: 20px; }
.auth-card .field .label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.auth-card .label-row .link { font-size: 13px; font-weight: 500; }
.auth-card .btn-lg { margin-top: 4px; height: 42px; font-size: 14px; }
.auth-card .btn-block.mt-6 { margin-top: 28px; }
.auth-actions { display: flex; flex-direction: column; gap: 10px; }
.auth-card .alt { margin: 24px 0 0; font-size: 13px; color: var(--text-3); text-align: center; display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; }
.auth-card .alt .link { font-weight: 500; }
.auth-card .code-input { font-size: 24px; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.auth-card .check { font-size: 13.5px; color: var(--text-2); }
.auth-card .caps-hint { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--warning); font-weight: 500; }
.auth-card .caps-hint .icon { width: 14px; height: 14px; }
.auth-card .otp { margin: 4px 0 0; }
.auth-sep { display: flex; align-items: center; gap: 12px; margin: 24px 0 0; font-size: 12px; color: var(--text-4); }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-foot { padding: 0 0 28px; font-size: 12.5px; color: rgba(255, 255, 255, .66); display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.auth-foot a { border-radius: 4px; transition: color var(--t-fast); }
.auth-foot a:hover { color: #FFFFFF; }
.auth-foot a:focus-visible { outline: 2px solid rgba(255, 255, 255, .8); outline-offset: 3px; box-shadow: none; }
.auth-resend, .auth-card form.auth-resend { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; font-size: 13px; color: var(--text-3); flex-wrap: wrap; }
.auth-resend .btn { font-size: 13px; }
.auth-resend .btn-link[disabled] { color: var(--text-3); opacity: 1; font-variant-numeric: tabular-nums; }
/* The sign-in card in steps (auth/login.html): it keeps its top edge from step to step (placed where its password
   step sits centred) so the email field never moves; a later step skips the entrance animation and only the field
   that appears fades in. */
.auth-card.is-step { animation: none; }
.auth-card .auth-step-in { animation: auth-field-in 220ms var(--ease-out) both; }
@keyframes auth-field-in { from { opacity: 0; transform: translateY(-4px); } }
.auth-card .label-row .btn-link { font-size: 13px; font-weight: 500; line-height: 18px; border: 0; }
.auth-card h1[tabindex="-1"]:focus { outline: none; box-shadow: none; } /* focused for screen readers, not a control */
@media (min-width: 481px) {
  .auth-steps .auth-center { place-items: start center; padding-top: max(56px, calc(50vh - 250px)); }
}
@media (max-width: 480px) {
  .auth { padding: 0 12px; }
  .auth-center { padding: 32px 0 20px; place-items: start center; }
  .auth-brand { margin-bottom: 24px; }
  .auth-brand .wordmark { width: 92px; }
  .auth-card { padding: 32px 20px 28px; border-radius: 14px; margin-top: 8vh; }
}

/* ------------------------------------------------------------------ errors (inside a portal, and standing alone) */
.error-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.error-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; padding: 0 24px; border-bottom: 1px solid var(--border-subtle); }
.error-page > .wordmark, .error-page .error-brand { width: 96px; color: var(--navy-900); border-radius: 4px; display: block; }
.error-page > .error-brand { margin: 24px; }
.error-who { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; color: var(--text-3); }
.error-who .who { display: flex; flex-direction: column; min-width: 0; text-align: right; line-height: 1.3; }
.error-who .who b { color: var(--text); font-weight: 600; font-size: 13px; }
.error-page .error-main { flex: 1; display: grid; place-items: center; padding: 48px 20px 64px; }
.error-page .error-box, .error-inline { max-width: 480px; text-align: center; margin: 0 auto; }
.error-mark { position: relative; width: 56px; height: 56px; margin: 0 auto 20px; border-radius: 14px; display: grid; place-items: center; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(17, 19, 24, .06), 0 0 0 8px var(--gray-50); }
.error-mark .icon { width: 24px; height: 24px; }
.error-mark.is-danger { color: var(--danger); background: var(--danger-bg); border-color: var(--danger-border); box-shadow: 0 0 0 8px #FFF8F7; }
.error-mark.is-warn { color: var(--warning); background: var(--warning-bg); border-color: var(--warning-border); box-shadow: 0 0 0 8px #FFFDF5; }
.error-page .code, .error-inline .code { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--indigo-50); color: var(--indigo-700); font-size: 12.5px; font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.error-page h1, .error-inline h1 { font-size: 28px; line-height: 36px; margin-top: 14px; letter-spacing: -.024em; font-weight: 650; }
.error-page p, .error-inline p { color: var(--text-3); max-width: 44ch; margin: 8px auto 28px; font-size: 14.5px; line-height: 1.55; }
.error-page .row, .error-inline .row { justify-content: center; flex-wrap: wrap; gap: 8px; }
.error-page .ref, .error-inline .ref { display: inline-flex; align-items: center; gap: 6px; margin-top: 28px; padding: 4px 4px 4px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--gray-25); font-size: 12.5px; color: var(--text-3); }
.error-page .ref code, .error-inline .ref code { background: none; padding: 0; color: var(--text); font-size: 12.5px; }
.error-page .error-account, .error-account { margin: 28px auto 0; font-size: 13px; line-height: 20px; color: var(--text-3); }
.error-account strong { color: var(--text-2); font-weight: 550; }
.error-account a { color: var(--link); font-weight: 500; }
.error-account a:hover { text-decoration: underline; text-underline-offset: 3px; }
.error-page .error-foot { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; padding: 20px 24px 28px; font-size: 12.5px; color: var(--text-3); }
.error-page .error-foot a { border-radius: 4px; }
.error-page .error-foot a:hover { color: var(--text); }
.error-inline { padding: 12vh 0 40px; }
.error-inline .empty-mark { margin: 0 auto 20px; }
@media (max-width: 560px) { .error-top { padding: 0 16px; height: 56px; } .error-who .who { display: none; } .error-page h1, .error-inline h1 { font-size: 24px; line-height: 32px; } .error-inline { padding-top: 8vh; } }

/* signed out elsewhere */
.kicked { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(17, 19, 24, .45); backdrop-filter: blur(4px); padding: 20px; animation: fade-in var(--t) var(--ease); }
.kicked .box { width: min(400px, 100%); background: var(--surface); border-radius: 16px; padding: 32px 28px 28px; text-align: center; box-shadow: var(--shadow-lg); animation: modal-in 220ms var(--ease-out); }
.kicked h2 { font-size: 18px; margin: 16px 0 6px; }
.kicked p { color: var(--text-3); margin: 0 0 24px; }
.kicked .empty-mark { margin: 0 auto; width: 48px; height: 48px; border-radius: 12px; color: var(--indigo-600); background: var(--indigo-50); border-color: var(--indigo-100); }

.wordmark { display: block; line-height: 0; }
.wordmark svg { width: 100%; height: auto; }
.watermark svg { width: 100%; height: auto; }

/* v2.1 aliases kept for other templates */
.sidebar > .sidebar-brand { padding: 16px 16px 12px; height: auto; margin: 0; border-radius: 0; }

/* ------------------------------------------------------------------ account pages (every role) */
.settings { max-width: 880px; }
.settings-section { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px 40px; padding: 32px 0; border-top: 1px solid var(--border); }
.settings-section:first-of-type { border-top: 0; padding-top: 8px; }
.settings-section > .intro h2 { font-size: 14px; font-weight: 600; letter-spacing: -.006em; }
.settings-section > .intro p { margin: 4px 0 0; font-size: 13px; color: var(--text-3); line-height: 1.5; }
.settings-section .body { min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.settings-row .value { font-size: 14px; color: var(--text); }
.settings-row .value .muted { font-size: 13px; }
.settings-actions { display: flex; justify-content: flex-end; gap: 8px; }
.photo-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.photo-row .avatar { box-shadow: inset 0 0 0 1px rgba(17, 19, 24, .06), 0 0 0 4px var(--gray-50); }
.photo-row .avatar.is-uploading { opacity: .5; }
.photo-row .photo-meta { display: flex; flex-direction: column; gap: 8px; }
.pending-email { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: var(--indigo-25); border: 1px solid var(--indigo-100); font-size: 13.5px; color: var(--text-2); flex-wrap: wrap; }
.pending-email .icon { color: var(--indigo-600); }
.pending-email strong { color: var(--text); font-weight: 600; }
.device-list { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.device-list .list-item { padding: 12px 16px; }
.device-list .list-item.is-this { background: var(--gray-25); }
.prefs-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.prefs-table thead th { text-align: left; font-size: 12px; font-weight: 500; color: var(--text-3); padding: 0 0 8px; border-bottom: 1px solid var(--border); }
.prefs-table tbody th { text-align: left; font-weight: 400; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.prefs-table th.ch, .prefs-table td.ch { width: 88px; text-align: center; }
.prefs-table td { padding: 12px 0; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; }
.prefs-table tbody tr:last-child > * { border-bottom: 0; }
.prefs-table .p-label { font-weight: 550; color: var(--text); }
.prefs-table .p-desc { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.prefs-table .switch { vertical-align: middle; }
.prefs-table .locked { font-size: 12px; color: var(--text-3); }
@media (max-width: 900px) { .settings-section { grid-template-columns: 1fr; gap: 16px; padding: 24px 0; } }
@media (max-width: 560px) { .prefs-table th.ch, .prefs-table td.ch { width: 64px; } }

/* ------------------------------------------------------------------ L-8 full-screen editor (layouts/editor.html, F-15) */
.editor { display: grid; grid-template-rows: var(--topbar-h) minmax(0, 1fr); height: 100vh; height: 100dvh; background: var(--surface); }
.editor-top { position: relative; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 0 12px 0 10px; border-bottom: 1px solid var(--border); background: var(--surface); min-width: 0; }
.editor-back { color: var(--text-3); }
.editor-name { min-width: 0; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.006em; }
.editor-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.editor-status:not(:empty)::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--gray-300); flex: none; }
.editor[data-state="saved"] .editor-status::before { background: var(--success-fill); }
.editor[data-state="saving"] .editor-status::before { background: var(--info-fill); animation: pulse-dot 1.2s var(--ease) infinite; }
.editor[data-state="unsaved"] .editor-status::before { background: var(--warning-fill); }
.editor-status.is-error { color: var(--danger); }
.editor-status.is-error::before { background: var(--danger-fill); }
.editor-tools { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.editor-actions { display: flex; align-items: center; gap: 8px; }
.editor-main { display: grid; grid-template-columns: 280px minmax(0, 1fr) 340px; min-height: 0; }
.editor.no-left .editor-main { grid-template-columns: minmax(0, 1fr) 340px; }
.editor.no-right .editor-main { grid-template-columns: 280px minmax(0, 1fr); }
.editor.no-left.no-right .editor-main { grid-template-columns: minmax(0, 1fr); }
.editor-left, .editor-right { min-height: 0; overflow-y: auto; background: var(--surface); scrollbar-width: thin; }
.editor-left { border-right: 1px solid var(--border); }
.editor-right { border-left: 1px solid var(--border); }
.editor-panel-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); font-size: 13.5px; font-weight: 600; }
.editor-panel { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.editor-canvas { min-height: 0; overflow: auto; background: var(--gray-75); padding: 32px; }
.editor-artboard { margin: 0 auto; background: var(--surface); box-shadow: 0 1px 3px rgba(17, 19, 24, .06), 0 8px 24px -8px rgba(17, 19, 24, .08), 0 0 0 1px rgba(17, 19, 24, .05); min-height: 240px; transition: width var(--t) var(--ease); }
.editor-artboard.is-desktop { width: min(1200px, 100%); } .editor-artboard.is-tablet { width: 768px; } .editor-artboard.is-phone { width: 390px; } .editor-artboard.is-email { width: 600px; }
.editor-phone { display: none; }
@media (max-width: 1100px) { .editor-main { grid-template-columns: 240px minmax(0, 1fr) 300px; } }
/* narrower screens: the tools scroll inside the top bar instead of pushing the actions off the edge */
@media (max-width: 1100px) { .editor-top { gap: 8px; } .editor-tools { justify-content: flex-start; overflow-x: auto; scrollbar-width: none; } .editor-tools::-webkit-scrollbar { display: none; } }
@media (max-width: 767px) {
  .editor { grid-template-rows: var(--topbar-h) auto; height: auto; min-height: 100dvh; }
  .editor-main, .editor-tools, .editor-actions, .editor-status { display: none !important; }
  .editor-phone { display: block; padding: 24px 16px; }
}

/* ------------------------------------------------------------------ L-7 focus flow (layouts/focus.html, F-16) */
.focus-layout { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: var(--topbar-h) minmax(0, 1fr) 64px; background: var(--surface); }
.focus-top { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: auto minmax(0, auto) 1fr auto; align-items: center; gap: 16px; padding: 0 24px 0 12px; border-bottom: 1px solid var(--border); background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.6) blur(10px); -webkit-backdrop-filter: saturate(1.6) blur(10px); }
.focus-top::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 2px; width: var(--focus-progress, 0%); background: var(--primary); border-radius: 0 2px 2px 0; transition: width var(--t-slow) var(--ease-out); }
.focus-close { color: var(--text-3); }
.focus-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.006em; }
.focus-steps { display: flex; justify-content: center; min-width: 0; }
.focus-action { display: flex; gap: 8px; justify-content: flex-end; }
.focus-main { padding: 48px 24px 56px; }
.focus-body { max-width: 640px; margin: 0 auto; }
.focus-body.focus-wide, .focus-foot-inner.focus-wide { max-width: 880px; }
.focus-body > h1 { font-size: 22px; line-height: 30px; letter-spacing: -.018em; margin-bottom: 4px; }
.focus-body > .step-intro { font-size: 14px; color: var(--text-3); margin: 0 0 24px; }
.focus-body > h1 + .fields, .focus-body > h1 + form { margin-top: 28px; }
.focus-foot { position: sticky; bottom: 0; z-index: 20; border-top: 1px solid var(--border); background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.6) blur(10px); -webkit-backdrop-filter: saturate(1.6) blur(10px); }
.focus-foot-inner { max-width: 640px; height: 100%; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 24px; box-sizing: content-box; }
@media (max-width: 760px) {
  .focus-top { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 0 12px 0 8px; }
  .focus-title { display: none; }
  .focus-steps { justify-content: flex-start; }
  .focus-main { padding: 24px 16px 32px; }
  .focus-foot-inner { padding: 0 16px; box-sizing: border-box; }
  .focus-foot-inner .btn { height: 40px; }
}

/* ------------------------------------------------------------------ portal switcher (its own button above the profile) */
.portal-switch { margin-bottom: 6px; }
.portal-switch-btn { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast); }
.portal-switch-btn:hover, .portal-switch-btn[aria-expanded="true"] { background: var(--gray-75); border-color: var(--border-strong); }
.portal-switch-btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.portal-switch-btn .ps-icon { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--indigo-50); color: var(--indigo-600); flex: none; }
.portal-switch-btn .ps-text { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.portal-switch-btn .ps-label { font-size: 11px; font-weight: 500; color: var(--text-3); }
.portal-switch-btn .ps-name { font-size: 13px; font-weight: 600; }
.portal-switch-btn .ps-mark { color: var(--text-3); flex: none; }
.portal-switch-menu { bottom: calc(100% + 6px); left: 0; right: 0; min-width: 220px; transform-origin: bottom center; }
.portal-switch-menu.open { animation-name: menu-in-up; }
.portal-switch-menu .menu-item .icon:first-child { color: var(--text-3); }
.portal-switch-menu .menu-item.current { font-weight: 600; }
@media (min-width: 1001px) {
  .app.is-rail .portal-switch-btn { justify-content: center; padding: 6px; border-color: transparent; }
  .app.is-rail .portal-switch-btn .ps-text, .app.is-rail .portal-switch-btn .ps-mark { display: none; }
  .app.is-rail .portal-switch-menu { bottom: 0; left: calc(100% + 8px); right: auto; }
}
