/* The Cantina — shared header bar (25 Oct 2026, site review tranche C).
   One shape on every tool, each tool's own colours: a home mark at the left (the lit doorway), the tool's
   mark and name with a one-line descriptor, the account button at the right. The look switch
   (Classic / Rebel / Imperial) is no longer in the bar: it lives in the account menu (shared/auth.js) and
   at the foot of the landing page, so phones get a one-row header. Link this file after the page's own
   <style> and after shared/looks.css. Pages keep their own palette, fonts and spacing. */

/* Home mark. Inherits the bar's text colour; the tool's accent on hover. A thin rule separates it from the brand. */
.site-home {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 40px; height: 40px; margin-left: -8px; margin-right: 2px; border-radius: 10px;
  color: inherit; opacity: .8; text-decoration: none;
  border-right: 0;
}
.site-home:hover, .site-home:focus-visible { opacity: 1; color: var(--accent, inherit); background: rgba(127,127,127,.14); text-decoration: none; }
.site-home svg { width: 22px; height: 22px; display: block; }
.site-home::after { content: ""; display: block; width: 1px; height: 22px; background: currentColor; opacity: .25; margin-left: 10px; margin-right: -12px; }
[data-look="imperial"] .site-home, [data-look="imperial"] .site-home:hover { border-radius: 0; }
[data-look="rebel"] .site-home, [data-look="rebel"] .site-home:hover { border-radius: 3px; }

/* Brand: the tool's own mark, its name, then the descriptor. Desktop: name and descriptor side by side on one baseline. */
.brand, .brand:hover { min-width: 0; text-decoration: none; }

/* Pages with a plain two-ended bar (.site-header): the home mark goes first, the brand sits beside it, the
   right-hand group stays right. Without this, three children of a space-between bar put the brand in the middle. */
.site-header { justify-content: flex-start; }
.site-header > :last-child { margin-left: auto; }
.brand .brand-text { display: inline-flex; align-items: baseline; gap: 10px; min-width: 0; }
.brand .brand-name { white-space: nowrap; }
.brand .desc {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-weight: 400; font-size: 0.8125rem; line-height: 1.2;
  letter-spacing: 0; text-transform: none; font-stretch: normal; opacity: .74;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48ch;
}
.brand:hover .desc { text-decoration: none; }

/* The old in-bar look switch stays in the markup (look.js mounts there) but is not shown inside a header bar. */
.look-header #lookSwitch, .site-header #lookSwitch, .topbar #lookSwitch { display: none !important; }

/* Landing page: the look control at the foot of the page, with its one sentence. */
.look-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 22px 0 0; padding: 14px 16px; border: 1px solid var(--border, rgba(127,127,127,.3)); border-radius: 12px; }
.look-foot p { margin: 0; flex: 1 1 260px; font-size: 0.8125rem; line-height: 1.45; color: var(--text-dim, inherit); opacity: .9; }
[data-look="imperial"] .look-foot { border-radius: 0; }
[data-look="rebel"] .look-foot { border-radius: 3px; }

/* Laptops and small desktops: a bar that also carries a tab strip drops the descriptor before the strip would wrap. */
@media (max-width: 1200px) {
  .topbar:has(.nav) .brand .desc, .look-header:has(.nav) .brand .desc, .topbar:has(.topnav) .brand .desc { display: none; }
}

/* Narrow screens: descriptor drops under the name; a tool's own tab strip becomes a full-width row that scrolls sideways. */
@media (max-width: 760px) {
  .brand .brand-text { flex-direction: column; align-items: flex-start; gap: 0; line-height: 1.1; }
  .brand .desc { font-size: 0.6875rem; max-width: 30ch; }
  .look-header, .site-header, .topbar { flex-wrap: wrap; row-gap: 4px; }
  .look-header .nav, .topbar .nav, .topbar .topnav, .look-header .topnav { order: 20; flex: 1 1 100%; width: 100%; display: flex; gap: 2px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; margin: 0; padding-bottom: 2px; }
  .look-header .nav::-webkit-scrollbar, .topbar .nav::-webkit-scrollbar, .topbar .topnav::-webkit-scrollbar { display: none; }
  .look-header .spacer, .topbar .spacer { flex: 1 1 auto; }
  /* Save-status pills (Hyperlog, Holoseal, Fluxline) shorten with an ellipsis instead of pushing the account button to a new row. */
  .topbar #saveStatus { flex: 999 1 40px; max-width: max-content; min-width: 0; overflow: hidden; }
  .topbar .spacer, .look-header .spacer { flex: 1 1 0; min-width: 0; }
  /* MoorBnB: the Rent/List switch takes its own row above the tab strip rather than splitting the right-hand buttons. */
  .topbar .modeToggle { order: 19; flex: 1 1 100%; }
  .topbar #saveStatus > * { max-width: 100%; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
  .topbar #saveStatus > * .dot { display: inline-block; vertical-align: middle; margin-right: 6px; position: relative; top: -1px; }
}
@media (max-width: 420px) {
  .brand .desc { display: none; }
  /* The doorway is the only mark on the smallest phones. look.js swaps #toolMark for a .look-mark span. */
  .look-header .brand .look-mark, .topbar .brand .look-mark, .site-header .brand .look-mark,
  .look-header .brand .mark, .topbar .brand .mark, .site-header .brand .mark,
  .look-header .brand .badge-mark, .topbar .brand .badge-mark, .site-header .brand .badge-mark,
  .look-header .brand #toolMark, .topbar .brand #toolMark, .site-header .brand #toolMark { display: none; }
  .site-home::after { display: none; }
}

/* Site-wide accessibility basics (25 Oct 2026, finding 18). A visible keyboard focus ring on every control, in the
   tool's accent, without touching mouse clicks; and no animation for people who asked their system for less motion. */
:where(a, button, [role="button"], [tabindex]:not([tabindex="-1"]), summary):focus-visible { outline: 2px solid var(--accent, currentColor); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
