  /* ---------- Settings module (#627, #780): the styles moved out of the Inbox page ----------
     These rules moved verbatim from `src/inbox/app.html` into this file (#780). They are the
     Settings module's own mount rules: the context column and stage show/hide under
     `.shell2.mod-settings`, the kept context-column track, the two canvas rules the shell holds
     off its live Mail panes, and the stacked-field reset. The Settings page frame and every
     `.st-*` row stay in the linked canvas sheets (`helm.css`, `src/inbox/canvas/settings.css`),
     which are untouched. No rule here has a selector that starts with the document-root
     pseudo-class, so none had to stay behind for the inline token block (#778 lesson). The module
     stylesheet loads before the inline <style>, so for an equal-specificity rule the inline shell
     rule wins the source-order tie; the one rule here that must still win over the shell (the kept
     context-column track) raises its specificity with the stage id rather than rely on source order
     (see the #stage override below, #780 review round 1). */
  /* ===== Settings module (#572). Settings is a module in the shell stage (adr/0063 decision 6),
     ported to the design canvas one to one. Its context column rides the shared stage
     context-column track (#settingsCtx, the way Mentions rides it), and its pages render in their own
     stage (#settingsStage) beside it, so the dock and the Teammate dock stay visible. It has no dock
     tile; the account menu and ⌘, open it. The page frame (.page, .mh, .page-b, .page-in, .sec,
     .box, .cs) and every .st-* row come straight from the linked canvas sheets (helm.css,
     settings.css); only the mount, the two canvas rules the shell holds off its live Mail panes, and
     the stacked-field reset live here. ===== */
  #settingsCtx{display:none}
  #settingsStage{display:none;position:relative;overflow:hidden;background:var(--canvas)}
  /* The Mail rail (shown by its place in the context-column track) and the Mail list pane are hidden
     here by class while Settings is mounted, and reappear the moment it unmounts. Every other module's
     context column and stage pane is shown by its own `hidden` flag, which setModulePanes clears on
     entering Settings and restores on leaving (#572 review round 4); so this mount names none of them,
     and a context column or stage a later module port adds is covered there, not here. */
  .shell2.mod-settings #rail{display:none}
  .shell2.mod-settings #settingsCtx{display:flex}
  .shell2.mod-settings #listPane{display:none}
  .shell2.mod-settings #settingsStage{display:flex;flex-direction:column;min-width:0;min-height:0}
  /* Settings always shows its context column, so the stage keeps the context-column track open even
     when the module left on the stage behind it had none (for example Processes), and even when the
     shell still carries .no-ctx (after a no-column module such as Teammate) or .rail-collapsed (a
     persisted Mail rail). Those two fold rules in the inline shell stylesheet set --t-rail:0px with
     three classes each. This stylesheet loads before the inline <style>, so an equal-specificity
     rule here would lose the source-order tie to them and the pages column would fold to zero width.
     So the stage is targeted by its id (#stage) — this override then beats both fold rules on
     specificity, whatever the load order. */
  .shell2.mod-settings #stage{--t-rail:var(--rail-w)}
  /* Settings restores two canvas rules the shell holds off its other panes (#568): a page-level
     banner carries the canvas card shadow, and the Mailboxes "none" empty state is centred in the
     stage rather than left in flow. Both are scoped to Settings, so the live Mail panes keep today's
     held look. */
  #settingsStage .ban{box-shadow:var(--shadow-card)}
  #settingsStage .empty{position:absolute;inset:0;margin:auto;height:max-content;max-width:400px;padding:24px}
  /* Two-up field rows (profile, signature, invite, save the current filter) align at the top on the
     canvas; the app's global stacked-field offset would push the second cell down, so it is reset
     inside Settings, where the flex and grid gaps already space the fields. */
  #settingsStage .f + .f{margin-top:0}
  @media (max-width:820px){
    /* At narrow width the pages column folds off-canvas and overlays the stage, exactly like the
       Mail rail and the To-dos column (#572): the base `.ctx` rule above makes #settingsCtx a fixed
       overlay that starts translated off-screen, and "Toggle sidebar" in the Settings header slides
       it in through the one overlay `.show` state. The track collapses to zero so the stage takes the
       full width; the column is not removed (display:none would make it unreachable, the parked bug),
       so the toggle can still open it. */
    .shell2.mod-settings .stage{--t-rail:0px}
  }
  /* The in-page confirm for a mailbox disconnect (#1487). It is the shared banner card, set under the
     mailbox row with no page inset. The id raises the specificity over the shell `.ban` rule, which
     wins a source-order tie. At phone width the two buttons take their own row, so neither is cut. */
  #settingsStage .ban.st-mbx-confirm{margin:0}
  #settingsStage .ban.st-mbx-confirm[hidden]{display:none}
  #settingsStage .ban.st-mbx-confirm .st-errbox{margin-top:var(--sp-2)}
  #settingsStage .ban.st-mbx-confirm .st-errbox[hidden]{display:none}
  @media (max-width:720px){
    #settingsStage .ban.st-mbx-confirm{grid-template-columns:32px minmax(0,1fr)}
    #settingsStage .ban.st-mbx-confirm .ban-acts{grid-column:1 / -1;justify-content:flex-end;flex-wrap:wrap}
  }
  /* Add your team (#2023). The rows reuse the Members table rows (.st-grid, .st-tr) of the canvas
     sheet; only the columns change. The stage id raises the specificity over the canvas .st-tr
     rule. The Mailbox column and the password column show for a hosted mailbox only. */
  #settingsStage .st-tr.st-mem-mb{grid-template-columns:minmax(0,1.5fr) minmax(0,1.3fr) 196px 128px 36px}
  #settingsStage .st-tr.st-mb-connect{grid-template-columns:minmax(0,1fr);padding:0}
  #settingsStage .st-tr[hidden]{display:none}
  #settingsStage .st-mb-form{grid-template-columns:minmax(0,1fr) auto auto}
  #settingsStage .st-tr.st-add-row.has-pw{grid-template-columns:minmax(0,1.4fr) 190px minmax(0,1fr) 36px}
  #settingsStage .st-tr.st-add-row.no-pw{grid-template-columns:minmax(0,1fr) 190px 36px}
  #settingsStage .st-tr.st-add-res.has-pw{grid-template-columns:minmax(0,1fr) 210px minmax(0,1fr)}
  #settingsStage .st-tr.st-add-res.no-pw{grid-template-columns:minmax(0,1fr) 210px}
  #settingsStage .st-opt{font-weight:400}
  #settingsStage .st-err{font-size:12px;color:var(--danger);font-weight:500}
  #settingsStage .st-err[hidden]{display:none}
  #settingsStage .st-add-sum{margin:0;padding:14px 14px 4px}
  #settingsStage .st-add-paste{padding:14px;border-bottom:1px solid var(--line-soft)}
  #settingsStage .st-add-pacts{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
  #settingsStage .st-add-bar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:12px 14px;border-top:1px solid var(--line-soft)}
  #settingsStage .st-add-bar .st-grow{flex:1}
  #settingsStage .st-add-who{display:flex;flex-direction:column;gap:2px;min-width:0}
  #settingsStage .st-add-who .t-sub{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #settingsStage .st-add-retry{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
  /* The rows to check after a send (#2025): each is a link that moves focus to its result row. The
     row takes focus from the link only, and shows the ring inside the box. */
  #settingsStage .st-add-fails{margin:0;padding:4px 14px 8px 32px;display:flex;flex-direction:column;gap:4px;font-size:13px}
  #settingsStage .st-add-fails a{color:var(--ink);text-decoration:underline;text-underline-offset:3px}
  #settingsStage .st-tr.st-add-res:focus-visible{outline-offset:-2px}
  @media (max-width:820px){
    /* At narrow width the canvas hides the Email column. The Mailbox cell takes its own line under
       the name and the role, with the remove button beside it, so the Tab order (role, Connect
       mailbox, remove) is the order on the screen (#2025). Each row of Add your team stacks its
       fields, with the remove button beside the last field, for the same reason. */
    #settingsStage .st-tr.st-mem-mb{grid-template-columns:minmax(0,1fr) 150px 36px}
    #settingsStage .st-tr.st-mem-mb > .st-mb-cell{grid-column:1 / 3}
    #settingsStage .st-tr.st-mem-mb > .st-act-cell{grid-column:3;grid-row:2}
    #settingsStage .st-tr.st-mem-mb.hd > .st-act-cell{grid-row:1}
    #settingsStage .st-tr.st-mem-mb.hd > .st-mb-cell{display:none}
    #settingsStage .st-mb-form{grid-template-columns:minmax(0,1fr) auto}
    #settingsStage .st-mb-form > .f{grid-column:1 / -1}
    #settingsStage .st-tr.st-add-row.has-pw,#settingsStage .st-tr.st-add-row.no-pw{grid-template-columns:minmax(0,1fr) 36px}
    #settingsStage .st-tr.st-add-row > *{grid-column:1}
    #settingsStage .st-tr.st-add-row.has-pw > .st-act-cell{grid-column:2;grid-row:3}
    #settingsStage .st-tr.st-add-row.no-pw > .st-act-cell{grid-column:2;grid-row:2}
    #settingsStage .st-tr.st-add-res.has-pw,#settingsStage .st-tr.st-add-res.no-pw{grid-template-columns:minmax(0,1fr)}
    #settingsStage .st-tr.hd.st-add-row,#settingsStage .st-tr.hd.st-add-res{display:none}
  }
  @media (max-width:480px){
    /* Phone width, down to 320px (#2025). The 150px role column left no room for the member name,
       and a long address ran over the invitation's mailbox state. A member row stacks the name, the
       role and the mailbox, with the remove button beside the mailbox, in the Tab order. The header
       row hides, as the Add your team header does at narrow width. */
    #settingsStage .st-tr.st-mem-mb{grid-template-columns:minmax(0,1fr) 36px}
    #settingsStage .st-tr.st-mem-mb > *{grid-column:1}
    #settingsStage .st-tr.st-mem-mb > .st-mb-cell{grid-column:1;grid-row:3}
    #settingsStage .st-tr.st-mem-mb > .st-act-cell{grid-column:2;grid-row:3}
    #settingsStage .st-tr.st-mem-mb.hd{display:none}
    #settingsStage .st-invites .st-row.no-icon{grid-template-columns:minmax(0,1fr)}
    #settingsStage .st-invites .st-row .acts{justify-content:flex-start}
    #settingsStage .st-invites .st-row .t-sub{overflow-wrap:anywhere}
  }
  /* The WhatsApp card (#767). The sign-in card text column, the inline error line, and the danger
     fill of the disconnect confirm (the canvas board "Disconnect WhatsApp confirm"). */
  #settingsStage .st-oauth-t{display:flex;flex-direction:column;gap:2px;min-width:0}
  #settingsStage .st-danger{background:var(--danger);border-color:var(--danger)}

  /* The Street webhook steps (#2116): a numbered list with the canvas step number, in the Street drawer. */
  #settingsStage .st-wh-steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
  #settingsStage .st-wh-steps > li{display:grid;grid-template-columns:28px minmax(0,1fr);gap:10px;align-items:start;font-size:13px;color:var(--ink)}
  #settingsStage .st-wh-steps .t{display:flex;flex-direction:column;gap:8px;min-width:0}
  #settingsStage .st-wh-steps .pills{display:flex;flex-wrap:wrap;gap:6px}
  #settingsStage .st-wh-steps code.lchip{font-family:var(--mono);font-size:11.5px}
  #settingsStage .st-wh .acts,#settingsStage .st-wa-hist .acts{display:flex;flex-wrap:wrap;gap:8px}
  /* The hint under the refresh button (#2121) sits outside a .f field, so it takes the field hint style here. */
  #settingsStage .st-wh .hint{font-size:12px;color:var(--ink-3)}
  /* Autonomy (#2421): the Agency switch "Helm sends by itself" with its state word beside it, as the
     canvas frame shows, and the confirm for "off", which is the shared banner card under the switch
     box, as the mailbox disconnect confirm. It keeps the banner border and radius, so the card frame
     closes. At phone width the two buttons take their own row. */
  #settingsStage .st-sw-acts{display:flex;align-items:center;gap:8px;flex-wrap:nowrap}
  /* The canvas `.tg` is a full-width grid for a labelled switch. Here the label is in the row text,
     so the switch keeps only its own width and the state word stays beside it, in one centred row. */
  #settingsStage .st-sw-acts .tg{width:auto;flex:none;display:inline-flex}
  #settingsStage .page-in > .ban.st-sw-role{margin:0}
  #settingsStage .st-sw-state{font-size:13px;font-weight:600;color:var(--ink);min-width:24px}
  #settingsStage .ban.st-sw-confirm{margin:0}
  #settingsStage .ban.st-sw-confirm[hidden]{display:none}
  @media (max-width:720px){
    #settingsStage .ban.st-sw-confirm{grid-template-columns:32px minmax(0,1fr)}
    #settingsStage .ban.st-sw-confirm .ban-acts{grid-column:1 / -1;justify-content:flex-end;flex-wrap:wrap}
  }
