/* CrossBank navigation refresh: thumb-first on mobile, compact when desktop space is tight. */
:root {
  --nav-width: 252px;
  --nav-rail-width: 84px;
  --nav-surface: rgba(238, 236, 231, .94);
  --nav-border: rgba(20, 42, 37, .11);
}

html {
  min-width: 320px;
  background: var(--paper);
  overscroll-behavior-y: none;
}

body {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

button,
.nav-item,
.quick-nav-item {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.app-shell {
  background: linear-gradient(90deg, #eceae4 0 var(--nav-width), transparent var(--nav-width));
}

.sidebar {
  position: relative;
  z-index: 30;
  flex: 0 0 var(--nav-width);
  width: var(--nav-width);
  min-height: 100vh;
  padding: 25px 16px 20px;
  background: var(--nav-surface);
  border-right: 1px solid var(--nav-border);
  box-shadow: 12px 0 38px rgba(20, 42, 37, .04);
  transition: width .25s ease, flex-basis .25s ease, padding .25s ease, transform .25s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  gap: 8px;
}

.sidebar .brand-lockup {
  min-width: 0;
  padding: 5px 7px;
}

.sidebar .brand-lockup strong::after {
  white-space: nowrap;
}

.sidebar-control,
.mobile-nav-toggle,
.mobile-nav-close {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: #718178;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.sidebar-control .cb-icon,
.mobile-nav-close .cb-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sidebar-control:hover,
.mobile-nav-toggle:hover,
.mobile-nav-close:hover {
  color: var(--forest);
  background: rgba(220, 235, 224, .7);
  border-color: rgba(45, 107, 85, .14);
}

.sidebar-control {
  font-size: 22px;
  line-height: 1;
}

.mobile-nav-close,
.mobile-nav-toggle {
  display: none;
}

.sidebar-label {
  margin: 40px 8px 0;
}

.sidebar nav {
  display: grid;
  gap: 17px;
  margin-top: 19px;
}

.nav-group {
  display: grid;
  gap: 4px;
}

.nav-group-label {
  margin: 0 9px 3px;
  color: #94a198;
  font: 500 9px 'DM Mono', monospace;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  transition: opacity .2s ease, height .2s ease, margin .2s ease;
}

.nav-item {
  text-decoration: none;
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #718078;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -.1px;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.nav-item-icon {
  display: grid;
  place-items: center;
  width: 20px;
  flex: 0 0 20px;
  color: #98a79e;
  text-align: center;
  transition: color .2s ease, transform .2s ease;
}

.nav-item-icon .cb-icon {
  display: block;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.nav-item:hover {
  transform: translateX(2px);
  color: var(--forest);
  background: rgba(220, 235, 224, .48);
  border-color: rgba(45, 107, 85, .12);
}

.nav-item:hover .nav-item-icon {
  color: var(--forest-2);
  transform: scale(1.05);
}

.nav-item.active {
  color: var(--forest);
  background: #dfece1;
  border-color: rgba(45, 107, 85, .18);
  box-shadow: 0 7px 18px rgba(45, 107, 85, .09);
}

.nav-item.active .nav-item-icon {
  color: var(--forest);
}

.sidebar-bottom {
  padding: 0 8px;
}

.sidebar-rule {
  margin-bottom: 20px;
}

.sidebar-collapse-hint {
  display: block;
  margin-top: 5px;
  color: #a0aaa2;
  font-size: 9px;
  line-height: 1.45;
}

.main-content {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
  white-space: nowrap;
}

.topbar-actions > button {
  flex: 0 0 auto;
}

.topbar-actions .topbar-tool {
  color: #718178;
}

.app-refresh {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 253, 249, .76);
  color: #718178;
  font-size: 10px;
  font-weight: 800;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.app-refresh:hover {
  color: var(--forest);
  background: rgba(220, 235, 224, .7);
  border-color: rgba(45, 107, 85, .14);
}

.app-refresh:active {
  transform: scale(.96);
}

.app-refresh:disabled {
  cursor: wait;
  opacity: .72;
}

.app-refresh-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
}

.app-refresh-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.topbar-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.topbar-tool-icon {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  place-items: center;
}

.topbar-tool-icon svg {
  display: block;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-refresh.is-refreshing .app-refresh-icon {
  animation: app-refresh-spin .8s linear infinite;
}

@keyframes app-refresh-spin {
  to { transform: rotate(360deg); }
}

.topbar-heading {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}

.topbar-heading > div {
  min-width: 0;
}

.mobile-nav-toggle {
  position: relative;
  width: auto;
  min-width: 42px;
  padding: 0 9px;
  gap: 8px;
  color: var(--forest);
  background: rgba(255, 253, 249, .82);
  border-color: var(--line);
}

.mobile-nav-toggle span:first-child,
.mobile-nav-toggle span:first-child::before,
.mobile-nav-toggle span:first-child::after {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.mobile-nav-toggle span:first-child {
  position: relative;
}

.mobile-nav-toggle span:first-child::before,
.mobile-nav-toggle span:first-child::after {
  content: '';
  position: absolute;
  left: 0;
}

.mobile-nav-toggle span:first-child::before { top: -5px; }
.mobile-nav-toggle span:first-child::after { top: 5px; }

.mobile-nav-toggle .mobile-nav-menu-icon {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.mobile-nav-toggle span:last-child {
  font-size: 10px;
  font-weight: 800;
}

.nav-scrim {
  display: none;
}

.mobile-quick-nav {
  display: none;
}

/* Desktop compact rail. The labels remain available through hover tooltips and title text. */
.sidebar.is-collapsed {
  flex-basis: var(--nav-rail-width);
  width: var(--nav-rail-width);
  padding-right: 10px;
  padding-left: 10px;
}

.app-shell.sidebar-is-collapsed {
  background: linear-gradient(90deg, #eceae4 0 var(--nav-rail-width), transparent var(--nav-rail-width));
}

.sidebar.is-collapsed .sidebar-header {
  justify-content: center;
  flex-wrap: wrap;
}

.sidebar.is-collapsed .brand-lockup {
  justify-content: center;
  padding: 5px 0;
}

.sidebar.is-collapsed .brand-lockup strong,
.sidebar.is-collapsed .sidebar-label,
.sidebar.is-collapsed .sidebar-bottom,
.sidebar.is-collapsed .nav-group-label {
  display: none;
}

.sidebar.is-collapsed .sidebar-control {
  position: absolute;
  top: 68px;
  right: calc(50% - 14px);
  width: 27px;
  height: 27px;
  font-size: 19px;
}

.sidebar.is-collapsed nav {
  gap: 13px;
  margin-top: 35px;
}

.sidebar.is-collapsed .nav-group {
  gap: 4px;
}

.sidebar.is-collapsed .nav-item {
  position: relative;
  justify-content: center;
  min-height: 48px;
  padding: 10px 6px;
  font-size: 0;
}

.sidebar.is-collapsed .nav-item-icon {
  margin: 0;
}

.sidebar.is-collapsed .nav-item::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 11px);
  top: 50%;
  z-index: 50;
  width: max-content;
  max-width: 180px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 12px 30px rgba(20, 42, 37, .12);
  color: var(--forest);
  font-size: 10px;
  opacity: 0;
  pointer-events: none;
  transform: translate(-5px, -50%);
  transition: opacity .15s ease, transform .15s ease;
}

.sidebar.is-collapsed .nav-item:hover::after,
.sidebar.is-collapsed .nav-item:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

@media (max-width: 1050px) and (min-width: 781px) {
  :root { --nav-width: 230px; }
  .sidebar { padding-right: 12px; padding-left: 12px; }
  .main-content { padding-right: 28px; padding-left: 28px; }
}

@media (max-width: 780px) {
  .app-shell,
  .app-shell.sidebar-is-collapsed {
    display: block;
    min-height: 100vh;
    background: var(--paper);
  }

  .sidebar,
  .sidebar.is-collapsed {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: min(88vw, 340px);
    height: 100dvh;
    min-height: 100dvh;
    padding: max(18px, env(safe-area-inset-top)) 17px max(18px, env(safe-area-inset-bottom));
    overflow-y: auto;
    background: #f1efe9;
    box-shadow: 22px 0 65px rgba(20, 42, 37, .16);
    transform: translateX(-105%);
    transition: transform .28s cubic-bezier(.22, .8, .25, 1);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar.is-collapsed .sidebar-header {
    justify-content: space-between;
  }

  .sidebar.is-collapsed .brand-lockup strong,
  .sidebar.is-collapsed .sidebar-label,
  .sidebar.is-collapsed .sidebar-bottom,
  .sidebar.is-collapsed .nav-group-label {
    display: block;
  }

  .sidebar.is-collapsed .sidebar-control {
    position: static;
    width: 38px;
    height: 38px;
    font-size: 22px;
  }

  .sidebar.is-collapsed nav {
    gap: 17px;
    margin-top: 19px;
  }

  .sidebar.is-collapsed .nav-item {
    justify-content: flex-start;
    min-height: 48px;
    padding: 10px 12px;
    font-size: 12px;
  }

  .sidebar.is-collapsed .nav-item::after {
    display: none;
  }

  .sidebar-label {
    margin-top: 31px;
  }

  .sidebar nav {
    margin-top: 17px;
    padding-bottom: 12px;
  }

  .sidebar-bottom {
    margin-top: auto;
  }

  .sidebar-control {
    display: none;
  }

  .mobile-nav-close {
    display: grid;
  }

  .topbar-heading {
    gap: 9px;
    flex: 1 1 auto;
  }

  .topbar-actions {
    flex: 0 0 auto;
  }

  .mobile-nav-toggle {
    display: grid;
  }

  .mobile-quick-nav {
    position: fixed;
    inset: auto 0 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 64px;
    padding: 6px 10px max(6px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(20, 42, 37, .1);
    background: rgba(249, 247, 242, .92);
    box-shadow: 0 -10px 32px rgba(20, 42, 37, .08);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
    backdrop-filter: blur(18px) saturate(1.15);
  }

  .quick-nav-item {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    min-height: 50px;
    border-radius: 12px;
    color: #87958c;
  }

  .quick-nav-item span {
    min-height: 20px;
    line-height: 20px;
  }

  .quick-nav-item .cb-icon {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .quick-nav-item small {
    font-size: 9px;
    font-weight: 800;
  }

  .quick-nav-item.is-active {
    color: var(--forest);
    background: rgba(220, 235, 224, .78);
  }

  .quick-nav-item:active {
    transform: scale(.96);
  }

  .main-content {
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }

  .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border-radius: 0;
    background: rgba(20, 42, 37, .48);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
  }

  body.nav-open {
    overflow: hidden;
  }

  body.nav-open .nav-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .main-content {
    width: 100%;
    min-height: 100vh;
  }
}

@media (max-width: 560px) {
  .sidebar,
  .sidebar.is-collapsed {
    width: min(91vw, 332px);
  }

  .mobile-nav-toggle {
    min-width: 42px;
    padding-right: 8px;
    padding-left: 8px;
  }

  .mobile-nav-toggle span:last-child {
    display: none;
  }

  .topbar-actions {
    gap: 5px;
  }

  .topbar-actions .topbar-tool,
  .topbar-actions .app-refresh,
  .topbar-actions .current-profile {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
  }

  .topbar-actions .topbar-tool {
    position: relative;
    display: grid;
    place-items: center;
    font-size: 0;
  }

  .topbar-actions .topbar-tool-icon {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    flex: none;
  }

  .topbar-actions .topbar-tool-icon svg {
    transform: none;
  }

  .topbar-actions .topbar-tool-label {
    display: none;
  }

  .topbar-actions .topbar-tool::before,
  .topbar-actions .topbar-tool::after {
    display: none;
  }

  .topbar .eyebrow {
    margin-bottom: 1px;
    line-height: 1;
  }

  .topbar h2 {
    line-height: 1.05;
  }

  .topbar-actions .app-refresh-label,
  .topbar-actions .current-profile span:nth-child(2),
  .topbar-actions .current-profile b {
    display: none;
  }

  .topbar-actions .current-profile {
    justify-content: center;
    gap: 0;
  }
}

@media (display-mode: standalone) {
  .topbar {
    padding-top: max(10px, env(safe-area-inset-top));
  }

  .main-content {
    padding-bottom: calc(90px + env(safe-area-inset-bottom));
  }
}

/* Public trip routes now use the same app sidebar as the dashboard. The
   compact public drawer remains available only for the access-state pages. */
.trip-app-page .public-menu-toggle,
.trip-app-page .public-navigation-panel { display: none; }

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .nav-item,
  .sidebar-control,
  .mobile-nav-toggle,
  .mobile-nav-close,
  .nav-scrim,
  .app-refresh {
    transition: none;
  }

  .app-refresh.is-refreshing .app-refresh-icon {
    animation: none;
  }
}

/* Shared shell language: the navigator is a calm home base, not a list of
   product features. Keep the trust cue, but let the household remain primary. */
:root {
  --nav-width: 268px;
  --nav-rail-width: 76px;
  --nav-surface: #efeee9;
  --nav-border: rgba(20, 42, 37, .12);
  --nav-ink: #18312b;
  --nav-muted: #788981;
  --nav-faint: #9aa9a0;
}

.app-shell,
.app-shell.sidebar-is-collapsed {
  background: linear-gradient(90deg, var(--nav-surface) 0 var(--nav-width), transparent var(--nav-width));
}

.app-shell.sidebar-is-collapsed {
  background: linear-gradient(90deg, var(--nav-surface) 0 var(--nav-rail-width), transparent var(--nav-rail-width));
}

.sidebar {
  width: var(--nav-width);
  flex-basis: var(--nav-width);
  padding: 27px 16px 20px;
  background: var(--nav-surface);
  border-right-color: var(--nav-border);
  box-shadow: 14px 0 38px rgba(20, 42, 37, .045);
}

.sidebar-header {
  min-height: 42px;
  padding: 0 2px;
}

.sidebar .brand-lockup {
  gap: 10px;
  padding: 4px 6px;
}

.sidebar .brand-chip {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 11px;
  box-shadow: 0 7px 17px rgba(20, 42, 37, .14);
}

.sidebar .brand-lockup strong::after {
  font-size: 15px;
  letter-spacing: .1px;
}

.sidebar-control {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border-radius: 12px;
  color: #74857c;
  font-size: 22px;
}

.sidebar-label {
  display: none;
}

.workspace-context {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 64px;
  margin: 27px 2px 0;
  padding: 10px 11px 10px 10px;
  border: 1px solid rgba(45, 107, 85, .12);
  border-radius: 15px;
  background: rgba(255, 253, 249, .48);
}

.workspace-context-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  background: var(--mint);
  color: var(--forest-2);
  font-size: 17px;
}

.workspace-context-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.workspace-context-kicker {
  color: var(--nav-faint);
  font: 500 8px/1 'DM Mono', monospace;
  letter-spacing: .13em;
}

.workspace-context-copy strong {
  overflow: hidden;
  color: var(--nav-ink);
  font-size: 12px;
  letter-spacing: -.1px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-context-copy small {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--nav-muted);
  font-size: 9px;
}

.workspace-context-copy small i {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #78a98b;
  box-shadow: 0 0 0 3px rgba(120, 169, 139, .13);
}

.sidebar nav {
  gap: 21px;
  margin-top: 27px;
}

.nav-group {
  gap: 3px;
}

.nav-group-label {
  margin: 0 10px 6px;
  color: var(--nav-faint);
  font-size: 9px;
  letter-spacing: 1.45px;
}

.nav-item {
  position: relative;
  min-height: 46px;
  padding: 8px 10px;
  gap: 11px;
  border-radius: 13px;
  color: var(--nav-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -.15px;
}

.nav-item span:first-child {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 253, 249, .34);
  color: #94a49b;
  font-size: 16px;
}

.nav-item:hover {
  transform: translateX(1px);
  color: var(--nav-ink);
  background: rgba(220, 235, 224, .5);
  border-color: rgba(45, 107, 85, .12);
}

.nav-item.active {
  color: var(--nav-ink);
  background: #dcebe0;
  border-color: rgba(45, 107, 85, .2);
  box-shadow: 0 8px 20px rgba(45, 107, 85, .09);
}

.nav-item.active::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -1px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--forest-2);
  content: '';
}

.nav-item.active span:first-child {
  background: rgba(255, 253, 249, .62);
  color: var(--forest-2);
}

.sidebar-bottom {
  padding: 0 2px;
}

.sidebar-rule {
  margin-bottom: 17px;
  background: rgba(20, 42, 37, .1);
}

.sidebar-theme-strip {
  margin-bottom: 17px;
  padding-right: 8px;
  padding-left: 8px;
}

.developer {
  margin-bottom: 12px;
  color: var(--nav-ink);
  font-size: 11px;
}

.switch-profile {
  min-height: 38px;
  padding: 8px 0;
  color: var(--nav-muted);
  font-size: 10px;
}

.switch-profile span {
  margin-left: 6px;
  color: var(--peach);
}

.current-profile {
  min-height: 44px;
  padding: 4px 10px 4px 5px;
  gap: 9px;
  border-radius: 999px;
  background: rgba(255, 253, 249, .62);
  box-shadow: 0 4px 12px rgba(20, 42, 37, .025);
}

.current-profile > span:first-child {
  width: 34px;
  height: 34px;
  border-radius: 50%;
}

.current-profile > span:nth-child(2) {
  color: var(--nav-ink);
  font-size: 10px;
}

.current-profile b {
  color: #91a097;
  font-size: 14px;
}

.profile-menu {
  top: calc(100% + 9px);
  width: min(300px, calc(100vw - 30px));
  padding: 10px;
  border-color: rgba(20, 42, 37, .12);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(20, 42, 37, .16);
}

.profile-menu-label {
  margin: 5px 10px 8px;
  color: #91a097;
  font-size: 8px;
  letter-spacing: .12em;
}

.profile-menu button {
  min-height: 48px;
  padding: 10px;
  border-radius: 11px;
}

.profile-menu button:hover,
.profile-menu button:focus-visible {
  background: #eef5ee;
  outline: none;
}

.profile-menu strong {
  color: var(--nav-ink);
  font-size: 11px;
}

.profile-menu small {
  color: var(--nav-muted);
  font-size: 9px;
}

.sidebar.is-collapsed .workspace-context {
  display: none;
}

.sidebar.is-collapsed nav {
  margin-top: 30px;
}

.sidebar.is-collapsed .nav-item span:first-child {
  width: 30px;
  height: 30px;
  flex-basis: 30px;
}

@media (max-width: 780px) {
  .app-shell,
  .app-shell.sidebar-is-collapsed {
    background: var(--paper);
  }

  .sidebar,
  .sidebar.is-collapsed {
    width: min(90vw, 360px);
    padding: max(20px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom));
    background: #f1efe9;
  }

  .sidebar .brand-chip {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .sidebar .brand-lockup strong::after {
    font-size: 16px;
  }

  .workspace-context,
  .sidebar.is-collapsed .workspace-context {
    display: grid;
    margin-top: 25px;
  }

  .sidebar nav,
  .sidebar.is-collapsed nav {
    gap: 20px;
    margin-top: 24px;
  }

  .nav-group-label {
    margin-bottom: 7px;
  }

  .nav-item,
  .sidebar.is-collapsed .nav-item {
    min-height: 49px;
    padding: 9px 11px;
    border-radius: 14px;
    font-size: 13px;
  }

  .nav-item span:first-child,
  .sidebar.is-collapsed .nav-item span:first-child {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    font-size: 17px;
  }

  .sidebar-bottom {
    margin-top: 23px;
  }

  .profile-menu {
    position: fixed;
    top: calc(68px + env(safe-area-inset-top));
    right: 15px;
  }
}

@media (max-width: 560px) {
  .sidebar,
  .sidebar.is-collapsed {
    width: min(92vw, 348px);
  }

  .workspace-context {
    margin-right: 0;
    margin-left: 0;
  }
}

/* Final mobile shell guard: themed desktop stripe must not leak into phones. */
@media (max-width: 780px) {
  html body,
  html[data-theme] body,
  .app-shell,
  .app-shell.sidebar-is-collapsed,
  html[data-theme] .app-shell {
    background: var(--paper) !important;
  }
}
