/* ==========================================================================================================
   Places: the Settings list beside every Settings page (src/domains/identity/places.tsx), and the Overview pages
   (overview-ui.tsx). The list shows one level at a time: "Settings for" is a switch between the team, its division
   and its organization; a card names the level (on the team it opens the header's tree of teams, smaller); the find
   box is under it; then that level's sections, and the person's own account last. Rows are small (32px) but never
   cramped: 13px text, a 22px icon tile, 8px side padding. Every color comes from the theme tokens in theme.css. From
   1200px the list stands beside the page; below that it lies flat above it (the switch and the account, the card and
   the find box, the sections as tabs), so the page keeps the width its own layouts were made for, and rows grow to
   40px for fingers.
   ========================================================================================================== */
:root {
  --pl-w: 248px;
  --pl-col: 1120px;
  --pl-org: var(--c-accent);
  --pl-div: var(--c-info);
  --pl-team: var(--c-viz-2);
}
.c-main:has(> .pl-shell) { padding-top: 0; }
.pl-shell { display: flex; align-items: flex-start; min-width: 0; }
.pl-shell .pl-rail, .pl-shell .pl-rail *, .pl-shell .pl-rail *::before, .pl-shell .pl-rail *::after { box-sizing: border-box; }
/* The page's pane beside the list: the page, then the footer (console.tsx). The Layout's own footer is not drawn. */
.c-main:has(> .pl-shell) { padding-bottom: 0; }
.c-col:has(.pl-shell) > .c-foot { display: none; }
.pl-scroll { flex: 1; min-width: 0; display: flex; flex-direction: column; border-left: 1px solid var(--c-line); }
.pl-scroll > .c-foot { flex: none; max-width: calc(var(--pl-col) + 24px); box-sizing: border-box; }
/* One column for every Settings page and its header: it fills the space beside the list, up to --pl-col. */
.pl-main { flex: 1 0 auto; min-width: 0; width: 100%; max-width: calc(var(--pl-col) + 24px); box-sizing: border-box; padding: 0 0 64px 24px; }

/* The level pages used to center themselves at their own width (console-next.css), which on a wide screen left a gap
   between the list and the page. Beside the list they start at it, at the same width as every other Settings page. */
.cx.pl-main:is(.cx-org, .cx-team) { max-width: calc(var(--pl-col) + 24px); margin: 0; }

/* ---- The list ---- */
.pl-rail { flex: none; width: var(--pl-w); overflow-y: auto; overscroll-behavior: none; display: flex; flex-direction: column; gap: 10px; padding: 16px 12px 14px 0; color: var(--c-ink); }
.pl-kick { padding: 0 4px; color: var(--c-ink-3); font: 700 10.5px var(--font-body); letter-spacing: .08em; text-transform: uppercase; }
/* "Settings for": the switch between the levels this person can open. */
.pl-for { flex: none; display: flex; align-items: center; gap: 8px; margin-top: -4px; }
.pl-for.is-bare { display: none; }
.pl-seg { flex: 1; min-width: 0; display: flex; gap: 2px; padding: 3px; border: 1px solid var(--c-line); border-radius: 9px; background: var(--c-bg); }
.pl-sg { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 4px; height: 28px; padding: 0 6px; border-radius: 6px; color: var(--c-ink-2); font: 500 12.5px var(--font-body); text-decoration: none; }
.pl-sg span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-sg:hover, .pl-sg:focus-visible { background: var(--c-surface-2); color: var(--c-ink); outline: none; }
.pl-sg[aria-current='true'] { background: var(--c-accent-soft); color: var(--c-ink); font-weight: 600; }
/* The account, beside the switch: only while the list lies flat (below). Beside the page it is the last row. */
.pl-me { display: none; }
/* The card: the level this list is for. On the team it opens the menu of teams. */
.pl-at { flex: none; position: relative; display: flex; flex-direction: column; gap: 6px; }
.pl-at[data-k='org'] { --pl-at: var(--pl-org); }
.pl-at[data-k='div'] { --pl-at: var(--pl-div); }
.pl-at[data-k='you'] { --pl-at: var(--c-accent); }
.pl-card { display: flex; align-items: center; gap: 10px; min-height: 50px; padding: 8px; border: 1px solid color-mix(in srgb, var(--c-ink) 12%, var(--c-line)); border-radius: 10px; background: var(--c-surface); color: var(--c-ink); text-decoration: none; cursor: pointer; list-style: none; }
.pl-card::-webkit-details-marker { display: none; }
.pl-card.is-plain { cursor: default; }
.pl-card:not(.is-plain):hover, .pl-card:focus-visible, .pl-pick[open] > .pl-card { border-color: var(--c-accent); outline: none; }
.pl-card > svg { flex: none; color: var(--c-ink-3); }
.pl-pick[open] > .pl-card > svg { color: var(--c-accent); }
.pl-ct { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; background: color-mix(in srgb, var(--pl-at, var(--pl-team)) 20%, var(--c-surface)); color: var(--pl-at, var(--pl-team)); font: 700 13px var(--font-display); }
.pl-at[data-k='you'] .pl-ct { border-radius: 999px; color: var(--c-ink); }
.pl-ct.is-img { background: var(--c-surface-2) center / cover no-repeat; }
.pl-cx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pl-cn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 13.5px/1.3 var(--font-body); }
.pl-cp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-ink-3); font: 400 11.5px/1.35 var(--font-body); }
.pl-away { margin: 0; padding: 0 4px; color: var(--c-ink-3); font-size: 11.5px; line-height: 1.45; }
.pl-away a { color: var(--c-accent); }
/* The menu of teams: the header's own tree (theme.css .c-tm-*, ui/layout.tsx TeamTree), smaller. Beside the page it
   floats over it, placed under the card by app.js (without the script it sits where it falls, under the card). */
.pl-pick { min-width: 0; }
.pl-tpop { position: fixed; z-index: 46; width: 300px; max-width: calc(100vw - 32px); max-height: min(70vh, 520px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--c-line); border-radius: 12px; background: var(--c-surface); box-shadow: var(--shadow); }
details:not([open]) > .pl-tpop { display: none; }
.pl-tpop .c-tm-node { position: relative; }
.pl-tpop .c-tm-node.has-set > .c-tm-row { padding-right: 36px; }
/* An organization or division this person runs: the gear opens its own Settings. */
.c-tm-set { position: absolute; top: 1px; right: 2px; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: var(--c-ink-3); }
.c-tm-set:hover, .c-tm-set:focus-visible { background: color-mix(in srgb, var(--c-ink) 10%, var(--c-surface-2)); color: var(--c-accent); outline: none; }
@media (min-width: 761px) {
  .pl-tpop .c-tm-find { height: 30px; margin: 8px 8px 6px; border-radius: 8px; }
  .pl-tpop .c-tm-list { padding: 0 5px 5px; }
  .pl-tpop .c-tm-personal { margin-bottom: 5px; padding: 0 5px 5px; }
  .pl-tpop .c-tm-row { gap: 8px; min-height: 30px; font-size: 13px; }
  .pl-tpop .c-tm-row.is-lv2 { min-height: 28px; }
  .pl-tpop .c-tm-row.is-lv0 .c-tm-mark { width: 20px; height: 20px; }
}
.pl-tfoot { flex: none; display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 8px 12px; border-top: 1px solid var(--c-line); color: var(--c-ink-3); font-size: 11.5px; line-height: 1.45; }
.pl-tfoot a { color: var(--c-accent); font-weight: 600; text-decoration: none; }
/* The find box */
.pl-search { flex: none; display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: 1px solid var(--c-line); border-radius: 8px; background: var(--c-bg); color: var(--c-ink-3); }
.pl-search:focus-within { border-color: var(--c-accent); }
.pl-search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--c-ink); font: 400 13px var(--font-body); text-overflow: ellipsis; }
.pl-search input::placeholder { color: var(--c-ink-3); }
.pl-hits { display: flex; flex-direction: column; gap: 1px; }
.pl-hits[hidden], .pl-nav[hidden] { display: none; }
.pl-hit { display: flex; flex-direction: column; padding: 6px 8px; border-radius: 7px; color: var(--c-ink); text-decoration: none; }
.pl-hit:hover, .pl-hit:focus-visible { background: var(--c-surface-2); outline: none; }
.pl-hit b { font: 600 13px var(--font-body); }
.pl-hit small { color: var(--c-ink-3); font-size: 11.5px; }
.pl-none { margin: 0; padding: 6px 8px; color: var(--c-ink-3); font-size: 12px; line-height: 1.5; }
/* The level's sections, and the person's own account */
.pl-nav { flex: none; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.pl-secs { display: flex; flex-direction: column; gap: 1px; }
.pl-sec { display: flex; align-items: center; gap: 9px; min-height: 32px; padding: 0 8px; border-radius: 7px; color: var(--c-ink-2); font: 500 13px var(--font-body); text-decoration: none; }
.pl-sec span { flex: 1; min-width: 0; }
.pl-sec svg { flex: none; width: 22px; height: 22px; padding: 4px; border-radius: 6px; background: color-mix(in srgb, var(--h, var(--c-ink-3)) 20%, var(--c-surface)); color: var(--h, var(--c-ink-2)); }
.pl-sec svg.is-a { --h: var(--c-accent); }
.pl-sec svg.is-ok { --h: var(--c-ok); }
.pl-sec svg.is-t { --h: var(--c-viz-2); }
.pl-sec:hover, .pl-sec:focus-visible { background: var(--c-surface-2); color: var(--c-ink); outline: none; }
.pl-sec[aria-current='page'] { background: var(--c-accent-soft); color: var(--c-ink); font-weight: 600; }
.pl-sec[aria-current='page'] svg { background: var(--c-accent); color: var(--c-accent-ink); }
.pl-up { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 0 8px; border-radius: 7px; color: var(--c-ink-2); font: 500 13px var(--font-body); text-decoration: none; }
.pl-up:hover, .pl-up:focus-visible { background: var(--c-surface-2); color: var(--c-ink); outline: none; }
.pl-up > svg { flex: none; color: var(--c-ink-3); }
.pl-ut { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: color-mix(in srgb, var(--c-accent) 20%, var(--c-surface)); color: var(--c-ink); font: 700 9.5px var(--font-display); }
.pl-ut.is-img { background: var(--c-surface-2) center / cover no-repeat; }
.pl-un { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pl-you { margin-top: auto; padding-top: 8px; border-top: 1px solid var(--c-line); }
.pl-pn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-note { color: var(--c-ink-3); font: 400 11.5px/1.3 var(--font-body); }

/* ---- Overview pages ---- */
.pl-over { display: flex; flex-direction: column; gap: 18px; padding-bottom: 24px; }
.pl-intro { margin: 0; max-width: 70ch; color: var(--c-ink-2); font-size: 13.5px; line-height: 1.5; }
.pl-intro strong { color: var(--c-ink); }
.pl-set { display: flex; flex-direction: column; gap: 6px; }
.pl-set h2 { display: flex; align-items: center; gap: 6px; margin: 0 4px; color: var(--c-ink-2); font: 600 12.5px var(--font-body); }
.pl-foot { margin: 0 4px; color: var(--c-ink-3); font-size: 12px; line-height: 1.5; }
.pl-rows { overflow: hidden; }
/* A row: what it is on the left, how it stands now on the right. */
.pl-row { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 8px 12px; border-top: 1px solid var(--c-line); color: var(--c-ink); text-decoration: none; }
.pl-row:first-child { border-top: 0; }
a.pl-row:hover, a.pl-row:focus-visible { background: var(--c-surface-2); outline: none; }
.pl-row > svg { flex: none; color: var(--c-ink-3); }
.pl-rt { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: color-mix(in srgb, var(--h, var(--c-ink-3)) 20%, var(--c-surface)); color: var(--h, var(--c-ink-2)); }
.pl-rt.is-org { --h: var(--pl-org); }
.pl-rt.is-div { --h: var(--pl-div); }
.pl-rt.is-team { --h: var(--pl-team); }
.pl-rt.is-ok { --h: var(--c-ok); }
.pl-rx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pl-rx b { display: inline-flex; align-items: center; gap: 6px; font: 500 13.5px var(--font-body); }
.pl-rx b > svg { flex: none; color: var(--c-ink-3); }
.pl-rx > span { color: var(--c-ink-2); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.pl-row .pl-rx { flex-direction: row; align-items: baseline; gap: 2px 16px; }
.pl-row .pl-rx b { flex: none; max-width: 55%; }
/* A short value sits at the right edge. One that wraps reads from its own left edge, never ragged on the left. */
.pl-row .pl-rx > span { flex: 0 1 auto; min-width: 0; margin-left: auto; }
/* A long value goes under the name, as a sentence (overview-ui.tsx OvRows). */
.pl-row.is-long { align-items: flex-start; }
.pl-row.is-long .pl-rx { flex-direction: column; align-items: stretch; gap: 2px; padding-top: 2px; }
.pl-row.is-long .pl-rx b { max-width: none; }
.pl-row.is-long .pl-rx > span { margin-left: 0; }
.pl-row.is-long > svg, .pl-row.is-long > .pl-chip { align-self: center; }
.pl-rx > small { color: var(--c-ink-3); font: 700 10.5px var(--font-body); letter-spacing: .1em; text-transform: uppercase; }
.pl-rx > span.is-quiet { color: var(--c-ink-3); }
.pl-rx > .pl-who { color: var(--c-ink-3); font-size: 12.5px; }
.pl-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--c-line); border-radius: 999px; color: var(--c-ink-2); font: 600 12.5px var(--font-body); white-space: nowrap; }
.pl-chip.is-on { border-color: transparent; background: var(--c-accent-soft); color: var(--c-ink); }
.pl-ask { margin: 0; padding: 11px 14px; border-radius: var(--lv-r); background: var(--c-surface-2); color: var(--c-ink-2); font-size: 13.5px; line-height: 1.5; }
.pl-ask b { color: var(--c-ink); }
/* Joining, from the top down */
.pl-ladder { overflow: hidden; }
/* The first section under it needs no rule of its own: the card's edge already parts them. */
.pl-ladder + .lv-sset { padding-top: 22px; border-top: 0; }
.pl-lhead { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px 11px; }
.pl-lhead b { font: 700 14.5px var(--font-display); }
.pl-lhead span { color: var(--c-ink-3); font-size: 12.5px; line-height: 1.5; }
.pl-lrow { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding: 11px 14px; border-top: 1px solid var(--c-line); }
.pl-lrow .pl-rx { flex: 1 1 240px; }
.pl-lrow .pl-rx > span:not(.pl-who) { color: var(--c-ink); font-size: 13.5px; line-height: 1.5; }
.pl-lrow .pl-rx > span.is-quiet { color: var(--c-ink-2); }

/* ---- Your account (pages.tsx /profile, account-ui.tsx): label on the left, the control beside it ---- */
.ac-row { display: flex; align-items: center; gap: 16px; min-height: 48px; padding: 8px 12px; border-top: 1px solid var(--c-line); }
.ac-form { display: block; margin: 0; padding: 0; }
.ac-form > .ac-row:first-child, .ac-card > .ac-row:first-child { border-top: 0; }
.ac-row.is-top { align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
.ac-k { flex: 0 0 96px; color: var(--c-ink); font: 500 13.5px var(--font-body); }
.ac-row.is-top .ac-k { padding-top: 1px; }
.ac-row .cx-input { flex: 1; min-width: 0; max-width: 420px; }
.ac-v { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.ac-v .cx-pf-pw { width: 100%; }
.ac-hint { color: var(--c-ink-2); font-size: 13px; line-height: 1.45; }
.ac-out { display: flex; }
/* ---- The page's own head, small: the list already says where you are ---- */
.pl-main .cx-head.lv-head { padding-top: 18px; margin-bottom: 18px; gap: 14px; }
.pl-main .lv-hero { gap: 12px; }
.pl-main .lv-hero h1 { font: 700 22px/1.2 var(--font-display); }
.pl-main .lv-hero > .lv-mono { width: 36px; height: 36px; border-radius: 9px; font-size: 14px; }
@media (min-width: 761px) {
  .pl-main .lv-hero .lv-acts .lv-btn { min-height: 34px; padding: 5px 12px; border-radius: 8px; font-size: 13.5px; }
}
/* ---- From 1200px: the list stays still and the page scrolls beside it ----
   The page's column (theme.css .c-col) does not scroll here. The list and the page's pane fill the height under the
   header: the list scrolls on its own if it is long, and the pane is what scrolls the page, with the system's elastic
   scroll at either end. */
@media screen and (min-width: 1200px) {
  .c-col:has(.pl-shell) { overflow: hidden; padding-right: 0; }
  .c-col:has(.pl-shell) > .c-main { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
  .pl-shell { flex: 1; min-height: 0; align-items: stretch; }
  .pl-scroll { position: relative; min-height: 0; overflow-y: auto; padding-right: 24px; }
  .pl-scroll:focus { outline: none; }
}
/* ---- Below 1200px: the list lies flat above the page ---- */
@media (max-width: 1199px) {
  .pl-shell { display: block; }
  .pl-scroll { border-left: 0; }
  .pl-main { padding-left: 0; }
  .pl-rail { width: auto; overflow: visible; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 14px 0 0; }
  .pl-kick, .pl-you { display: none; }
  /* The switch on the left, the account on the right. */
  .pl-for, .pl-for.is-bare { flex: 0 0 100%; display: flex; justify-content: space-between; margin-top: 0; }
  .pl-seg { flex: 0 1 420px; }
  .pl-sg { height: 34px; font-size: 13.5px; }
  .pl-me { flex: none; display: flex; align-items: center; gap: 8px; min-height: 40px; margin-left: auto; padding: 0 12px 0 8px; border: 1px solid var(--c-line); border-radius: 999px; background: var(--c-surface); color: var(--c-ink-2); font: 500 13px var(--font-body); text-decoration: none; }
  .pl-me:hover, .pl-me:focus-visible { color: var(--c-ink); outline: none; }
  .pl-me[aria-current='true'] { border-color: color-mix(in srgb, var(--c-accent) 55%, var(--c-line)); color: var(--c-ink); }
  .pl-me .pl-ut { width: 24px; height: 24px; }
  .pl-at { flex: 0 1 300px; min-width: 0; }
  .pl-search { flex: 1 1 220px; max-width: 420px; height: 40px; }
  .pl-hits { flex: 0 0 100%; }
  .pl-tpop { position: absolute; top: calc(100% + 6px); left: 0; }
  .pl-away { flex: 0 0 100%; }
  /* The level's sections are a tab row, next to the page. */
  .pl-nav { flex: 0 0 100%; }
  .pl-secs { flex-direction: row; flex-wrap: wrap; gap: 4px; margin: 2px 0 0; border-bottom: 1px solid var(--c-line); }
  .pl-sec { min-height: 40px; margin-bottom: -1px; padding: 0 10px; border-bottom: 2px solid transparent; border-radius: 0; font-size: 13.5px; }
  .pl-sec span { flex: none; }
  .pl-sec:hover, .pl-sec:focus-visible { background: none; }
  .pl-sec[aria-current='page'] { background: none; border-bottom-color: var(--c-accent); }
}
@media (max-width: 760px) {
  .pl-at { flex: 1 1 100%; }
  .pl-seg { flex: 1 1 0; }
  .pl-sg { height: 40px; }
  .pl-me { width: 40px; padding: 0; justify-content: center; }
  .pl-me > span:last-child { display: none; }
  .pl-search { flex: 1 1 100%; max-width: none; height: 42px; }
  .pl-search input { font-size: 16px; }
  .pl-tpop { width: auto; right: 0; }
  .pl-tpop .c-tm-find { height: 40px; }
  .pl-tpop .c-tm-row, .pl-tpop .c-tm-row.is-lv2 { min-height: 44px; }
  .c-tm-set { top: 2px; width: 40px; height: 40px; }
  .pl-tpop .c-tm-node.has-set > .c-tm-row { padding-right: 46px; }
  .pl-tfoot a { display: flex; align-items: center; min-height: 40px; }
  .pl-sec svg { display: none; }
  .pl-row { align-items: flex-start; flex-wrap: wrap; }
  /* The words keep the full width: the label, then how it stands under it. A chip or button drops to its own line. */
  .pl-row .pl-rx, .pl-lrow .pl-rx { flex: 1 1 calc(100% - 38px); }
  .pl-row .pl-rx { flex-direction: column; align-items: stretch; }
  .pl-row .pl-rx b { max-width: none; }
  .pl-row .pl-rx > span { margin-left: 0; }
  .pl-row > svg { display: none; }
  .pl-chip { margin-left: 34px; }
  .ac-row { flex-wrap: wrap; gap: 8px; }
  .ac-row .pl-chip { margin-left: 0; }
  .ac-k { flex: 0 0 100%; }
  .ac-row .cx-input { flex: 1 1 100%; max-width: none; min-height: 40px; font-size: 16px; }
  .ac-out .cx-btn { min-height: 40px; padding-inline: 16px; }
  .pl-lrow .pl-chip, .pl-lrow .lv-btn { margin-left: 36px; }
}
/* Your account's head has no tab row under it now (the sections are in the list), so it needs no rule below it. */
.cx-pf.pl-main .cx-head { margin-bottom: 14px; padding-bottom: 4px; border-bottom: 0; }
.cx-pf.pl-main .cx-head { padding-top: 18px; }
.cx-pf.pl-main .cx-title { font-size: 22px; font-weight: 700; }
.cx-pf.pl-main .cx-pf-av { width: 44px; height: 44px; font-size: 16px; }
