.sidebar {
  width: var(--sidebar-width);
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  background: var(--sidebar);
  border-inline-end: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow: hidden;
  padding: 32px 18px 16px;
  transition: width var(--dur-slow) var(--ease);
}
.sidebar-head {
  flex: none;
}
/* The brand and the collapse control share one row, so the control no
 * longer floats over the wordmark. Collapsed, the row stacks and the
 * control sits under the mark where it stays reachable. */
.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding-inline: 14px;
  min-height: 40px;
}
.brand-word {
  font-size: 33px;
  font-weight: 750;
  letter-spacing: -1.8px;
  line-height: 1;
}
.brand-mark {
  display: grid;
  grid-template-columns: repeat(3, 4px);
  gap: 3px;
  align-items: end;
  height: 27px;
  color: var(--accent);
  flex: none;
  transform: skewY(-14deg);
}
.brand-mark i {
  display: block;
  background: currentColor;
  border-radius: 2px;
  width: 4px;
  height: 16px;
}
.brand-mark i:nth-child(2) {
  height: 26px;
}
.brand-mark i:nth-child(3) {
  height: 21px;
}
.brand sup {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 1px;
  align-self: start;
  margin-top: 1px;
}
/* Only the destination list scrolls. Coverage, preferences, help and the
 * profile switcher stay pinned at the bottom, because a reader should not
 * have to discover them by scrolling a navigation column. */
.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  margin-top: 43px;
}
.nav-group-title {
  padding: 28px 14px 12px;
}
.nav-item-link {
  min-height: 46px;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--muted);
  text-align: start;
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 550;
  position: relative;
  white-space: nowrap;
}
.nav-item-link:hover {
  background: var(--surface-soft);
  color: var(--ink);
}
.nav-item-link.active {
  background: var(--tint);
  color: var(--accent);
  font-weight: 750;
}
.nav-item-link.active::before {
  content: "";
  position: absolute;
  inset-inline-start: -18px;
  height: 20px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
}
/* A planned destination explains itself instead of navigating, so it is
 * marked in words rather than by being dimmer than a working row. */
.nav-item-link .nav-tail {
  margin-inline-start: auto;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-pill);
  padding: 1px 7px;
}
.nav-item-link.is-planned .icon {
  opacity: 0.6;
}
.nav-label {
  overflow: hidden;
}
/* Naming the icons in the collapsed rail.
 *
 * The sidebar scrolls, and a scroll container clips on both axes once
 * either axis is not visible, so a tip drawn inside the rail would be cut
 * off at its edge. This one is a single fixed-position element on the
 * body that shell.js positions from the hovered row, which is also why it
 * needs no duplicate markup per row. */
.nav-tip {
  position: fixed;
  z-index: 200;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--page);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateX(var(--tip-shift, -4px));
  transition:
    opacity var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.nav-tip.is-visible {
  opacity: 1;
  transform: translateX(0);
}
.nav-tip small {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
  opacity: 0.75;
}
html[dir="rtl"] .nav-tip {
  --tip-shift: 4px;
}
.sidebar-bottom {
  flex: none;
  padding-top: 16px;
  margin-top: 12px;
  border-top: 1px solid var(--border);
}
.workspace-note {
  margin: 24px 10px 8px;
  padding: 16px 12px;
  background: var(--surface-soft);
  border-radius: 10px;
}
.workspace-note .icon {
  color: var(--accent);
  margin-bottom: 10px;
}
.workspace-note p {
  font-size: 11px;
  line-height: 1.7;
  margin-top: 5px;
}
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--border);
  padding: 18px 8px 0;
  width: 100%;
  background: none;
  border-inline: 0;
  border-bottom: 0;
  text-align: start;
}
.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--tint);
  color: var(--accent);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 750;
  flex: none;
}
.profile-copy {
  font-size: 12px;
  line-height: 1.6;
}
.profile-copy strong {
  display: block;
  font-size: 12px;
}
.profile-copy span {
  color: var(--muted);
  font-size: 10px;
}
.workspace {
  margin-inline-start: var(--sidebar-width);
  transition: margin-inline-start var(--dur-slow) var(--ease);
}
#shell-header {
  position: sticky;
  top: 0;
  z-index: 40;
}
.command-bar {
  height: var(--header-height);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 36px;
  background: var(--page);
  position: sticky;
  top: 0;
  z-index: 40;
}
.command-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 0;
  padding: 10px 0;
  color: var(--muted);
  font-size: 12px;
  min-height: 44px;
}
.command-search kbd {
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font: 10px var(--font);
  margin-inline-start: 45px;
}
.command-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.status-line {
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  white-space: nowrap;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
}
.command-divider {
  height: 22px;
  border-inline-start: 1px solid var(--border);
  margin-inline: 4px;
}
.locale-button {
  font-family: var(--font-ar);
  font-size: 14px !important;
}
.main-content {
  padding: 34px 36px 16px;
  max-width: 1672px;
  margin: auto;
  min-height: calc(100vh - var(--header-height));
}
.workspace-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 25px 0 10px;
  font-size: 10px;
  color: var(--muted);
}
.workspace-footer a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.mobile-menu {
  display: none !important;
}
.compact-only {
  display: none;
}
.collapse-control {
  flex: none;
  width: 28px;
  height: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--muted);
  display: grid;
  place-items: center;
  transition:
    color var(--dur-fast) var(--ease),
    border-color var(--dur-fast) var(--ease);
}
.collapse-control:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.collapse-control .icon {
  width: 13px;
  height: 13px;
}
:root[data-sidebar="collapsed"] .sidebar {
  padding-inline: 12px;
}
:root[data-sidebar="collapsed"] .sidebar .brand {
  padding-inline: 13px;
}
:root[data-sidebar="collapsed"] .sidebar .brand-word,
:root[data-sidebar="collapsed"] .sidebar .brand sup,
:root[data-sidebar="collapsed"] .sidebar .nav-label,
:root[data-sidebar="collapsed"] .sidebar .nav-tail,
:root[data-sidebar="collapsed"] .sidebar .nav-group-title,
:root[data-sidebar="collapsed"] .sidebar .workspace-note,
:root[data-sidebar="collapsed"] .sidebar .profile-copy {
  display: none;
}
:root[data-sidebar="collapsed"] .sidebar .nav-item-link {
  justify-content: center;
  padding-inline: 0;
}
/* The active marker hangs off the row by the sidebar's own padding, so it
 * has to follow that padding when the rail narrows. */
:root[data-sidebar="collapsed"] .sidebar .nav-item-link.active::before {
  inset-inline-start: -12px;
}
:root[data-sidebar="collapsed"] .sidebar-head {
  flex-direction: column;
  gap: 14px;
}
/* Without labels a planned row would look like a working one; a dot keeps
 * the distinction in the rail. */
:root[data-sidebar="collapsed"] .sidebar .nav-item-link.is-planned::after {
  content: "";
  position: absolute;
  top: 7px;
  inset-inline-end: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1px solid var(--muted);
}
:root[data-sidebar="collapsed"] .sidebar .sidebar-profile {
  padding-inline: 8px;
}
:root[data-sidebar="collapsed"] .sidebar .nav-group {
  margin-top: 14px;
}
/* The rail has to hold every row without scrolling on a laptop, so it
 * runs a tighter rhythm than the labelled sidebar. 40px keeps a
 * comfortable target while fitting help and the profile above the fold. */
:root[data-sidebar="collapsed"] .sidebar-nav {
  margin-top: 20px;
}
:root[data-sidebar="collapsed"] .sidebar .nav-item-link {
  min-height: 40px;
  margin-bottom: 3px;
}
:root[data-sidebar="collapsed"] .sidebar-bottom {
  padding-top: 16px;
}
/* Groups are only spaced apart in the rail; a hairline makes the grouping
 * survive the loss of the group headings. */
:root[data-sidebar="collapsed"] .sidebar .nav-group + .nav-group {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
:root[data-sidebar="collapsed"] .collapse-control .icon {
  transform: rotate(180deg);
}
@media (min-width: 768px) and (max-width: 1279px) {
  :root {
    --sidebar-width: 76px;
  }
  .sidebar {
    padding-inline: 12px;
  }
  .sidebar .brand {
    padding-inline: 13px;
  }
  .sidebar .brand-word,
  .sidebar .brand sup,
  .sidebar .nav-label,
  .sidebar .nav-tail,
  .sidebar .nav-group-title,
  .sidebar .workspace-note,
  .sidebar .profile-copy {
    display: none;
  }
  .sidebar .nav-item-link {
    justify-content: center;
    padding-inline: 0;
  }
  .sidebar .nav-item-link.active::before {
    inset-inline-start: -12px;
  }
  .sidebar .nav-item-link.is-planned::after {
    content: "";
    position: absolute;
    top: 7px;
    inset-inline-end: 12px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    border: 1px solid var(--muted);
  }
  /* This width pins the rail through --sidebar-width, so the collapse
   * toggle would do nothing here and is hidden rather than offered as a
   * dead control. The hover/focus tip is what makes the icons readable. */
  .sidebar-head {
    flex-direction: column;
    gap: 14px;
  }
  .collapse-control {
    display: none;
  }
  .sidebar .nav-group {
    margin-top: 14px;
  }
  .sidebar-nav {
    margin-top: 20px;
  }
  .sidebar .nav-item-link {
    min-height: 40px;
    margin-bottom: 3px;
  }
  .sidebar-bottom {
    padding-top: 16px;
  }
  .sidebar .nav-group + .nav-group {
    border-top: 1px solid var(--border);
    padding-top: 14px;
  }
  .command-bar {
    padding-inline: 24px;
  }
  .main-content {
    padding-inline: 24px;
  }
  .command-search kbd {
    margin-inline-start: 10px;
  }
  .status-line {
    display: none;
  }
}
/* On a short laptop the promo note pushes coverage, preferences, help and
 * the profile switcher below the fold. The note is the least important
 * thing in the sidebar, so it goes first. */
@media (max-height: 820px) {
  .workspace-note {
    display: none;
  }
  .sidebar-bottom {
    padding-top: 20px;
  }
}

@media (max-width: 767px) {
  :root {
    --header-height: 64px;
  }
  .sidebar {
    display: none;
  }
  .workspace {
    margin-inline-start: 0;
  }
  .command-bar {
    padding-inline: 16px;
    gap: 10px;
  }
  .mobile-menu {
    display: inline-flex !important;
  }
  .command-search {
    padding: 8px;
  }
  .command-search span,
  .command-search kbd,
  .status-line,
  .command-divider {
    display: none;
  }
  .command-actions {
    gap: 3px;
  }
  .command-search {
    margin-inline-end: auto;
  }
  .main-content {
    padding: 24px 16px 12px;
  }
  .workspace-footer {
    flex-direction: column;
    font-size: 11px;
  }
  .drawer-nav .brand {
    margin-bottom: 24px;
  }
  .drawer-nav .nav-group-title {
    padding-top: 20px;
  }
  .drawer-nav .nav-item-link {
    font-size: 15px;
  }
  /* The drawer is the whole sidebar on a phone, so it carries the pinned
   * block too rather than stranding coverage and preferences. */
  .drawer-nav-bottom {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
  }
}
