/* The organization selector — corner controls and the popover. Every rule reads an existing
   `--a-*` token (alt-tokens.css), never a literal colour, so both themes resolve for free.
   A new file rather than more rules in alt-shell.css: `.a-team`/`.a-team-mark`/`.a-team-name`
   stay unchanged there (the pre-Organization-layer corner), and everything here is additive —
   the two buttons altOrgCornerUpgrade() turns the corner into, and the popover alt-org-selector.js
   builds — so alt-shell.css stays byte-identical when the Organization layer is not present. */

/* ---------- the two corner controls ----------
   Both are <button>, reset to look like the plain text/icon they replace. `.a-team` already
   supplies the gap between them (alt-shell.css, unchanged). */
.a-team-btn{
  display:flex; align-items:center; gap:8px; min-width:0;
  background:none; border:none; padding:2px 4px; margin:-2px -4px;
  border-radius:var(--a-r-sm); color:inherit; font:inherit; cursor:pointer;
}
.a-team-btn:hover{ background:var(--a-raised); }
.a-team-btn:focus-visible{ outline:2px solid var(--a-ring); outline-offset:1px; }

/* The disclosure control — "one gesture, one meaning" (AD-13): the name opens Organization
   settings, this opens the Organization selector. Sized to the set's own 15px nav glyph so it
   reads as a sibling of the nav icons, not a new kind of control. */
.a-org-switch{
  display:flex; align-items:center; justify-content:center; flex:0 0 auto;
  position:relative; /* containing block for the target-expanding ::after below only */
  width:22px; height:22px; margin-left:-2px;
  background:none; border:none; border-radius:var(--a-r-sm); color:var(--a-dim); cursor:pointer;
}
/* Pointer target 24px, drawing stays 22px (sys_design-system.md line 4094) — the box is
   load-bearing (sized to match the nav glyphs above), so the target grows via a transparent
   `::after` instead. No `pointer-events:none`: being hit-testable is the point. */
.a-org-switch::after{
  content:''; position:absolute; inset:-1px; border-radius:inherit;
}
.a-org-switch:hover{ color:var(--a-text); background:var(--a-raised); }
.a-org-switch:focus-visible{ outline:2px solid var(--a-ring); outline-offset:1px; }
.a-org-switch svg{ width:14px; height:14px; }
/* aria-expanded is the state, not a separate class — popover.js's open/closePopover() already
   keep it current, so nothing here can drift from the real state. */
.a-org-switch[aria-expanded="true"]{ color:var(--a-blue-text); background:var(--a-blue-soft); }

/* ---------- the popover ---------- */

/* Same surface/border/radius/shadow as `.a-menu` (alt-components.css), sized wider for a
   30x28 mark plus two lines of text. `position:fixed` is declared here, not left to JS —
   popover.js's openPopover() only ever writes top/left. */
.a-org-pop{
  position:fixed; z-index:var(--z-dialog, 300); min-width:280px; max-width:min(340px, 92vw);
  padding:6px;
  background:var(--a-float); border:1px solid var(--a-line-strong); border-radius:var(--a-r);
  box-shadow:var(--a-shadow);
}
.a-org-pop-list{ display:flex; flex-direction:column; gap:2px; max-height:60vh; overflow-y:auto; }
.a-org-pop-note{ padding:9px 11px; font-size:13px; color:var(--a-dim); }
.a-org-pop-sep{ height:1px; margin:6px 6px; background:var(--a-line); }

/* One row class whether it names an Organization or is the "Manage organizations" footer, so
   the footer inherits the row's own hover/focus states. */
.a-org-row{
  display:flex; align-items:center; gap:10px; width:100%; padding:8px 9px;
  border-radius:var(--a-r-sm); min-height:44px;
  background:none; border:none; color:var(--a-text); font:inherit; text-align:left;
  cursor:pointer;
}
.a-org-row:hover{ background:var(--a-raised); }
.a-org-row:focus-visible{
  background:var(--a-blue-soft); outline:2px solid var(--a-ring); outline-offset:-2px;
}
/* Colour is never the only signal (design system §18) — the check mark below and
   aria-current="true" both carry the same fact. */
.a-org-row.is-active{ background:var(--a-blue-soft); }

/* Same 30x28 box the team chip always used, object-fit:contain, never distorted — see
   alt-shell.css's own `.a-team-mark` comment for why that box. */
.a-org-row-mark{ display:flex; align-items:center; justify-content:center; flex:0 0 auto;
  width:30px; height:28px; }
.a-org-row-logo{ display:block; width:30px; height:28px; object-fit:contain;
  background:var(--a-raised); border-radius:var(--a-r-sm); }
/* A lettered-circle fallback, only ever here — `.a-team-mark` (alt-shell.css) deliberately has
   none, because a list of rows must be tellable apart while a single identity does not need to
   be. See alt-org-selector.js's altOrgFallbackMark(). */
.a-org-row-fallback{
  display:flex; align-items:center; justify-content:center; width:28px; height:28px;
  border-radius:50%; color:#fff; font:600 13px/1 var(--a-display); flex:0 0 auto;
}

.a-org-row-body{ display:flex; flex-direction:column; gap:1px; min-width:0; flex:1 1 auto; }
.a-org-row-name{
  font-size:14px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.a-org-row-team{
  font-size:12px; color:var(--a-dim); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.a-org-row-check{
  display:flex; align-items:center; justify-content:center; flex:0 0 auto;
  width:18px; height:18px; color:var(--a-blue-text);
}
.a-org-row-check svg{ width:16px; height:16px; }

/* The footer row: same `.a-org-row` shape, gear in the same mark slot every row's image or
   fallback occupies, so the icon column stays aligned. */
.a-org-pop-manage-ico{ color:var(--a-dim); }
.a-org-pop-manage-ico svg{ width:18px; height:18px; }
