/* Left navigation drawer — the phone's navigation surface.
 *
 * The topbar spreads navigation across three surfaces: the primary tab strip,
 * the goal-period selector, and the Sidebar panel menu. All three fit a desktop
 * header; on a phone they wrap onto three rows and eat a fifth of the screen.
 * The drawer is those three surfaces as one list behind one button, and
 * mobile.css hides the surfaces it replaces.
 *
 * On a desktop the drawer is not reachable, and that is deliberate: its
 * hamburger would sit next to the my-calendars hamburger — two identical icons,
 * two different panels, one corner. The desktop already shows the tab strip,
 * the goal-period selector and the Views dropdown, so nothing is lost. Only
 * `.mobile-nav-drawer-toggle`'s `display` is breakpoint-dependent; see its rule
 * at the bottom of this file.
 *
 * This file is NOT inside a media query, which is why it is not in mobile.css:
 * everything there lives inside one by contract, and a phone-only stylesheet
 * can express "shown on a phone" but not "closed until asked for". The phone
 * *differences* — hiding the topbar surfaces the drawer replaces, and showing
 * the toggle — stay in mobile.css.
 *
 * Load order: after layout.css/components.css (so the doubled
 * `.nav-icon-button.mobile-nav-drawer-toggle` selector below is not needed to
 * win a tie, though it is kept for clarity) and before mobile.css.
 */

.nav-drawer {
  position: fixed;
  inset: 0;
  /* Above the full-screen panels (.chat-panel sits below 60): the drawer is
     what opens them, so it has to outrank them. */
  z-index: 60;
  display: flex;
}

.nav-drawer.nav-drawer-hidden {
  display: none;
}

.nav-drawer-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.nav-drawer-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  /* Not full-width: the strip of scrim beside it is the affordance that says
     "tap outside to dismiss", which a full-bleed sheet hides. */
  width: min(310px, 86vw);
  max-width: 86vw;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--panel-bg, #1f2020);
  border-right: 1px solid var(--border-subtle);
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
}

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 12px 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.nav-drawer-title {
  font-size: 16px;
  font-weight: 600;
}

.nav-drawer-close {
  background: none;
  border: 0;
  color: inherit;
  font-size: 26px;
  line-height: 1;
  padding: 4px 10px;
  cursor: pointer;
}

.nav-drawer-body {
  display: flex;
  flex-direction: column;
  padding: 6px 0 12px;
}

.nav-drawer-section {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.55;
  margin: 14px 0 4px;
  padding: 0 16px;
}

.nav-drawer-row {
  /* 44px is the touch-target floor, not a visual preference. */
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 0 16px;
  background: none;
  border: 0;
  color: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
}

.nav-drawer-row:hover:not(:disabled) {
  background: rgba(var(--overlay-rgb), 0.08);
}

.nav-drawer-row:disabled {
  opacity: 0.4;
  cursor: default;
}

.nav-drawer-row-active {
  background: var(--accent-soft, rgba(96, 165, 250, 0.16));
  font-weight: 600;
}

/* ── Calendars ─────────────────────────────────────────────────────────────
   The bottom section: account headings and one checkbox row per calendar,
   below every button section. */

.nav-drawer-account {
  font-size: 12px;
  opacity: 0.7;
  padding: 10px 16px 2px;
  overflow-wrap: anywhere;
}

.nav-drawer-calendar-row {
  /* Same 44px touch floor as the button rows. */
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  font-size: 15px;
  cursor: pointer;
}

.nav-drawer-calendar-row:hover {
  background: rgba(var(--overlay-rgb), 0.08);
}

.nav-drawer-calendar-row input {
  flex: 0 0 auto;
  /* Bigger than the browser default, which is well under the touch floor. */
  width: 18px;
  height: 18px;
  margin: 0;
}

.nav-drawer-calendar-row input:disabled {
  cursor: default;
}

.nav-drawer-calendar-dot {
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.nav-drawer-calendar-name {
  /* The long-tail case is a shared calendar named with a full email address. */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-drawer-note {
  margin: 6px 0 0;
  padding: 0 16px;
  font-size: 12px;
  opacity: 0.7;
}

.nav-drawer-row-quiet {
  font-size: 13px;
  opacity: 0.75;
}

/* The hamburger — PHONE ONLY. Hidden here and un-hidden by the one rule in
   mobile.css's media query, which also hides `.my-calendars-toggle` there. That
   pairing is the whole point: exactly one three-line icon in `.topbar-left` at
   any width. On a desktop it is the my-calendars button (it opens the calendar
   list beside the view); on a phone it is this one (my calendars becomes a
   drawer row). Showing this at every width — which it did until 2026-07-29 —
   puts two adjacent identical icons that open different things in the top-left
   corner.

   Layout properties stay unconditional so the phone rule only has to say
   `display`. Doubled selector because `.nav-icon-button` in components.css is
   also a single class — see the matching note in layout.css. */
.nav-icon-button.mobile-nav-drawer-toggle {
  display: none;
  flex: 0 0 auto;
}
