/* shell.css — UI overhaul (shell agent). Loaded after replay.css.
   Owns: sidebar/top-bar, hub tab bars, ⌘K palette, Today (home) extras,
   background-canvas gating, and mobile shell rules. */

/* ---------- Background canvas ---------- */
canvas#net.is-hidden {
  display: none;
}

/* ---------- Sidebar: six entries must fit without scrolling ---------- */
.brand {
  padding-bottom: 16px;
  margin-bottom: 10px;
}
.nav {
  gap: 10px;
}
.nav-item {
  min-height: 34px;
}
.proj-empty {
  padding: 0 12px;
  font-size: 11px;
}
/* Compact switcher: name select + ⋯ project menu on one line. */
.proj-switch-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.proj-switch-row .proj-select {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  text-overflow: ellipsis;
}
.proj-menu {
  display: inline-flex;
  flex: none;
}
.proj-menu .vx-menu-btn {
  height: 100%;
  min-width: 38px;
  padding: 6px 8px;
  justify-content: center;
}
/* The sidebar's backdrop-filter makes it the containing block for fixed
   descendants, so the shared menu's viewport-based inline position lands
   off-screen here. Anchor this one panel to its button instead (the
   button sits near the top, so it always opens downward). */
.proj-menu .vx-menu-panel {
  position: absolute;
  top: calc(100% + 6px) !important;
  right: 0 !important;
  bottom: auto !important;
  left: auto;
}

/* Sidebar footer: small links + account. */
.side-foot-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.side-foot-link {
  font-size: 12px;
  font-weight: 500;
  color: #5a5a5a;
  text-decoration: none;
  padding: 4px 0;
}
.side-foot-link:hover {
  color: #0a0a0a;
  text-decoration: underline;
}
.side-foot-link.active {
  color: #0a0a0a;
  text-decoration: underline;
}
.signout-btn {
  background: none;
  border: 0;
  padding: 4px 0;
  margin-top: 2px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  color: #5a5a5a;
  cursor: pointer;
  text-align: left;
}
.signout-btn:hover {
  color: #0a0a0a;
  text-decoration: underline;
}

/* ---------- Top bar / breadcrumbs ---------- */
/* Sentence case breadcrumbs (Section / Tab); small caps stay for tiny labels. */
.crumbs {
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  font-weight: 500;
  flex: 1;
}
.search-kbd {
  font: inherit;
  font-size: 11px;
  color: #7a7a7a;
  border: 1px solid #e2e2e2;
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 4px;
}
.search-icon-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid #e2e2e2;
  background: #fff;
  color: #0a0a0a;
  cursor: pointer;
  flex: none;
}
.search-icon-btn span {
  display: flex;
}

/* ---------- Hub tab bar ---------- */
.hub,
.hub-tabs-wrap {
  min-width: 0;
  max-width: 100%;
}
.hub-tabs-wrap {
  margin-bottom: 8px;
}
.hub-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid #ececec;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  max-width: 100%;
  scroll-padding-inline: 12px;
}
.hub-tabs::-webkit-scrollbar {
  display: none;
}
/* Fade at the right edge whenever more tabs are off-screen (L5) — never a
   bare mid-word cut. hubs.js toggles .has-fade on scroll/resize and keeps
   the active tab fully inside the visible strip. End padding lets the
   last tab scroll clear of the fade. */
.hub-tabs.has-fade {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
  padding-right: 44px;
}
.hub-tab {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: #5a5a5a;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.hub-tab:hover {
  color: #0a0a0a;
  background: #f5f5f5;
}
.hub-tab[aria-selected='true'] {
  color: #0a0a0a;
  font-weight: 600;
  border-bottom-color: #0a0a0a;
}
.hub-panel {
  min-width: 0;
}

/* ---------- Command palette ---------- */
.palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 15, 15, 0.38);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12vh 16px 16px;
}
.palette {
  width: min(600px, 100%);
  max-height: min(70vh, 640px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e2e2e2;
  box-shadow: 0 18px 50px rgba(15, 15, 15, 0.22);
}
.palette-input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid #ececec;
  padding: 16px;
  font: inherit;
  font-size: 15px;
  outline: none;
}
.palette-results {
  overflow-y: auto;
  padding: 8px;
}
.palette-group {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9a9a9a;
  padding: 10px 10px 4px;
}
.palette-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 10px;
  min-height: 40px;
  cursor: pointer;
  border-radius: 2px;
}
.palette-item.active {
  background: #0a0a0a;
  color: #fff;
}
.palette-label {
  font-size: 13px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.palette-sub {
  font-size: 11px;
  color: #9a9a9a;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.palette-item.active .palette-sub {
  color: #cfcfcf;
}
.palette-empty {
  padding: 16px 10px;
  font-size: 13px;
  color: #7a7a7a;
}
.palette-hint {
  border-top: 1px solid #ececec;
  padding: 9px 16px;
  font-size: 11px;
  color: #9a9a9a;
}

/* ---------- Today (home) ---------- */
.stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 36px;
  padding: 14px 2px;
  border-top: 1px solid #ececec;
  border-bottom: 1px solid #ececec;
  margin-bottom: 20px;
}
.stat {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}
.stat-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a7a7a;
}
.stat-value {
  font-size: 19px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.stat-delta {
  font-size: 11px;
  color: #7a7a7a;
  font-variant-numeric: tabular-nums;
}
.stat-delta.is-good {
  color: #2a6a3a;
}
.stat-delta.is-bad {
  color: #b07a2a;
}
.home-total {
  font-variant-numeric: tabular-nums;
}
.home-item-label {
  overflow-wrap: anywhere;
}
.home-item-when {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.home-item-actions {
  text-align: right;
  white-space: nowrap;
}
.home-next {
  margin-left: 8px;
  padding: 6px 12px;
  font-size: 12px;
  text-decoration: none;
}
.home-empty-note {
  padding: 4px 0 8px;
  line-height: 1.6;
}
.home-more {
  padding: 10px 0 2px;
  font-size: 13px;
}
.home-more a {
  color: #0a0a0a;
  font-weight: 500;
}
.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.checklist-step {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 36px;
}
.checklist-step a {
  color: #0a0a0a;
}
.checklist-step.is-done a {
  color: #7a7a7a;
  text-decoration: line-through;
}
.checklist-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
  border: 1px solid #c8c8c8;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #5a5a5a;
}
.checklist-step.is-done .checklist-mark {
  background: #0a0a0a;
  border-color: #0a0a0a;
  color: #fff;
}

/* ---------- Phones: drawer targets, no sideways scroll ---------- */
@media (max-width: 780px) {
  .menu-btn {
    width: 44px;
    height: 44px;
    padding: 0 12px;
  }
  .search-btn {
    display: none;
  }
  .search-icon-btn {
    display: inline-flex;
    width: 44px;
    height: 44px;
  }
  .nav-item {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 14px;
  }
  .side-foot-link,
  .signout-btn {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .hub-tab {
    min-height: 44px;
    padding: 10px 14px;
  }
  .proj-menu .vx-menu-btn {
    min-width: 44px;
    min-height: 44px;
  }
  .proj-select {
    min-height: 44px;
  }
  .palette-backdrop {
    padding: 10px;
  }
  .palette {
    max-height: calc(100dvh - 20px);
  }
  .palette-item {
    min-height: 44px;
  }
  .home-item-actions {
    white-space: normal;
    text-align: left;
  }
  .home-next {
    margin: 6px 8px 0 0;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .checklist-step {
    min-height: 44px;
  }
  .stat-strip {
    gap: 10px 22px;
  }
  .stat {
    flex-wrap: wrap;
  }
}
