/* The tool switcher (tfb_common/switcher.py), the same in the hub and every tool. From the tfb-common repo; change it
   there and sync. Scoped to .tfb-switch and .tfb-tools so a host's own header rules don't reach it; colours come from
   the host's --t4b-* when it sets them (PondTools' dark theme), else the Tools for Builders ones. */
.tfb-switch,.tfb-tools{
  --sw-ground:var(--t4b-ground,#fff);--sw-ink:var(--t4b-ink,#19384f);--sw-muted:var(--t4b-muted,#4f6577);
  --sw-rule:var(--t4b-rule,#d3dee7);--sw-sheet:var(--t4b-sheet,#f1f5f8);--sw-signal:var(--t4b-signal,#326b98);
  --sw-display:"Barlow Semi Condensed","Arial Narrow",sans-serif;--sw-body:"Barlow","Segoe UI",sans-serif;
}
details.tfb-switch{position:relative;flex:none}
details.tfb-switch>summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:8px;white-space:nowrap}
details.tfb-switch>summary::-webkit-details-marker{display:none}
details.tfb-switch>summary .caret{width:10px;height:10px;flex:none;transition:transform .15s}
details.tfb-switch[open]>summary .caret{transform:rotate(180deg)}
.tfb-switch .tn-a,.tfb-tools .tn-a{font-weight:500}.tfb-switch .tn-b,.tfb-tools .tn-b{font-weight:300}
/* the pill: a squared button the height of the account menu */
details.tfb-switch.tfb-switch-pill>summary{font:600 16px/1 var(--sw-display);color:var(--sw-ink);height:34px;padding:0 10px 0 12px;
  border:1px solid var(--sw-rule);border-radius:4px;background:var(--sw-ground)}
details.tfb-switch>summary:hover,details.tfb-switch[open]>summary{color:var(--sw-signal)}
details.tfb-switch.tfb-switch-pill>summary:hover,details.tfb-switch.tfb-switch-pill[open]>summary{border-color:var(--sw-signal)}
details.tfb-switch>summary:focus-visible{outline:2px solid var(--sw-signal);outline-offset:2px}

/* the panel: two columns, Run your business | Design the job */
.tfb-switch-panel{position:absolute;top:calc(100% + 10px);right:0;z-index:60;width:704px;max-width:calc(100vw - 32px);
  background:var(--sw-ground);border:1px solid var(--sw-rule);border-radius:4px;text-align:left}
.tfb-switch.tfb-switch-left .tfb-switch-panel{right:auto;left:0}
.tfb-tools{display:grid;grid-template-columns:1fr 1fr;font:400 16px/1.4 var(--sw-body);color:var(--sw-ink)}
.tfb-tools-col{display:flex;flex-direction:column;padding:8px;min-width:0}
.tfb-tools-col+.tfb-tools-col{border-left:1px solid var(--sw-rule)}
.tfb-tools .tfb-tools-head{margin:0;padding:8px 12px 6px;font:500 14px/1.2 var(--sw-body);color:var(--sw-muted)}
.tfb-tools ul{list-style:none;margin:0;padding:0}
.tfb-tools li{margin:0;padding:0}
.tfb-tools a.tfb-tool{display:block;padding:8px 12px;border-radius:3px;color:var(--sw-ink);text-decoration:none;
  white-space:normal;background:none}
.tfb-tools .tfb-tool-name{display:block;font:500 17px/1.2 var(--sw-display);color:var(--sw-ink)}
.tfb-tools .tfb-tool-line{display:block;margin-top:2px;font:400 14px/1.35 var(--sw-body);color:var(--sw-muted)}
.tfb-tools a.tfb-tool:hover{background:var(--sw-sheet);color:var(--sw-ink)}
.tfb-tools a.tfb-tool:hover .tfb-tool-name{color:var(--sw-signal)}
.tfb-tools a.tfb-tool.is-current{background:var(--sw-sheet);box-shadow:inset 3px 0 0 var(--sw-signal)}
.tfb-tools a.tfb-tool.is-current .tfb-tool-name{color:var(--sw-signal)}
.tfb-tools a.tfb-tool:focus-visible,.tfb-tools a.tfb-tools-home:focus-visible{outline:2px solid var(--sw-signal);outline-offset:-2px}
.tfb-tools a.tfb-tools-home{display:block;margin:auto 0 0;padding:12px 12px 6px;border-top:1px solid var(--sw-rule);
  font:500 15px/1.3 var(--sw-body);color:var(--sw-signal);text-decoration:none;background:none;white-space:nowrap}
.tfb-tools a.tfb-tools-home:hover{text-decoration:underline;text-underline-offset:3px;color:var(--sw-signal)}

/* phones: the columns stack, Run your business first. In a phone's account menu (tool_list) the list is always
   stacked; a switcher still showing on a phone (PondTools) opens full width under its header. */
.panel .tfb-tools,.tfb-tools.tfb-tools-stacked{grid-template-columns:1fr}
.panel .tfb-tools-col{padding:0}
.panel .tfb-tools .tfb-tools-head{padding:10px 16px 4px}
.panel .tfb-tools-col+.tfb-tools-col{border-left:0;border-top:1px solid var(--sw-rule);margin-top:6px;padding-top:6px}
@media (max-width:760px){
  .tfb-tools{grid-template-columns:1fr}
  .tfb-tools-col+.tfb-tools-col{border-left:0;border-top:1px solid var(--sw-rule)}
  details.tfb-switch{position:static}
  .tfb-switch-panel,.tfb-switch.tfb-switch-left .tfb-switch-panel{left:0;right:0;top:100%;width:auto;max-width:none;
    max-height:calc(100vh - 64px);overflow-y:auto;border-radius:0;border-width:0 0 1px}
  .tfb-tools a.tfb-tool{padding:10px 12px}
}
@media (prefers-reduced-motion:reduce){details.tfb-switch>summary .caret{transition:none}}
