/*
 * ReadyHub design tokens, from the Ready State Studios brand guidelines
 * (v1.0, 11 November 2026; plan section 6.1). Colours are RGB channels so
 * opacity modifiers keep working. The theme is chosen by data-theme on <html>;
 * any element can carry data-theme to pin a region to one theme.
 *
 * Every colour is one of the four core swatches (Teal, Mint, Ink, Snow), one of
 * the two supporting tones the guide names from the supplied artwork (Deep
 * #213834, Pale #D3FFF6), or a mix of those. Never add a colour from anywhere
 * else. Status tones are the one functional exception.
 */

:root,
[data-theme="dark"] {
  color-scheme: dark;
  /* Ink, then mixes of Ink and Deep (25%, 45%, 70%). */
  --c-background: 18 20 20;
  --c-background-soft: 22 29 28;
  --c-surface: 25 36 34;
  --c-surface-hover: 29 45 42;
  /* Snow, and Snow mixed with Ink (93%) and with Deep (60%). */
  --c-text-main: 234 239 239;
  --c-text-muted: 163 175 174;
  --c-heading: 250 255 255;
  /* Structure is drawn in neutral lines: the accent is kept for the top-bar
     rule, the current item and the primary button, so it still means something
     when it appears. --accent-line is the accent edge. */
  --c-hairline: 234 239 239;
  --hairline-alpha: 0.09;
  --field-edge-alpha: 0.6;
  /* Teal on Ink is 9.7:1; Mint on Ink 14.7:1 (brand guide, page 11). */
  --c-accent: 58 208 193;
  --c-on-accent: 18 20 20;
  --c-signal: 58 208 193;
  --c-focus: 95 255 203;
  --shadow-card: 0 24px 80px rgb(var(--c-shade) / 0.38);
  /* Status tones, each 4.5:1 or better on this ground. */
  --p-positive: 125 219 163;
  --p-caution: 242 192 99;
  --p-danger: 255 143 133;
  --p-info: 185 192 255;
}

[data-theme="light"] {
  color-scheme: light;
  /* Snow mixed with Ink (4%, 7%), Snow, and paper white. */
  --c-background: 241 246 246;
  --c-background-soft: 234 239 239;
  --c-surface: 250 255 255;
  --c-surface-hover: 255 255 255;
  --c-text-main: 18 20 20;
  /* Deep mixed with Snow (80%): 5.8:1 on the softest ground. */
  --c-text-muted: 76 96 93;
  --c-heading: 18 20 20;
  --c-hairline: 18 20 20;
  --hairline-alpha: 0.13;
  --field-edge-alpha: 0.75;
  /* Teal and Mint fail on Snow (1.9:1 and 1.25:1), so the light accent is
     Deep, which holds 12:1, with Snow text on it. */
  --c-accent: 33 56 52;
  --c-on-accent: 250 255 255;
  --c-signal: 33 56 52;
  --c-focus: 18 20 20;
  --shadow-card: 0 18px 50px rgb(var(--c-text-main) / 0.1);
  --p-positive: 23 99 58;
  --p-caution: 122 75 0;
  --p-danger: 177 18 38;
  --p-info: 58 63 158;
}

:root {
  /* The brand swatches, the same in both themes. */
  --c-teal: 58 208 193;
  --c-mint: 95 255 203;
  --c-ink: 18 20 20;
  --c-snow: 250 255 255;
  --c-deep: 33 56 52;
  --c-pale: 211 255 246;
  /* Text on Teal or Mint is always Ink (brand guide: "Pair filled teal/mint
     buttons with Ink text"). */
  --c-on-brand: 18 20 20;
  /* Pinned in both themes: paper white (print, QR codes, the colour wheel) and
     the shade under panels. --c-ink is the pinned dark ground (scrims, Josh's
     orb). */
  --c-paper: 255 255 255;
  --c-shade: 0 0 0;
  --shadow-panel: 0 24px 80px rgb(var(--c-shade) / 0.45);
  --shadow-menu: 0 18px 50px rgb(var(--c-shade) / 0.35);

  /* Control sizes: every clickable thing is at least 2.75rem tall. */
  --control-height: 2.75rem;
  --control-height-sm: 2.25rem;
  /* Tool screens read at 14px; content at 16px. */
  --text-tool: 0.875rem;

  /* Teal to Mint, reserved for the top-bar rule and the one primary button per
     screen. Ink text holds 9.7:1 or better across it. */
  --brand-gradient: linear-gradient(100deg, rgb(var(--c-teal)) 0%, rgb(var(--c-mint)) 100%);

  /* The one type scale: body 16, lead 18, then 24 / 32 / 44 / 64 and the hero. */
  --type-body: 1rem;
  --type-lead: 1.125rem;
  --type-24: 1.5rem;
  --type-32: 2rem;
  --type-44: 2.75rem;
  --type-64: 4rem;
  --type-hero: clamp(2.75rem, 8vw, 7rem);
  --leading-body: 1.55;

  --font-inter:
    "Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  /* Russo One has one weight; never simulate bold or italic (brand guide, page 13). */
  --font-russo: "Russo One", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-code:
    ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

:root,
[data-theme] {
  --background: rgb(var(--c-background));
  --surface: rgb(var(--c-surface));
  --hairline: rgb(var(--c-hairline) / var(--hairline-alpha));
  --hairline-strong: rgb(var(--c-hairline) / calc(var(--hairline-alpha) * 2));
  --accent-line: rgb(var(--c-accent) / 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  /* Tool screens sit on a plain field: red is never a background wash. */
  background: rgb(var(--c-background));
  color: rgb(var(--c-text-main));
  font-family: var(--font-inter);
  font-size: var(--text-tool);
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

[data-theme] {
  color: rgb(var(--c-text-main));
}

::selection {
  background: rgb(var(--c-accent) / 0.38);
  color: rgb(var(--c-text-main));
}

/* Every control gets a visible ring unless it sets its own. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid rgb(var(--c-focus));
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Typography. Russo One carries display headings; Inter carries everything else. */
.display,
.title {
  font-family: var(--font-russo);
  font-synthesis: none;
  font-weight: 400;
  color: rgb(var(--c-heading));
  text-wrap: balance;
}
.display {
  text-transform: uppercase;
  letter-spacing: -0.012em;
  line-height: 0.94;
}
.title {
  font-size: var(--type-24);
  line-height: 1.1;
}
/* The one place Russo One appears on a tool screen: the page title. */
.hub-title {
  font-family: var(--font-russo);
  font-synthesis: none;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.05;
  color: rgb(var(--c-heading));
  text-wrap: balance;
}
.hub-h2 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: rgb(var(--c-heading));
}
.hub-muted {
  color: rgb(var(--c-text-muted));
}
.hub-mono {
  font-family: var(--font-code);
  font-size: 0.875em;
}

/*
 * Shape language. Corners are cut at 45 degrees rather than rounded.
 * --ch is the size of the cut. .chamfer cuts two opposite corners,
 * .chamfer-tr cuts one. .chamfer-edge draws the border along the cuts.
 */
.chamfer,
.chamfer-sm,
.chamfer-lg {
  clip-path: polygon(
    0 0,
    calc(100% - var(--ch)) 0,
    100% var(--ch),
    100% 100%,
    var(--ch) 100%,
    0 calc(100% - var(--ch))
  );
}
.chamfer-tr {
  clip-path: polygon(0 0, calc(100% - var(--ch)) 0, 100% var(--ch), 100% 100%, 0 100%);
}
.chamfer,
.chamfer-tr {
  --ch: 14px;
}
.chamfer-sm {
  --ch: 9px;
}
.chamfer-lg {
  --ch: clamp(18px, 2.4vw, 32px);
}
.chamfer-edge {
  position: relative;
  border: 1px solid var(--edge, var(--hairline));
}
.chamfer-edge::before,
.chamfer-edge::after {
  content: "";
  position: absolute;
  z-index: 2;
  width: var(--ch);
  height: var(--ch);
  pointer-events: none;
}
.chamfer-edge::before {
  top: -1px;
  right: -1px;
  background: linear-gradient(
    to bottom left,
    transparent 50%,
    var(--edge, var(--hairline)) 50%,
    var(--edge, var(--hairline)) calc(50% + 1.25px),
    transparent calc(50% + 1.25px)
  );
}
.chamfer-edge::after {
  bottom: -1px;
  left: -1px;
  background: linear-gradient(
    to top right,
    transparent 50%,
    var(--edge, var(--hairline)) 50%,
    var(--edge, var(--hairline)) calc(50% + 1.25px),
    transparent calc(50% + 1.25px)
  );
}
.chamfer-tr.chamfer-edge::after {
  display: none;
}

/* A one-pixel Teal-to-Mint divider that fades out at both ends: the accent rule. */
.hairline {
  display: block;
  height: 1px;
  border: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgb(var(--c-teal) / 0.7) 14%,
    rgb(var(--c-teal)) 48%,
    rgb(var(--c-mint)) 78%,
    transparent 100%
  );
}

/* Top bar: one Teal-to-Mint rule beneath it, the only one on screen. */
.hub-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  height: 3.5rem;
  align-items: center;
  gap: 0.75rem;
  background: rgb(var(--c-background));
  padding: 0 1rem;
}
.hub-topbar::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgb(var(--c-teal)) 0%,
    rgb(var(--c-teal)) 45%,
    rgb(var(--c-mint)) 100%
  );
}
.hub-wordmark {
  font-family: var(--font-russo);
  font-synthesis: none;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
  color: rgb(var(--c-heading));
}

/* Panels: a surface with one cut corner and a hairline edge, no shadows. */
.hub-panel {
  --ch: 14px;
  background: rgb(var(--c-surface));
  padding: 1.25rem;
}
@media (min-width: 640px) {
  .hub-panel {
    padding: 1.5rem;
  }
}
.hub-rule {
  border: 0;
  border-top: 1px solid var(--hairline);
}

/*
 * Buttons. The outer element takes focus; the inner face is clipped to the
 * chamfer, so the focus ring is never cut off.
 */
.btn {
  display: inline-flex;
  min-height: var(--control-height);
  flex: none;
  cursor: pointer;
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  font-size: var(--text-tool);
  font-weight: 600;
  line-height: 1.2;
  color: inherit;
}
.btn-sm {
  min-height: var(--control-height-sm);
}
.btn-face {
  --ch: 8px;
  /* Secondary buttons sit on the page ground, so the edge must be findable:
     text-muted at 0.75 holds 3:1 or better in both themes, which the portal's
     hairline-strong does not. */
  --edge: rgb(var(--c-text-muted) / 0.75);
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgb(var(--c-background));
  padding: 0.5rem 1rem;
  color: rgb(var(--c-text-main));
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.btn-sm .btn-face {
  --ch: 7px;
  padding: 0.375rem 0.75rem;
}
.btn:hover .btn-face {
  --edge: rgb(var(--c-text-main));
  background: rgb(var(--c-surface-hover));
  color: rgb(var(--c-heading));
}
/* The one primary action per screen. */
.btn-primary .btn-face,
.btn-primary:hover .btn-face {
  --edge: transparent;
  background: var(--brand-gradient);
  color: rgb(var(--c-on-brand));
}
/* Teal meets the light ground at 1.75:1, so on light the face takes a Deep
   edge (11:1) and the button never relies on its label alone to be found. */
[data-theme="light"] .btn-primary .btn-face,
[data-theme="light"] .btn-primary:hover .btn-face {
  --edge: rgb(var(--c-accent));
}
.btn-primary {
  filter: drop-shadow(0 0 10px rgb(var(--c-accent) / 0.22));
}
.btn-primary:hover {
  filter: drop-shadow(0 0 16px rgb(var(--c-accent) / 0.45));
}
.btn-danger .btn-face {
  --edge: rgb(var(--p-danger));
  color: rgb(var(--p-danger));
}
.btn-danger:hover .btn-face {
  --edge: rgb(var(--p-danger));
  background: rgb(var(--p-danger) / 0.14);
  color: rgb(var(--p-danger));
}
.btn:active .btn-face {
  transform: translateY(1px);
}
.btn[aria-busy="true"] {
  cursor: wait;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Fields: square, on the page ground, with an edge strong enough to find. */
.field-label {
  display: block;
  font-size: var(--text-tool);
  font-weight: 600;
  color: rgb(var(--c-text-main));
}
.field {
  display: block;
  width: 100%;
  min-height: var(--control-height);
  margin-top: 0.375rem;
  /* The edge keeps 3:1 against the ground in both themes, and no more. */
  border: 1px solid rgb(var(--c-text-muted) / var(--field-edge-alpha));
  border-radius: 0;
  background-color: rgb(var(--c-background));
  padding: 0.5rem 0.75rem;
  color: rgb(var(--c-text-main));
  font: inherit;
  /* A field inside a bold label still reads as regular text. */
  font-weight: 400;
  font-size: 0.9375rem;
  line-height: 1.5;
  transition: border-color 0.2s ease;
}
.field::placeholder {
  color: rgb(var(--c-text-muted));
  opacity: 1;
}
.field:hover {
  border-color: rgb(var(--c-text-main));
}
/* An invalid field is explained by its message; the heavier edge is a second cue. */
.field[aria-invalid="true"] {
  border-width: 2px;
  border-color: rgb(var(--c-text-main));
}
.field:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* A quiet text link: underlined, so colour is never the only cue. */
.link {
  font-weight: 500;
  color: rgb(var(--c-heading));
  text-decoration: underline;
  text-decoration-color: rgb(var(--c-text-muted));
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
}
.link:hover {
  text-decoration-color: rgb(var(--c-accent));
  text-decoration-thickness: 2px;
}
a.hub-wordmark {
  text-decoration: none;
}

/* A region pinned to one theme, used by the gallery to show both at once. */
.hub-theme-pane {
  background: rgb(var(--c-background));
  color: rgb(var(--c-text-main));
  border: 1px solid var(--hairline-strong);
}

/* Status chips: always a word, tinted by tone. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  /* 0.75 alpha keeps the outline at 3:1 on the light surface as well. */
  border: 1px solid rgb(var(--chip, var(--c-text-muted)) / 0.75);
  padding: 0 0.5rem;
  font-size: var(--text-tool);
  font-weight: 500;
  line-height: 1.5rem;
  white-space: nowrap;
  color: rgb(var(--chip, var(--c-text-muted)));
}
.chip[data-tone="positive"] {
  --chip: var(--p-positive);
}
.chip[data-tone="caution"] {
  --chip: var(--p-caution);
}
.chip[data-tone="danger"] {
  --chip: var(--p-danger);
}
.chip[data-tone="info"] {
  --chip: var(--p-info);
}
.chip[data-tone="plain"] {
  --chip: var(--c-text-main);
}
.chip-swatch {
  width: 0.625rem;
  height: 0.625rem;
  flex: none;
  background: currentColor;
}

/* Name and value lines: dashboard figures, record summaries. */
.hub-lines > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  border-bottom: 1px solid var(--hairline);
  padding: 0.625rem 0;
}
.hub-lines dt {
  flex: 1 1 16rem;
  min-width: 0;
  color: rgb(var(--c-text-muted));
}
.hub-lines dd {
  margin: 0;
  font-weight: 600;
  color: rgb(var(--c-heading));
  font-variant-numeric: tabular-nums;
}

/* What a form or a check says back, with a tone-coloured left rule. */
.status-line {
  border-left: 2px solid rgb(var(--c-text-muted));
  padding: 0.125rem 0 0.125rem 0.75rem;
  color: rgb(var(--c-text-main));
}
.status-line[data-tone="error"] {
  border-left-color: rgb(var(--p-danger));
}
.status-line[data-tone="success"] {
  border-left-color: rgb(var(--p-positive));
}

.hub-main {
  min-width: 0;
  padding: 1.5rem 1rem 5rem;
}
.hub-main-inner {
  max-width: 80rem;
}
@media (min-width: 1024px) {
  .hub-main {
    padding: 2rem 2rem 6rem;
  }
}

/* Rail navigation: group labels, then links with an accent left rule when current. */
.hub-nav-group {
  display: flex;
  min-height: 2rem;
  align-items: center;
  justify-content: space-between;
  margin: 1.25rem 0 0.25rem;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(var(--c-text-muted));
}
.hub-nav-group:first-child {
  margin-top: 0;
}
.hub-nav-item {
  display: flex;
  width: 100%;
  min-height: var(--control-height);
  align-items: center;
  gap: 0.625rem;
  border: 0;
  border-left: 2px solid transparent;
  background: none;
  padding: 0.25rem 0.75rem;
  font: inherit;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  color: rgb(var(--c-text-main));
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}
.hub-nav-item:hover {
  background: rgb(var(--c-surface));
  color: rgb(var(--c-heading));
}
.hub-nav-item[aria-current="page"],
.hub-nav-item[data-status="active"] {
  border-left-color: rgb(var(--c-accent));
  background: rgb(var(--c-surface));
  font-weight: 700;
  color: rgb(var(--c-heading));
}
.hub-nav-item[data-depth="1"] {
  padding-left: 1.75rem;
}
.hub-nav-item[data-depth="2"] {
  padding-left: 2.75rem;
}
.hub-nav-item[data-depth="3"] {
  padding-left: 3.75rem;
}
.hub-dot {
  width: 0.625rem;
  height: 0.625rem;
  flex: none;
  background: var(--dot, rgb(var(--c-text-muted)));
}

/* Avatars: initials on a surface, chamfered like everything else. */
.hub-avatar {
  --ch: 6px;
  display: inline-grid;
  width: 2rem;
  height: 2rem;
  flex: none;
  place-items: center;
  background: rgb(var(--c-surface-hover));
  font-size: 0.75rem;
  font-weight: 700;
  color: rgb(var(--c-heading));
}

/* Tables: hairline rows, muted column headings, tabular numerals. */
.hub-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
.hub-table th[scope="col"] {
  border-bottom: 1px solid var(--hairline-strong);
  padding: 0.625rem 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  color: rgb(var(--c-text-muted));
}
.hub-table :where(td, th[scope="row"]) {
  height: var(--control-height);
  border-bottom: 1px solid var(--hairline);
  padding: 0.5rem 0.75rem;
  vertical-align: middle;
  overflow-wrap: anywhere;
}
.hub-table th[scope="row"] {
  font-weight: 600;
  color: rgb(var(--c-heading));
}
.hub-table tr > :is(th, td):first-child {
  padding-left: 0;
}
.hub-table tr > :is(th, td):last-child {
  padding-right: 0;
}

/* Tabs: a row of links, one current, with an accent underline. */
.hub-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.5rem;
  border-bottom: 1px solid var(--hairline);
}
.hub-tabs a {
  display: inline-flex;
  min-height: var(--control-height);
  align-items: center;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  font-weight: 500;
  text-decoration: none;
  color: rgb(var(--c-text-muted));
}
.hub-tabs a:hover {
  color: rgb(var(--c-heading));
}
.hub-tabs a[aria-current="page"],
.hub-tabs a[data-status="active"] {
  border-bottom-color: rgb(var(--c-accent));
  font-weight: 700;
  color: rgb(var(--c-heading));
}

/* Checkboxes take the primary colour; the label row is a full-height target. */
.hub-check {
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  margin: 0;
  accent-color: rgb(var(--c-accent));
}
.hub-check-row {
  display: flex;
  min-height: var(--control-height);
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
}
.hub-check-row:has(.hub-check:disabled) {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Gates (sign-in, setup, no access): the hero artwork, kept quiet, behind one panel. */
.hub-gate {
  position: relative;
  isolation: isolate;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  background: rgb(var(--c-background));
  padding: 2rem 1rem;
}
.hub-gate-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 78% 50%;
  opacity: 0.5;
}
.hub-gate::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgb(var(--c-background) / 0.62);
}
.hub-gate-panel {
  --ch: 14px;
  width: min(26rem, 100%);
  background: rgb(var(--c-surface));
  padding: 1.75rem;
}
/* Russo One is wide: at 1.625rem a gate title such as "Sign in to ReadyHub"
   stays on one line in the 26rem panel. */
.hub-gate-panel .hub-title {
  font-size: 1.625rem;
}

/* Tri-state permission cells: inherit, allow or deny, as on a Discord channel. */
/* Inherit, Allow or Deny: one segmented control per permission, in words. */
.hub-tri {
  --ch: 8px;
  display: inline-flex;
  gap: 0;
  border: 1px solid rgb(var(--c-text-main) / 0.18);
  background: rgb(var(--c-background));
  padding: 2px;
  clip-path: polygon(0 0, calc(100% - var(--ch)) 0, 100% var(--ch), 100% 100%, 0 100%);
}
.hub-tri button {
  display: inline-flex;
  min-height: 2.25rem;
  align-items: center;
  white-space: nowrap;
  border: 0;
  background: transparent;
  padding: 0 0.75rem;
  font: inherit;
  font-size: var(--text-tool);
  font-weight: 500;
  color: rgb(var(--c-text-muted));
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}
.hub-tri button:hover {
  color: rgb(var(--c-heading));
}
.hub-tri button[aria-pressed="true"] {
  background: rgb(var(--c-surface-hover));
  font-weight: 600;
  color: rgb(var(--c-heading));
}
.hub-tri button[data-state="allow"][aria-pressed="true"] {
  background: rgb(var(--p-positive) / 0.16);
  color: rgb(var(--p-positive));
}
.hub-tri button[data-state="deny"][aria-pressed="true"] {
  background: rgb(var(--p-danger) / 0.16);
  color: rgb(var(--p-danger));
}
.hub-tri button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
/* The control's cell never squeezes it; the permission's name wraps instead. */
.hub-table td:has(> .hub-tri) {
  width: 1%;
  white-space: nowrap;
}

/* Page tree rows: a disclosure toggle, the page link, and an add button. */
.hub-tree-row {
  display: flex;
  align-items: center;
}
.hub-tree-row .hub-nav-item {
  min-width: 0;
  flex: 1;
}
.hub-icon-btn {
  display: inline-grid;
  width: 2rem;
  height: var(--control-height);
  flex: none;
  place-items: center;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: rgb(var(--c-text-muted));
  cursor: pointer;
}
.hub-icon-btn:hover {
  color: rgb(var(--c-heading));
}

/* Breadcrumbs: muted links with a slash between them, the current page plain. */
.hub-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: rgb(var(--c-text-muted));
}
.hub-breadcrumb li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: rgb(var(--c-text-muted));
}
.hub-breadcrumb a {
  color: rgb(var(--c-text-muted));
  text-decoration: none;
}
.hub-breadcrumb a:hover {
  color: rgb(var(--c-heading));
  text-decoration: underline;
}

/* The page title is an input that reads as the display heading. */
.hub-page-title {
  width: 100%;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  padding: 0.25rem 0;
  font-family: var(--font-russo);
  font-synthesis: none;
  font-size: clamp(2rem, 5vw, var(--type-44));
  font-weight: 400;
  line-height: 1.05;
  color: rgb(var(--c-heading));
}
.hub-page-title::placeholder {
  color: rgb(var(--c-text-muted));
  opacity: 1;
}
.hub-page-title:hover:not(:disabled) {
  border-bottom-color: var(--hairline-strong);
}
.hub-page-title:disabled {
  cursor: default;
}
/* As a textarea it wraps a long title instead of cutting it off. */
textarea.hub-page-title {
  field-sizing: content;
  min-height: 1lh;
  overflow: hidden;
  resize: none;
}
.hub-page-icon {
  width: 3.5rem;
  height: 3.5rem;
  border: 1px solid transparent;
  background: none;
  padding: 0;
  font-size: 2rem;
  line-height: 1;
  text-align: center;
  color: rgb(var(--c-heading));
}
.hub-page-icon:hover:not(:disabled) {
  border-color: var(--hairline-strong);
}

/* The command palette: a modal over a dimmed hub, one field and a result list. */
.hub-palette {
  --ch: 14px;
  width: min(36rem, calc(100% - 2rem));
  margin: 10vh auto 0;
  border: 0;
  background: rgb(var(--c-surface));
  padding: 1rem;
  color: rgb(var(--c-text-main));
  overflow-x: hidden;
}
.hub-palette::backdrop {
  background: rgb(var(--c-ink) / 0.72);
}
.hub-palette-list {
  margin: 0.75rem 0 0;
  max-height: 50vh;
  overflow: hidden auto;
  padding: 0;
  list-style: none;
}
.hub-palette-item > span {
  min-width: 0;
}
.hub-palette-item {
  display: flex;
  width: 100%;
  min-height: var(--control-height);
  align-items: center;
  gap: 0.625rem;
  border: 0;
  border-left: 2px solid transparent;
  background: none;
  padding: 0.375rem 0.75rem;
  font: inherit;
  text-align: left;
  color: rgb(var(--c-text-main));
  cursor: pointer;
}
.hub-palette-item[aria-selected="true"],
.hub-palette-item:hover {
  border-left-color: rgb(var(--c-accent));
  background: rgb(var(--c-background));
  color: rgb(var(--c-heading));
}
.hub-palette-item mark {
  background: rgb(var(--c-accent) / 0.3);
  color: inherit;
}

/* Small text links in the rail headings and tables still get a 36px target. */
.hub-nav-group .link,
.hub-table a.link {
  display: inline-flex;
  min-height: var(--control-height-sm);
  align-items: center;
}

/* Wide tables scroll sideways on narrow screens. */
.hub-table-wrap {
  width: 100%;
  overflow-x: auto;
}

/* A pressed toggle (favourite, view as) keeps its label and shows its state. */
.btn[aria-pressed="true"] .btn-face {
  --edge: rgb(var(--c-accent));
  background: rgb(var(--c-surface-hover));
  color: rgb(var(--c-heading));
}

/* Callout block: a tone-coloured left rule, a tone word, then the text. */
.hub-callout {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 0.75rem;
  border-left: 3px solid rgb(var(--p-info));
  background: rgb(var(--c-background));
  padding: 0.75rem 1rem;
}
.hub-callout[data-tone="positive"] {
  border-left-color: rgb(var(--p-positive));
}
.hub-callout[data-tone="caution"] {
  border-left-color: rgb(var(--p-caution));
}
.hub-callout[data-tone="danger"] {
  border-left-color: rgb(var(--p-danger));
}
.hub-callout-tone {
  min-height: 1.75rem;
  flex: none;
  border: 1px solid rgb(var(--c-text-muted) / 0.75);
  background: none;
  padding: 0 0.5rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(var(--c-text-main));
  cursor: pointer;
}
.hub-callout-body {
  min-width: 0;
  flex: 1;
}

/* An inline link to another page: text with an accent underline, no chip. */
.hub-page-link {
  border-bottom: 1px solid rgb(var(--c-accent));
  font-weight: 600;
  text-decoration: none;
  color: rgb(var(--c-heading));
}
.hub-page-link:hover {
  background: rgb(var(--c-accent) / 0.18);
}

/* Drag targets in the page tree: an accent line above or below, or a ring to nest. */
.hub-tree-row[data-drop="before"] {
  box-shadow: inset 0 2px 0 rgb(var(--c-accent));
}
.hub-tree-row[data-drop="after"] {
  box-shadow: inset 0 -2px 0 rgb(var(--c-accent));
}
.hub-tree-row[data-drop="inside"] {
  outline: 1px solid rgb(var(--c-accent));
  outline-offset: -1px;
}
.hub-tree-row[draggable="true"] {
  cursor: grab;
}

/* Page cover: a wide banner above the title, cropped to a fixed height. */
.hub-cover {
  position: relative;
  width: 100%;
  height: 12rem;
  overflow: hidden;
  background: rgb(var(--c-surface));
}
.hub-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hub-cover-actions {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

/* Link prompt inside bookmark and embed blocks before they have a URL. */
.hub-link-form {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  border: 1px dashed var(--hairline-strong);
  padding: 0.75rem 1rem;
}

/* Bookmark card: text on the left, the page's image on the right. */
.hub-bookmark {
  display: flex;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--hairline-strong);
  background: rgb(var(--c-background));
  text-decoration: none;
  color: rgb(var(--c-text-main));
}
.hub-bookmark:hover {
  border-color: rgb(var(--c-accent));
}
.hub-bookmark-text {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
}
.hub-bookmark-title {
  font-weight: 600;
  color: rgb(var(--c-heading));
}
.hub-bookmark-image {
  width: 10rem;
  flex: none;
  object-fit: cover;
}

/* Embeds keep a 16:9 frame on the page ground. */
.hub-embed {
  width: 100%;
  background: rgb(var(--c-background));
}
.hub-embed iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--hairline-strong);
}

/* Databases (plan section 7): toolbar, table, board, gallery, calendar, peek. */
.hub-db-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 0.5rem;
}
.hub-db-toolbar .hub-tabs {
  border-bottom: 0;
  gap: 0 1rem;
}
.hub-db-toolbar .hub-tabs button {
  display: inline-flex;
  min-height: var(--control-height-sm);
  align-items: center;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  padding: 0 0.125rem;
  font: inherit;
  font-weight: 500;
  color: rgb(var(--c-text-muted));
  cursor: pointer;
}
.hub-db-toolbar .hub-tabs button[aria-current="true"] {
  border-bottom-color: rgb(var(--c-accent));
  font-weight: 700;
  color: rgb(var(--c-heading));
}

/* Popovers hang below their trigger; the parent is the positioning context. */
.hub-popover-anchor {
  position: relative;
}
.hub-popover {
  --ch: 10px;
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  z-index: 40;
  min-width: 16rem;
  max-width: min(28rem, 90vw);
  max-height: 24rem;
  overflow: hidden auto;
  background: rgb(var(--c-surface));
  padding: 0.5rem;
  box-shadow: var(--shadow-card);
}
.hub-popover[data-align="right"] {
  right: 0;
  left: auto;
}
.hub-menu-item {
  display: flex;
  width: 100%;
  min-height: var(--control-height-sm);
  align-items: center;
  gap: 0.5rem;
  border: 0;
  background: none;
  padding: 0.25rem 0.5rem;
  font: inherit;
  text-align: left;
  color: rgb(var(--c-text-main));
  cursor: pointer;
}
.hub-menu-item:hover,
.hub-menu-item[aria-selected="true"] {
  background: rgb(var(--c-background));
  color: rgb(var(--c-heading));
}

/* Option chips carry their colour as a swatch, never as a fill. */
.hub-option {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 0.375rem;
  border: 1px solid rgb(var(--c-text-muted) / 0.5);
  padding: 0 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.5rem;
  white-space: nowrap;
}
.hub-option-swatch {
  width: 0.5rem;
  height: 0.5rem;
  flex: none;
  background: var(--swatch, rgb(var(--c-text-muted)));
}

/* Table view: sticky header, resizable columns, cells that edit in place. */
.hub-db-table-wrap {
  overflow: auto;
  max-height: 70vh;
}
.hub-db-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  min-width: 100%;
}
.hub-db-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  border-bottom: 1px solid var(--hairline-strong);
  border-right: 1px solid var(--hairline);
  background: rgb(var(--c-background));
  padding: 0;
  text-align: left;
  font-weight: 600;
  color: rgb(var(--c-text-muted));
}
.hub-db-th {
  position: relative;
  display: flex;
  min-height: var(--control-height-sm);
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  overflow: hidden;
  white-space: nowrap;
}
.hub-db-resize {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  border: 0;
  background: none;
  padding: 0;
  cursor: col-resize;
}
.hub-db-resize:hover {
  background: rgb(var(--c-accent) / 0.5);
}
.hub-db-table td {
  border-bottom: 1px solid var(--hairline);
  border-right: 1px solid var(--hairline);
  padding: 0;
  vertical-align: top;
}
.hub-cell {
  display: flex;
  min-height: var(--control-height-sm);
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  overflow: hidden;
  flex-wrap: wrap;
}
.hub-cell[data-editable="true"] {
  cursor: text;
}
.hub-cell[data-editable="true"]:hover {
  background: rgb(var(--c-surface));
}
.hub-cell-input {
  width: 100%;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
}
.hub-cell-input:focus {
  outline: 2px solid rgb(var(--c-focus));
  outline-offset: 1px;
}
.hub-db-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0 0.25rem;
  font-weight: 600;
  color: rgb(var(--c-heading));
}

/* Board: columns in a horizontal scroller, cards on the surface. */
.hub-board {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.hub-board-column {
  width: 16rem;
  flex: none;
  background: rgb(var(--c-background-soft));
  padding: 0.5rem;
}
.hub-board-column[data-drop="true"] {
  outline: 1px solid rgb(var(--c-accent));
}
.hub-card {
  --ch: 8px;
  display: block;
  width: 100%;
  margin-top: 0.5rem;
  background: rgb(var(--c-surface));
  padding: 0.625rem 0.75rem;
  text-align: left;
  color: rgb(var(--c-text-main));
  cursor: pointer;
}
.hub-card:hover {
  background: rgb(var(--c-surface-hover));
}
.hub-card-title {
  display: block;
  font-weight: 600;
  color: rgb(var(--c-heading));
}

/* Gallery: a responsive grid of cards with an optional cover. */
.hub-gallery {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
}
.hub-gallery[data-size="small"] {
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
}
.hub-gallery[data-size="large"] {
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
}
.hub-card-cover {
  display: block;
  width: 100%;
  height: 7rem;
  object-fit: cover;
  background: rgb(var(--c-background-soft));
}

/* Calendar: a real table, seven columns, six weeks. */
.hub-calendar {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.hub-calendar-day {
  height: 6rem;
  border: 1px solid var(--hairline);
  padding: 0.25rem;
  vertical-align: top;
}
.hub-calendar-day[data-outside="true"] {
  color: rgb(var(--c-text-muted));
  background: rgb(var(--c-background-soft));
}
.hub-calendar-day[data-today="true"] .hub-calendar-date {
  color: rgb(var(--c-accent));
  font-weight: 700;
}
.hub-calendar-head {
  padding: 0.25rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgb(var(--c-text-muted));
}
.hub-calendar-event {
  display: block;
  width: 100%;
  margin-top: 0.125rem;
  border: 0;
  border-left: 2px solid rgb(var(--c-accent));
  background: rgb(var(--c-surface));
  padding: 0.125rem 0.375rem;
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  color: rgb(var(--c-text-main));
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Side peek: a drawer on the right for one row. */
.hub-peek {
  position: fixed;
  inset: 3.5rem 0 0 auto;
  z-index: 35;
  width: min(34rem, 100vw);
  overflow-y: auto;
  border-left: 1px solid var(--hairline-strong);
  background: rgb(var(--c-background));
  padding: 1rem 1.25rem 3rem;
  box-shadow: var(--shadow-card);
}
.hub-props {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr);
  gap: 0;
}
.hub-props > dt {
  display: flex;
  min-height: var(--control-height-sm);
  align-items: center;
  padding: 0.25rem 0;
  color: rgb(var(--c-text-muted));
}
.hub-props > dd {
  margin: 0;
  border-bottom: 1px solid var(--hairline);
}

/* An inline database inside the editor takes the full content width. */
.hub-db-block {
  width: 100%;
  margin: 0.5rem 0;
}

/* ---------------------------------------------------------------------------
 * Phase 3: sharing, comments, inbox and the public reader.
 * ------------------------------------------------------------------------- */

/* A wider modal than the palette, for the share dialog and similar forms. */
.hub-dialog {
  width: min(44rem, calc(100% - 2rem));
  max-height: calc(100vh - 12vh - 2rem);
  overflow-y: auto;
}

/* One principal or link per row inside the share dialog. */
.hub-share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--hairline);
}
.hub-share-row:last-child {
  border-bottom: 0;
}
.hub-share-row[data-muted="true"] {
  opacity: 0.55;
}

/* The public reader: top bar and page, no rail. */
.hub-public {
  min-height: 100vh;
  background: rgb(var(--c-background));
  color: rgb(var(--c-text-main));
}
.hub-public .hub-main {
  max-width: 56rem;
  margin: 0 auto;
}

/* Comments: threads, replies and the mention composer. */
.hub-mention {
  display: inline-block;
  padding: 0 0.3em;
  font-weight: 600;
  color: rgb(var(--c-heading));
  background: rgb(var(--c-accent) / 0.14);
  border-bottom: 1px solid rgb(var(--c-accent) / 0.8);
}
.hub-mention[data-kind="r"] {
  background: rgb(var(--c-accent) / 0.14);
  border-bottom-color: rgb(var(--c-accent) / 0.8);
}
.hub-composer {
  position: relative;
}
.hub-composer .hub-popover {
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 40;
  min-width: 16rem;
  margin-top: 0.25rem;
}
.hub-thread {
  padding: 0.75rem 0;
  border-top: 1px solid var(--hairline);
}
.hub-thread[data-resolved="true"] {
  opacity: 0.7;
}
.hub-comment {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.25rem 0;
}
.hub-replies {
  margin: 0.25rem 0 0 2.5rem;
  border-left: 2px solid var(--hairline-strong);
  padding-left: 0.75rem;
}
@media (max-width: 640px) {
  .hub-replies {
    margin-left: 1rem;
  }
}
/* A block the comments panel pointed at. */
.hub-block-flash {
  outline: 2px solid rgb(var(--c-accent));
  outline-offset: 4px;
  transition: outline-color 1.2s ease;
}
/* Inbox rows. */
.hub-inbox-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.25rem 0.75rem;
  align-items: start;
  padding: 0.75rem 0;
  border-top: 1px solid var(--hairline);
}
.hub-inbox-item[data-unread="true"] .hub-inbox-title {
  font-weight: 600;
  color: rgb(var(--c-heading));
}
.hub-inbox-dot {
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.45rem;
  background: rgb(var(--c-accent));
}
.hub-inbox-item[data-unread="false"] .hub-inbox-dot {
  background: transparent;
  border: 1px solid var(--hairline-strong);
}
.hub-dialog-wide {
  width: min(64rem, calc(100% - 2rem));
}

/* Ownership line under a page title. */
.hub-ownership {
  margin-top: 0.75rem;
}
.hub-ownership .link {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

/* External link chips: provider word, title, live state. */
.hub-link-chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  max-width: 100%;
  margin: 0.25rem 0;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--hairline-strong);
  background: rgb(var(--c-surface-hover));
  color: rgb(var(--c-text-main));
  text-decoration: none;
}
.hub-link-chip:hover {
  border-color: rgb(var(--c-accent));
}
.hub-link-chip-provider {
  font-family: var(--font-russo);
  font-synthesis: none;
  font-size: 0.75rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgb(var(--c-text-muted));
}
.hub-link-chip-title {
  font-weight: 600;
  color: rgb(var(--c-heading));
}

/* Print view: a plain page, controls hidden on paper. */
.hub-print {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1rem;
}
.hub-print .bn-editor {
  padding-inline: 0;
  min-height: 0;
}
@media print {
  .hub-print-controls,
  .hub-topbar {
    display: none !important;
  }
  body {
    background: rgb(var(--c-paper));
  }
}

/* ---------------------------------------------------------------------------
 * Hub Calendar (Phase 4). Events are tinted with their calendar colour over
 * the surface, with a solid edge, so text keeps the heading colour's contrast.
 * ------------------------------------------------------------------------- */

.hub-cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}
.hub-cal-title {
  flex: 1 1 14rem;
  font-size: 1.75rem;
}
.hub-cal-quick {
  flex: 1 1 100%;
}
.hub-cal-quick .field {
  width: 100%;
}
.hub-cal-toolbar .hub-tabs {
  margin: 0;
}
.hub-cal-toolbar .hub-tabs button {
  border: 0;
  background: none;
  padding: 0.4rem 0.6rem;
  font: inherit;
  color: rgb(var(--c-text-muted));
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.hub-cal-toolbar .hub-tabs button[aria-current="true"] {
  color: rgb(var(--c-heading));
  border-bottom-color: rgb(var(--c-accent));
}
.hub-cal-layout {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}
@media (min-width: 1100px) {
  .hub-cal-layout {
    grid-template-columns: 15rem minmax(0, 1fr);
  }
}
.hub-cal-side {
  min-width: 0;
}
.hub-cal-main {
  min-width: 0;
}
/* Below the two-column width the view comes first and the mini-month after it. */
@media (max-width: 1099px) {
  .hub-cal-main {
    order: -1;
  }
}
.hub-cal-swatch {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  flex: none;
  background: var(--event);
}

/* Mini month */
.hub-cal-mini-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  margin-top: 0.5rem;
  text-align: center;
}
.hub-cal-mini-day {
  min-height: 1.9rem;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.8rem;
  color: rgb(var(--c-text-main));
  cursor: pointer;
}
.hub-cal-mini-day:hover {
  background: rgb(var(--c-surface-hover));
}
.hub-cal-mini-day[data-outside="true"] {
  color: rgb(var(--c-text-muted));
}
.hub-cal-mini-day[data-today="true"] {
  font-weight: 700;
  color: rgb(var(--c-signal));
}
.hub-cal-mini-day[aria-current="date"] {
  outline: 1px solid rgb(var(--c-accent));
  outline-offset: -1px;
}

/* Day and week grid */
.hub-cal-grid {
  --gutter: 3.5rem;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: calc(100vh - 15rem);
  min-height: 28rem;
  border: 1px solid var(--hairline);
  background: rgb(var(--c-surface));
  user-select: none;
}
.hub-cal-head,
.hub-cal-allday,
.hub-cal-body {
  display: grid;
  grid-template-columns: repeat(var(--zones), var(--gutter)) repeat(var(--days), minmax(0, 1fr));
}
.hub-cal-head {
  border-bottom: 1px solid var(--hairline);
}
.hub-cal-zone {
  align-self: end;
  padding: 0.35rem 0.25rem;
  font-size: 0.7rem;
  color: rgb(var(--c-text-muted));
  text-align: right;
}
.hub-cal-dayhead {
  border: 0;
  border-left: 1px solid var(--hairline);
  background: none;
  padding: 0.5rem 0.25rem;
  font: inherit;
  font-weight: 600;
  color: rgb(var(--c-heading));
  cursor: pointer;
}
.hub-cal-dayhead[aria-current="date"] {
  color: rgb(var(--c-signal));
  box-shadow: inset 0 -2px 0 rgb(var(--c-accent));
}
.hub-cal-allday {
  border-bottom: 1px solid var(--hairline-strong);
  min-height: 2rem;
}
.hub-cal-allday-label {
  align-self: center;
}
.hub-cal-allday-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 2px;
  border-left: 1px solid var(--hairline);
}
.hub-cal-allday-cell[data-target="true"] {
  background: rgb(var(--c-accent) / 0.08);
}
.hub-cal-scroll {
  overflow-y: auto;
  min-height: 0;
}
.hub-cal-body {
  position: relative;
}
.hub-cal-gutter {
  position: relative;
}
.hub-cal-hour {
  position: absolute;
  right: 0.35rem;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: rgb(var(--c-text-muted));
  font-variant-numeric: tabular-nums;
}
.hub-cal-column {
  position: relative;
  min-width: 0;
  border-left: 1px solid var(--hairline);
  background-image: repeating-linear-gradient(
    to bottom,
    var(--hairline) 0,
    var(--hairline) 1px,
    transparent 1px,
    transparent 48px
  );
  cursor: crosshair;
}
/* Today is marked by the accent rule under its date; the column itself only
   lifts a little, since red is never a wash. */
.hub-cal-column[data-today="true"] {
  background-color: rgb(var(--c-text-main) / 0.025);
}
.hub-cal-now {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: rgb(var(--c-accent));
  pointer-events: none;
  z-index: 3;
}
.hub-cal-ghost {
  position: absolute;
  left: 2px;
  right: 2px;
  border: 1px dashed rgb(var(--c-accent));
  background: rgb(var(--c-accent) / 0.12);
  pointer-events: none;
  z-index: 4;
}

/* Events */
.hub-cal-event {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  border-left: 3px solid var(--event);
  background: color-mix(in srgb, var(--event) 20%, rgb(var(--c-surface)));
  padding: 1px 4px;
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.25;
  text-align: left;
  color: rgb(var(--c-heading));
  cursor: pointer;
}
.hub-cal-column .hub-cal-event {
  position: absolute;
  z-index: 2;
}
.hub-cal-event:hover {
  background: color-mix(in srgb, var(--event) 32%, rgb(var(--c-surface)));
}
.hub-cal-event:focus-visible {
  outline: 2px solid rgb(var(--c-focus));
  outline-offset: 1px;
  z-index: 5;
}
.hub-cal-event[data-kind="database"],
.hub-cal-event[data-kind="github"] {
  border-left-style: dashed;
}
.hub-cal-event[data-declined="true"] .hub-cal-event-title {
  text-decoration: line-through;
}
.hub-cal-event-title {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-cal-event-time {
  overflow: hidden;
  color: rgb(var(--c-text-main));
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-cal-resize {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  cursor: ns-resize;
}

/* Month grid */
.hub-cal-month {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: rgb(var(--c-surface));
  user-select: none;
}
.hub-cal-month th {
  padding: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(var(--c-text-muted));
  text-align: left;
}
.hub-cal-month td {
  height: 7rem;
  padding: 2px;
  vertical-align: top;
  border: 1px solid var(--hairline);
}
.hub-cal-month td[data-outside="true"] {
  background: rgb(var(--c-background-soft) / 0.5);
}
.hub-cal-month td[data-target="true"] {
  background: rgb(var(--c-accent) / 0.08);
}
.hub-cal-month td .hub-cal-event {
  margin-top: 2px;
  width: 100%;
}
.hub-cal-date {
  display: inline-grid;
  min-width: 1.6rem;
  height: 1.6rem;
  place-items: center;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.8rem;
  color: rgb(var(--c-text-main));
  cursor: pointer;
}
.hub-cal-month td[data-today="true"] .hub-cal-date {
  /* Ink on Teal (dark) and Snow on Deep (light) both pass at this size. */
  background: rgb(var(--c-accent));
  color: rgb(var(--c-on-accent));
  font-weight: 700;
}
.hub-cal-more {
  display: block;
  margin-top: 2px;
  font-size: 0.75rem;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

/* Event panel and the scope choice */
.hub-cal-panel {
  z-index: 40;
}
.hub-cal-scope {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.5rem 0;
}
.hub-cal-account {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  border: 1px solid var(--hairline);
  background: rgb(var(--c-background-soft));
}

/* An empty status line reserves no space and draws no rule. */
.status-line:empty {
  border-left: 0;
  padding: 0;
}

.hub-h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  color: rgb(var(--c-heading));
}

/* Forms (plan section 9.4): the public page and the builder. */
.hub-form-page {
  max-width: 40rem;
  margin: 0 auto;
}
.hub-form-intro {
  white-space: pre-line;
  color: rgb(var(--c-text-main));
}
.hub-form-field[data-invalid="true"] {
  border-left: 3px solid rgb(var(--p-danger));
  padding-left: 0.75rem;
}
.hub-form-choices {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  border: 0;
  margin: 0;
  padding: 0;
}
.hub-form-field[data-invalid="true"].hub-form-choices {
  padding-left: 0.75rem;
}
.hub-form-error {
  display: block;
  font-weight: 600;
  color: rgb(var(--p-danger));
}
.hub-form-summary {
  --ch: 10px;
  border: 2px solid rgb(var(--p-danger));
  padding: 1rem;
  margin-bottom: 1.5rem;
  background: rgb(var(--c-surface));
}
.hub-form-summary ul {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.hub-form-section {
  border-top: 1px solid var(--hairline);
  padding-top: 1.25rem;
}
/* Off-screen for people, still filled in by bots. */
.hub-honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.hub-turnstile {
  min-height: 65px;
}
.hub-form-question {
  padding: 0.75rem;
  border: 1px solid var(--hairline);
  background: rgb(var(--c-background-soft));
}
.hub-form-builder-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1100px) {
  .hub-form-builder-grid {
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    align-items: start;
  }
  .hub-form-preview {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 6rem);
    overflow: auto;
  }
}
.hub-form-url {
  font-family: var(--font-code);
  font-size: 0.8125rem;
  padding: 0.125rem 0.375rem;
  background: rgb(var(--c-background-soft));
  overflow-wrap: anywhere;
}
.hub-form-title-input {
  font-size: 1.25rem;
  font-weight: 600;
}

/* Public views (plan section 9.10): the bug board, roadmaps and the status page. */
.hub-public-view {
  min-width: 0;
}
.hub-public-table {
  overflow-x: auto;
}
.hub-public-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.hub-public-table th,
.hub-public-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--hairline);
}
.hub-public-table thead th {
  color: rgb(var(--c-text-muted));
  font-weight: 600;
  white-space: nowrap;
}
.hub-public-table tbody th {
  font-weight: 400;
}
.hub-public-card {
  padding: 0.75rem 1rem;
  border: 1px solid var(--hairline);
  background: rgb(var(--c-surface));
}
.hub-public-board {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18.75rem), 1fr));
  align-items: start;
}
.hub-public-facts {
  display: grid;
  gap: 0.75rem 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}
.hub-public-facts dd {
  margin-top: 0.125rem;
}
.hub-public-history {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-left: 2px solid var(--hairline);
  padding-left: 1rem;
}
.hub-public-history li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.75rem;
  align-items: baseline;
}
/* The status page's one-line verdict. The tone shows as a rule, never a red wash. */
.hub-status-banner {
  --ch: 12px;
  padding: 1rem 1.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: rgb(var(--c-heading));
  background: rgb(var(--c-surface));
  border-left: 6px solid rgb(var(--c-text-muted));
}
.hub-status-banner[data-tone="positive"] {
  border-left-color: rgb(var(--p-positive));
}
.hub-status-banner[data-tone="caution"] {
  border-left-color: rgb(var(--p-caution));
}
.hub-status-banner[data-tone="danger"] {
  border-left-color: rgb(var(--p-danger));
}

/* Dashboard widgets (plan section 9.12). Numbers always print as text beside the shapes. */
.hub-widget-block {
  width: 100%;
}
.hub-widget {
  --ch: 12px;
  width: 100%;
  padding: 1rem;
  background: rgb(var(--c-surface));
}
.hub-widget-stat {
  display: flex;
  flex-direction: column;
}
.hub-widget-stat-value {
  font-family: var(--font-russo);
  font-synthesis: none;
  font-size: 2.5rem;
  font-weight: 400;
  line-height: 1.1;
  color: rgb(var(--c-heading));
  font-variant-numeric: tabular-nums;
}
.hub-widget-bars {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}
.hub-widget-bars li {
  display: grid;
  grid-template-columns: minmax(5rem, 9rem) 1fr auto;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}
.hub-widget-bar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-widget-bar-track {
  height: 0.75rem;
  background: rgb(var(--c-background-soft));
}
.hub-widget-bar {
  display: block;
  height: 100%;
  min-width: 2px;
  outline: 1px solid rgb(var(--c-text-muted) / 0.6);
  outline-offset: -1px;
}
.hub-widget-bar-value {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: rgb(var(--c-heading));
}
.hub-widget-pie {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
.hub-widget-legend {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 12rem;
  max-width: 24rem;
  flex: 1;
  font-size: 0.875rem;
}
.hub-widget-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.hub-widget-line svg {
  width: 100%;
  height: 7.5rem;
}
.hub-widget-line-axis {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.hub-widget-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  list-style: decimal;
  padding-left: 1.25rem;
}
.hub-widget-list li {
  display: list-item;
}
.hub-widget-list li > span {
  margin-left: 0.5rem;
}
.hub-widget-settings {
  border-top: 1px solid var(--hairline);
  padding-top: 0.75rem;
}

/* Rota view (plan section 9.13): people down the side, days across. */
.hub-rota-scroll {
  overflow-x: auto;
  border: 1px solid var(--hairline);
}
.hub-rota-grid {
  width: 100%;
  min-width: 56rem;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.8125rem;
}
.hub-rota-grid th,
.hub-rota-grid td {
  border: 1px solid var(--hairline);
  padding: 0.375rem;
  vertical-align: top;
  text-align: left;
}
.hub-rota-grid thead th {
  background: rgb(var(--c-background-soft));
  font-weight: 600;
  color: rgb(var(--c-heading));
}
.hub-rota-grid thead th[aria-current="date"] {
  box-shadow: inset 0 -2px 0 rgb(var(--c-accent));
}
.hub-rota-corner {
  width: 9rem;
}
.hub-rota-grid tbody th {
  font-weight: 600;
  color: rgb(var(--c-heading));
  background: rgb(var(--c-background-soft));
}
.hub-rota-grid td[data-over="true"] {
  background: rgb(var(--c-accent) / 0.12);
}
.hub-rota-coverage {
  display: block;
  font-weight: 400;
  color: rgb(var(--c-text-muted));
}
.hub-rota-coverage[data-short="true"] {
  color: rgb(var(--p-danger));
  font-weight: 600;
}
.hub-rota-shift {
  display: flex;
  flex-direction: column;
  width: 100%;
  margin-bottom: 0.25rem;
  padding: 0.25rem 0.375rem;
  text-align: left;
  background: rgb(var(--c-surface));
  border-left: 3px solid rgb(var(--c-accent));
  cursor: grab;
  touch-action: none;
}
.hub-rota-shift:focus-visible {
  outline: 2px solid rgb(var(--c-focus));
  outline-offset: 1px;
}
.hub-rota-shift[data-live="true"] {
  border-left-color: rgb(var(--p-positive));
}
.hub-rota-shift-title {
  font-weight: 600;
  color: rgb(var(--c-heading));
  overflow-wrap: anywhere;
}
.hub-rota-shift-time {
  color: rgb(var(--c-text-muted));
  font-size: 0.75rem;
}
.hub-rota-live {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgb(var(--p-positive));
}
.hub-rota-add {
  display: block;
  width: 100%;
  min-height: 1.75rem;
  color: rgb(var(--c-text-muted));
  border: 1px dashed transparent;
}
.hub-rota-add:hover,
.hub-rota-add:focus-visible {
  border-color: rgb(var(--c-text-muted) / 0.6);
  color: rgb(var(--c-heading));
}
.hub-rota-settings summary {
  cursor: pointer;
  font-weight: 600;
  color: rgb(var(--c-heading));
}

/* Booking pages (plan section 10): slot buttons visitors choose from. */
.hub-book-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
  gap: 0.5rem;
}
.hub-book-slot {
  min-height: 2.75rem;
  padding: 0.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: rgb(var(--c-heading));
  background: rgb(var(--c-surface));
  border: 1px solid rgb(var(--c-text-muted) / 0.6);
}
.hub-book-slot:hover {
  border-color: rgb(var(--c-accent));
}
/* Chosen: a heavy accent edge and a tick, so the state never rests on colour alone. */
.hub-book-slot[aria-pressed="true"] {
  background: rgb(var(--c-accent) / 0.14);
  border: 2px solid rgb(var(--c-accent));
}
.hub-book-slot[aria-pressed="true"]::before {
  content: "✓ ";
}
.hub-book-slot:focus-visible {
  outline: 2px solid rgb(var(--c-focus));
  outline-offset: 2px;
}

/* Agenda view (plan Phase 5): the next two weeks as a list, for phones and the installed app. */
.hub-agenda {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.hub-agenda h2[aria-current="date"] {
  color: rgb(var(--c-signal));
}
.hub-agenda-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
  min-height: 2.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--hairline);
}
.hub-agenda-time {
  min-width: 8rem;
  font-variant-numeric: tabular-nums;
  color: rgb(var(--c-text-muted));
  font-size: 0.875rem;
}
.hub-agenda-title {
  text-align: left;
  font-weight: 600;
}

/* ---------------------------------------------------------------------------
 * Phase 6: automations, webhooks, the API, trackers and GitHub.
 * ------------------------------------------------------------------------- */

.status-line[data-tone="caution"] {
  border-left-color: rgb(var(--p-caution));
}
/* A panel whose state needs attention: a caution edge, never a wash. */
.hub-panel[data-tone="caution"] {
  box-shadow: inset 3px 0 0 rgb(var(--p-caution));
}

/* The rule editor's When, Only if, Then and Runs as steps. */
.hub-rule-step {
  border: 0;
  border-top: 1px solid var(--hairline);
  padding: 1rem 0 0;
  margin-inline: 0;
  min-width: 0;
}
.hub-rule-legend {
  font-family: var(--font-russo);
  font-synthesis: none;
  font-size: 0.8125rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--c-signal));
  padding: 0 0 0.5rem;
}
.hub-rule-action {
  padding: 0.75rem;
  border: 1px solid var(--hairline);
  background: rgb(var(--c-background) / 0.4);
}
.hub-rule-number {
  display: inline-flex;
  width: 1.5rem;
  height: 1.5rem;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
  color: rgb(var(--c-heading));
  border: 1px solid var(--hairline-strong);
}

/* A run in the history: status, rule, time; opens to its steps. */
.hub-run-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  cursor: pointer;
}
.hub-run-summary::-webkit-details-marker {
  display: none;
}
.hub-run-summary::before {
  content: "▸";
  color: rgb(var(--c-text-muted));
}
details[open] > .hub-run-summary::before {
  content: "▾";
}
li[data-ok="false"] {
  color: rgb(var(--p-danger));
}

/* A secret shown once: caution edge, monospaced value that wraps. */
.hub-secret {
  padding: 0.75rem 1rem;
  border-left: 3px solid rgb(var(--p-caution));
  background: rgb(var(--c-background) / 0.5);
}
.hub-secret-value {
  display: block;
  white-space: pre-wrap;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-code);
  font-size: 0.8125rem;
  word-break: break-all;
  color: rgb(var(--c-heading));
  background: rgb(var(--c-surface));
  border: 1px solid var(--hairline-strong);
}
/* Raw JSON in a payload or delivery log. */
.hub-json {
  max-height: 16rem;
  overflow: auto;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-code);
  font-size: 0.75rem;
  white-space: pre-wrap;
  word-break: break-word;
  background: rgb(var(--c-background) / 0.5);
  border: 1px solid var(--hairline);
}

/* A group label inside a popover menu, such as "Share and collect". */
.hub-menu-heading {
  display: block;
  padding: 0.5rem 0.5rem 0.125rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--c-text-muted));
  border-top: 1px solid var(--hairline);
  margin-top: 0.25rem;
}

/* A branch name to copy, beside its button. */
.hub-branch {
  padding: 0.125rem 0.5rem;
  font-family: var(--font-code);
  font-size: 0.8125rem;
  color: rgb(var(--c-heading));
  background: rgb(var(--c-background) / 0.5);
  border: 1px solid var(--hairline-strong);
  word-break: break-all;
}

/* LiteBans moderation lists: player heads, the console's mark, readable reasons. */
.hub-head {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  image-rendering: pixelated;
  background: rgb(var(--c-surface-hover));
}
.hub-head-console {
  display: inline-grid;
  place-items: center;
  font-family: var(--font-code);
  font-size: 0.6875rem;
  font-weight: 700;
  color: rgb(var(--c-heading));
}
.hub-head-large {
  width: 4rem;
  height: 4rem;
  image-rendering: pixelated;
  background: rgb(var(--c-surface-hover));
}
.hub-punishment-reason {
  min-width: 12rem;
  max-width: 28rem;
}
/* Names and buttons never break mid-word; the table scrolls sideways instead. */
.hub-punishments th[scope="row"],
.hub-punishments td:nth-child(2),
.hub-punishments .btn {
  white-space: nowrap;
}

/*
 * Josh, the AI assistant. His orb is the one round thing in the Hub: a dark
 * sphere with ribbons of Teal and Mint light circling inside, so it
 * reads as alive rather than as a control. Everything around it keeps the
 * cut corners. The dark core is the Ink ground in both themes.
 */
.hub-orb {
  --orb-glow: rgb(var(--c-teal) / 0.4);
  position: relative;
  display: inline-block;
  flex: none;
  isolation: isolate;
  overflow: hidden;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 62%,
    rgb(var(--c-deep) / 0.85) 0%,
    rgb(var(--c-ink)) 62%
  );
  box-shadow:
    inset 0 0 0 1px rgb(var(--c-mint) / 0.22),
    inset 0 -0.2em 0.9em rgb(var(--c-mint) / 0.3),
    0 0 1.5em var(--orb-glow);
  animation: hub-orb-breathe 5s ease-in-out infinite;
}
.hub-orb-ribbon {
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 60deg,
    rgb(var(--c-mint)) 100deg,
    transparent 125deg 360deg
  );
  filter: blur(var(--orb-blur, 4px));
  mix-blend-mode: screen;
  animation: hub-orb-spin 7s linear infinite;
}
.hub-orb-ribbon-b {
  inset: 4%;
  background: conic-gradient(
    from 150deg,
    transparent 0deg 70deg,
    rgb(var(--c-teal)) 110deg,
    transparent 140deg 360deg
  );
  animation-duration: 10s;
  animation-direction: reverse;
}
.hub-orb-ribbon-c {
  inset: 16%;
  background: conic-gradient(
    from 260deg,
    transparent 0deg 50deg,
    rgb(var(--c-teal)) 90deg,
    rgb(var(--c-mint) / 0.8) 115deg,
    transparent 140deg 360deg
  );
  animation-duration: 13s;
}
.hub-orb-core {
  position: absolute;
  inset: 32%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgb(var(--c-mint) / 0.9) 0%,
    rgb(var(--c-teal) / 0.45) 50%,
    transparent 75%
  );
  filter: blur(var(--orb-blur, 4px));
  mix-blend-mode: screen;
  animation: hub-orb-core 5s ease-in-out infinite;
}
.hub-orb[data-state="listening"] {
  --orb-glow: rgb(var(--c-mint) / 0.65);
}
.hub-orb[data-state="listening"] .hub-orb-core {
  inset: 22%;
  animation-duration: 1.2s;
}
.hub-orb[data-state="thinking"] {
  --orb-glow: rgb(var(--c-teal) / 0.6);
  animation-duration: 1.8s;
}
.hub-orb[data-state="thinking"] .hub-orb-ribbon {
  animation-duration: 1.4s;
}
.hub-orb[data-state="thinking"] .hub-orb-ribbon-b {
  animation-duration: 2s;
}
.hub-orb[data-state="thinking"] .hub-orb-ribbon-c {
  animation-duration: 2.6s;
}
.hub-orb[data-state="speaking"] {
  --orb-glow: rgb(var(--c-mint) / 0.55);
  animation: hub-orb-speak 0.9s ease-in-out infinite;
}
.hub-orb[data-state="speaking"] .hub-orb-ribbon {
  animation-duration: 3.5s;
}
.hub-orb[data-state="speaking"] .hub-orb-core {
  animation-duration: 0.9s;
}
.hub-orb[data-still],
.hub-orb[data-still] .hub-orb-ribbon,
.hub-orb[data-still] .hub-orb-core {
  animation: none;
}
.hub-orb[data-still] {
  box-shadow:
    inset 0 0 0 1px rgb(var(--c-mint) / 0.22),
    inset 0 -0.2em 0.9em rgb(var(--c-mint) / 0.3);
}
@keyframes hub-orb-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}
@keyframes hub-orb-speak {
  0%,
  100% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.06);
  }
  60% {
    transform: scale(0.98);
  }
}
@keyframes hub-orb-spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes hub-orb-core {
  0%,
  100% {
    opacity: 0.7;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.12);
  }
}

/* The launcher floats bottom right, under side panels so it never covers them. */
.hub-orb-launcher {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 30;
  display: grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: none;
  padding: 0;
  cursor: pointer;
}
.hub-orb-launcher:hover .hub-orb {
  --orb-glow: rgb(var(--c-mint) / 0.65);
}
.hub-orb-launcher:focus-visible {
  outline-offset: 3px;
}
@media print {
  .hub-orb-launcher,
  .hub-josh-nudge {
    display: none;
  }
}

/* Josh's occasional tip: a speech bubble beside the orb, pointing at him. */
.hub-josh-nudge {
  position: fixed;
  right: 5.25rem;
  bottom: 1.5rem;
  z-index: 30;
  display: flex;
  max-width: min(20rem, calc(100vw - 7rem));
  align-items: flex-start;
  border: 1px solid rgb(var(--c-text-main) / 0.14);
  background: rgb(var(--c-surface));
  box-shadow: var(--shadow-card);
  color: rgb(var(--c-text-main));
  animation: hub-josh-nudge-in 0.25s ease-out;
}
.hub-josh-nudge::after {
  content: "";
  position: absolute;
  right: -7px;
  bottom: 1.125rem;
  width: 12px;
  height: 12px;
  border-top: 1px solid rgb(var(--c-text-main) / 0.14);
  border-right: 1px solid rgb(var(--c-text-main) / 0.14);
  background: rgb(var(--c-surface));
  transform: rotate(45deg);
}
.hub-josh-nudge-text {
  flex: 1 1 auto;
  min-height: var(--control-height);
  border: 0;
  background: none;
  padding: 0.625rem 0.25rem 0.625rem 0.875rem;
  font: inherit;
  font-size: var(--text-tool);
  line-height: 1.4;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
.hub-josh-nudge-text:focus-visible,
.hub-josh-nudge-close:focus-visible {
  outline-offset: -2px;
}
.hub-josh-nudge-who {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgb(var(--c-text-muted));
}
.hub-josh-nudge:hover .hub-josh-nudge-text {
  color: rgb(var(--c-heading));
}
.hub-josh-nudge-close {
  display: grid;
  width: var(--control-height-sm);
  height: var(--control-height-sm);
  flex: none;
  place-items: center;
  border: 0;
  background: none;
  color: rgb(var(--c-text-muted));
  cursor: pointer;
}
.hub-josh-nudge-close:hover {
  background: rgb(var(--c-surface-hover));
  color: rgb(var(--c-text-main));
}
@keyframes hub-josh-nudge-in {
  from {
    opacity: 0;
    transform: translateX(0.75rem) scale(0.96);
  }
}

/*
 * The panel: a calm card near the bottom of the screen over a softened hub.
 * Its edge is neutral; the one line of colour is the accent rule along the top,
 * which shimmers while Josh is listening, thinking or answering.
 */
.hub-josh {
  --ch: 18px;
  --edge: var(--hairline);
  /* .chamfer-edge would make it relative; the panel stays put while the page scrolls. */
  position: fixed;
  inset: 0;
  width: min(40rem, calc(100% - 2rem));
  max-height: calc(100dvh - 3rem);
  margin: auto auto 1.5rem;
  padding: 0.75rem 1.5rem 0.875rem;
  background: rgb(var(--c-surface) / 0.97);
  color: rgb(var(--c-text-main));
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(18px);
  overflow: hidden auto;
}
.hub-josh[open] {
  display: flex;
  flex-direction: column;
  animation: hub-josh-rise 0.24s ease-out;
}
.hub-josh::backdrop {
  background: rgb(var(--c-ink) / 0.6);
  backdrop-filter: blur(8px);
}
@keyframes hub-josh-rise {
  from {
    opacity: 0;
    transform: translateY(1rem) scale(0.98);
  }
}
.hub-josh-rule {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--brand-gradient);
  background-size: 200% 100%;
  opacity: 0.55;
  pointer-events: none;
}
.hub-josh:not([data-state="idle"]) .hub-josh-rule {
  opacity: 1;
  animation: hub-josh-rule 1.6s linear infinite;
}
@keyframes hub-josh-rule {
  to {
    background-position: -200% 0;
  }
}
.hub-josh-top {
  display: flex;
  min-height: var(--control-height);
  flex: none;
  align-items: center;
  gap: 0.25rem;
  margin-right: -0.75rem;
}
.hub-josh-ident {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}
.hub-josh-name {
  margin: 0;
  font-family: var(--font-russo);
  font-synthesis: none;
  font-size: var(--type-lead);
  font-weight: 400;
  line-height: 1.1;
  color: rgb(var(--c-heading));
}
.hub-josh-status {
  margin: 0;
  font-size: 0.75rem;
  color: rgb(var(--c-text-muted));
}
.hub-josh-tool {
  display: grid;
  width: var(--control-height);
  height: var(--control-height);
  flex: none;
  place-items: center;
  border: 0;
  background: none;
  color: rgb(var(--c-text-muted));
  cursor: pointer;
}
.hub-josh-tool:hover,
.hub-josh-tool[aria-expanded="true"] {
  background: rgb(var(--c-text-main) / 0.07);
  color: rgb(var(--c-text-main));
}
.hub-josh-tool:focus-visible {
  outline-offset: -2px;
}
.hub-josh-plain {
  min-height: var(--control-height-sm);
  border: 0;
  background: none;
  padding: 0 0.625rem;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgb(var(--c-text-muted));
  cursor: pointer;
}
.hub-josh-plain:hover:not(:disabled) {
  background: rgb(var(--c-text-main) / 0.07);
  color: rgb(var(--c-text-main));
}
.hub-josh-plain:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.hub-josh-settings {
  --ch: 10px;
  --edge: var(--hairline);
  flex: none;
  margin: 0.25rem 0 0.75rem;
  padding: 0.25rem 1rem 0.75rem;
  background: rgb(var(--c-background) / 0.6);
}
.hub-josh-settings p {
  margin: 0.25rem 0 0;
}

/* The greeting: the orb, then a small hello and the question in display type. */
.hub-josh-hero {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 0 1.75rem;
  text-align: center;
}
.hub-josh-hero .hub-orb {
  margin-bottom: 1.5rem;
}
.hub-josh-hello {
  margin: 0;
  font-size: var(--type-body);
  color: rgb(var(--c-text-muted));
}
.hub-josh-caption {
  margin: 0.125rem 0 0;
  font-family: var(--font-russo);
  font-synthesis: none;
  font-size: var(--type-32);
  font-weight: 400;
  line-height: 1.1;
  color: rgb(var(--c-heading));
}

/* Suggestions on the greeting: quiet tiles, two to a row. */
.hub-josh-tiles {
  display: grid;
  flex: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}
.hub-josh-tile {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: 4rem;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid transparent;
  background: rgb(var(--c-text-main) / 0.05);
  padding: 0.625rem 0.875rem 0.625rem 0.625rem;
  font: inherit;
  font-size: var(--text-tool);
  line-height: 1.35;
  text-align: left;
  color: rgb(var(--c-text-main));
  cursor: pointer;
}
.hub-josh-tile:hover {
  border-color: var(--accent-line);
  background: var(--hairline);
}
.hub-josh-tile-icon {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  place-items: center;
  background: rgb(var(--c-text-main) / 0.06);
  color: rgb(var(--c-text-muted));
}
.hub-josh-tile:hover .hub-josh-tile-icon {
  color: rgb(var(--c-signal));
}
.hub-josh-tile-text {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.125rem;
}
.hub-josh-tile-hint {
  font-size: 0.75rem;
  color: rgb(var(--c-text-muted));
}
@media (max-width: 30rem) {
  .hub-josh-tiles {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* What Josh can do with the page in view, opened from the page button in the ask bar. */
.hub-josh-menu {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  animation: hub-josh-menu-in 0.16s ease-out;
}
@keyframes hub-josh-menu-in {
  from {
    opacity: 0;
    transform: translateY(0.25rem);
  }
}
.hub-josh-chip {
  min-height: var(--control-height-sm);
  border: 1px solid transparent;
  background: rgb(var(--c-text-main) / 0.05);
  padding: 0.375rem 0.75rem;
  font: inherit;
  font-size: 0.8125rem;
  color: rgb(var(--c-text-main));
  cursor: pointer;
}
.hub-josh-chip:hover:not(:disabled) {
  border-color: var(--accent-line);
  background: var(--hairline);
}
.hub-josh-chip:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* The conversation reads like captions: the question small and quiet, his answer large. */
.hub-josh-log {
  /* Contains the hidden screen-reader text, so only the log scrolls. */
  position: relative;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 8rem;
  margin: 0.5rem 0 0;
  overflow-y: auto;
  padding: 0.5rem 0.25rem;
  list-style: none;
}
.hub-josh-asked {
  align-self: flex-end;
  max-width: 85%;
  background: rgb(var(--c-text-main) / 0.06);
  padding: 0.5rem 0.875rem;
  font-size: var(--text-tool);
  color: rgb(var(--c-text-main));
  overflow-wrap: anywhere;
}
.hub-josh-reply {
  font-size: var(--type-lead);
  line-height: 1.55;
}
.hub-josh-answer {
  overflow-wrap: anywhere;
}
.hub-josh-answer > * {
  margin: 0;
}
.hub-josh-answer > * + * {
  margin-top: 0.625rem;
}
.hub-josh-answer p {
  white-space: pre-wrap;
}
.hub-josh-answer ul {
  padding-left: 1.25rem;
  list-style: square;
}
.hub-josh-answer li + li {
  margin-top: 0.25rem;
}
.hub-josh-answer li::marker {
  color: rgb(var(--c-accent));
}
.hub-josh-answer strong,
.hub-josh-answer-heading {
  font-weight: 700;
  color: rgb(var(--c-heading));
}
.hub-josh-reply[data-error] .hub-josh-answer {
  font-size: var(--type-body);
  color: rgb(var(--p-danger));
}
.hub-josh-cite {
  display: inline-grid;
  min-width: 1.125rem;
  height: 1.125rem;
  margin: 0 0.125rem;
  padding: 0 0.25rem;
  place-items: center;
  vertical-align: 0.15em;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  color: rgb(var(--c-on-accent));
  background: rgb(var(--c-accent));
  text-decoration: none;
}
a.hub-josh-cite:hover {
  background: rgb(var(--c-accent));
}
.hub-josh-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0.75rem 0 0;
  padding: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  list-style: none;
}
.hub-josh-source {
  display: inline-flex;
  max-width: 18rem;
  min-height: 2rem;
  align-items: center;
  gap: 0.375rem;
  background: rgb(var(--c-text-main) / 0.05);
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  color: rgb(var(--c-text-main));
  text-decoration: none;
}
.hub-josh-source:hover {
  background: rgb(var(--c-text-main) / 0.09);
}
.hub-josh-source .hub-josh-cite {
  margin: 0;
  vertical-align: baseline;
}
.hub-josh-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.125rem;
  margin: 0.5rem 0 0 -0.5rem;
}
.hub-josh-act {
  display: inline-flex;
  min-width: var(--control-height-sm);
  height: var(--control-height-sm);
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgb(var(--c-text-muted));
  cursor: pointer;
}
.hub-josh-act-wide {
  padding: 0 0.625rem;
}
.hub-josh-act:hover:not(:disabled) {
  background: rgb(var(--c-text-main) / 0.07);
  color: rgb(var(--c-text-main));
}
.hub-josh-act:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.hub-josh-act:focus-visible {
  outline-offset: -2px;
}
.hub-josh-sources-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.75rem;
}
.hub-josh-sources-wrap .hub-josh-sources {
  margin: 0;
}
.hub-josh-source:not([data-cited]) {
  color: rgb(var(--c-text-muted));
}
.hub-josh-source:not([data-cited]) .hub-josh-cite {
  background: rgb(var(--c-text-muted));
  color: rgb(var(--c-surface));
}
.hub-josh-more {
  min-height: 2rem;
  border: 0;
  background: none;
  padding: 0 0.5rem;
  font: inherit;
  font-size: 0.8125rem;
  color: rgb(var(--c-text-muted));
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.hub-josh-more:hover {
  color: rgb(var(--c-text-main));
}
.hub-josh-dots {
  display: inline-flex;
  gap: 0.375rem;
  padding: 0.625rem 0;
}
.hub-josh-dots span {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: rgb(var(--c-accent));
  animation: hub-josh-dot 1.2s ease-in-out infinite;
}
.hub-josh-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.hub-josh-dots span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes hub-josh-dot {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-0.25rem);
  }
}

/* The ask bar: one field, the microphone and send. The bar shows focus, not the field. */
.hub-josh-bar {
  --ch: 12px;
  --edge: rgb(var(--c-text-main) / 0.16);
  display: flex;
  flex: none;
  align-items: center;
  gap: 0.25rem;
  margin-top: 1rem;
  background: rgb(var(--c-background) / 0.6);
  padding: 0.25rem 0.25rem 0.25rem 1rem;
}
.hub-josh-bar:has(> .hub-josh-icon:first-child) {
  padding-left: 0.25rem;
}
.hub-josh-bar:has(> .hub-josh-icon:first-child) .hub-josh-input {
  padding-left: 0.375rem;
}
.hub-josh-bar:focus-within {
  --edge: rgb(var(--c-focus));
  border-color: rgb(var(--c-focus));
}
.hub-josh-input {
  min-width: 0;
  min-height: var(--control-height);
  flex: 1 1 auto;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--type-body);
  color: rgb(var(--c-text-main));
}
.hub-josh-input:focus-visible {
  outline: none;
}
.hub-josh-input::placeholder {
  color: rgb(var(--c-text-muted));
  opacity: 1;
}
.hub-josh-icon {
  display: grid;
  width: var(--control-height);
  height: var(--control-height);
  flex: none;
  place-items: center;
  border: 0;
  background: none;
  color: rgb(var(--c-text-muted));
  cursor: pointer;
}
.hub-josh-icon:hover:not(:disabled) {
  background: rgb(var(--c-text-main) / 0.07);
  color: rgb(var(--c-text-main));
}
.hub-josh-icon:focus-visible {
  outline-offset: -2px;
}
.hub-josh-icon[data-on] {
  color: rgb(var(--c-on-accent));
  background: rgb(var(--c-accent));
}
.hub-josh-send:not(:disabled) {
  color: rgb(var(--c-on-brand));
  background: var(--brand-gradient);
}
.hub-josh-icon:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}
.hub-josh-fine {
  flex: none;
  margin: 0.625rem 0 0;
  font-size: 0.75rem;
  text-align: center;
  color: rgb(var(--c-text-muted));
}

/* Josh's cards elsewhere: a triage suggestion, a moderation summary. */
.hub-josh-card {
  padding: 0.75rem;
  border-left: 3px solid rgb(var(--c-accent));
  background: rgb(var(--c-background) / 0.45);
}
.hub-josh-who {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: rgb(var(--c-text-muted));
}
.hub-josh-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Approvals: who has decided, as a short list under the banner. */
.hub-approval-people {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  margin: 0.5rem 0 0;
  padding: 0;
  font-size: 0.8125rem;
  list-style: none;
}
.hub-approval-people li {
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
}
.hub-approval-mark {
  display: inline-grid;
  width: 1.125rem;
  height: 1.125rem;
  flex: none;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--hairline);
}
.hub-approval-people [data-decision="approve"] .hub-approval-mark {
  color: rgb(var(--p-positive));
}
.hub-approval-people [data-decision="reject"] .hub-approval-mark {
  color: rgb(var(--p-danger));
}
.hub-approval-history {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}

/* Checklists: the run in progress, its steps, and past runs. */
.hub-checklist-bar {
  height: 0.375rem;
  background: var(--hairline);
}
.hub-checklist-bar > span {
  display: block;
  height: 100%;
  background: var(--brand-gradient);
}
.hub-checklist-section {
  margin: 1rem 0 0;
  border: 0;
  padding: 0;
}
.hub-checklist-items {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.25rem 0 0;
  padding: 0;
  list-style: none;
}
.hub-checklist-items > li {
  border-left: 2px solid var(--hairline);
  padding: 0.125rem 0 0.25rem 0.75rem;
}
.hub-checklist-items > li[data-done] {
  border-left-color: rgb(var(--p-positive));
}
.hub-checklist-items > li[data-done] .hub-check-row > span {
  color: rgb(var(--c-text-muted));
  text-decoration: line-through;
}
.hub-checklist-meta {
  margin: 0;
  padding-left: 2rem;
  font-size: 0.8125rem;
  color: rgb(var(--c-text-muted));
}
.hub-checklist-meta:empty {
  display: none;
}
.hub-checklist-note-btn {
  min-height: 2rem;
  margin-left: 1.5rem;
  border: 0;
  background: none;
  padding: 0 0.5rem;
  font: inherit;
  font-size: 0.8125rem;
  color: rgb(var(--c-text-muted));
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.hub-checklist-note-btn:hover {
  color: rgb(var(--c-text-main));
}
.hub-checklist-history {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}
.hub-checklist-history-row {
  display: flex;
  width: 100%;
  min-height: var(--control-height);
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  border: 0;
  background: rgb(var(--c-text-main) / 0.04);
  padding: 0.375rem 0.75rem;
  font: inherit;
  text-align: left;
  color: rgb(var(--c-text-main));
  cursor: pointer;
}
.hub-checklist-history-row:hover {
  background: var(--hairline);
}
.hub-checklist-detail {
  margin: 0.25rem 0 0.5rem;
  padding: 0.25rem 0 0.25rem 1.5rem;
  font-size: 0.875rem;
  list-style: none;
}
.hub-checklist-edit {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 0.5rem 0 0;
  padding: 0;
  list-style: none;
}
.hub-checklist-edit > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.hub-checklist-edit .field.grow {
  min-width: 12rem;
  flex: 1 1 14rem;
}
.hub-checklist-edit select.field {
  width: auto;
  flex: 0 1 12rem;
}

/* Player records: the Minecraft cell, the record's header and its timeline. */
.hub-mc {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}
.hub-mc img,
.hub-player-head {
  image-rendering: pixelated;
}
.hub-player {
  border-top: 1px solid var(--hairline);
  padding-top: 1rem;
}
.hub-player-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
}
.hub-player-timeline > li {
  display: grid;
  grid-template-columns: 6.5rem auto 1fr;
  align-items: baseline;
  gap: 0.625rem;
  font-size: var(--text-tool);
}
.hub-player-entry {
  min-width: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 40rem) {
  .hub-player-timeline > li {
    grid-template-columns: auto 1fr;
  }
  .hub-player-timeline > li > .hub-player-entry {
    grid-column: 1 / -1;
  }
}
.hub-player-links {
  margin: 0.25rem 0 0;
  padding: 0;
  font-size: var(--text-tool);
  list-style: none;
}
.hub-store-row {
  border-top: 1px solid var(--hairline);
  padding-top: 0.75rem;
}

/*
 * Cosmetics from the world's servers (docs/cosmetics.md). A cosmetic's name
 * is drawn in the server's own colours on the dark ground (data-theme pins
 * it to Ink), as Minecraft chat shows it, in both themes.
 */
.hub-cosmetics {
  border-top: 1px solid var(--hairline);
  padding-top: 1rem;
}
.hub-cosmetic-look {
  display: inline-block;
  padding: 0.0625rem 0.375rem;
  background: rgb(var(--c-background));
  color: rgb(var(--c-text-main));
  font-size: var(--text-tool);
  overflow-wrap: anywhere;
  clip-path: polygon(0 0, calc(100% - 0.375rem) 0, 100% 0.375rem, 100% 100%, 0 100%);
}
.hub-cosmetic-glyph {
  margin-right: 0.25rem;
  color: rgb(var(--c-text-muted));
}
.hub-cosmetic-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  margin: 0.25rem 0 0;
  padding: 0;
  font-size: var(--text-tool);
  list-style: none;
}
.hub-cosmetic-give {
  max-width: 32rem;
}
.hub-cosmetic-servers,
.hub-tag-requests {
  margin: 0;
  padding: 0;
  list-style: none;
}
.hub-tag-requests {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 48rem;
}

/* Cross-workspace views: a read-only table that scrolls sideways on narrow screens. */
.hub-table-scroll {
  overflow-x: auto;
}
.hub-cross-table th[scope="row"],
.hub-cross-table td {
  white-space: nowrap;
}
.hub-josh-context {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.75rem 0 -0.5rem;
  font-size: 0.8125rem;
  color: rgb(var(--c-text-muted));
}
.hub-josh-context strong {
  color: rgb(var(--c-text-main));
}

/* Security (Phase 8): the authenticator QR code, backup codes and signed-in devices. */
.hub-qr {
  /* White behind the code in both themes, so phone cameras read it. */
  background: rgb(var(--c-paper));
  padding: 0.5rem;
  image-rendering: pixelated;
}
.hub-backup-codes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 0.25rem 1rem;
  list-style: none;
  padding: 0.75rem;
  margin: 0;
  border: 1px solid var(--hairline);
}
.hub-device-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.hub-device-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--hairline);
}
.hub-device-list > li:first-child {
  border-top: 0;
}

/* Home (Phase 8): My Tasks and Today. */
.hub-task-list,
.hub-today-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.hub-task-list > li,
.hub-today-list > li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-top: 1px solid var(--hairline);
}
.hub-task-list > li:first-child,
.hub-today-list > li:first-child {
  border-top: 0;
}
/* A square tick box that marks the task done; 24px so it is easy to hit. */
.hub-task-check {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  margin-top: 0.1rem;
  border: 2px solid rgb(var(--c-text-muted));
  background: transparent;
  cursor: pointer;
}
.hub-task-check:hover:not(:disabled),
.hub-task-check:focus-visible {
  border-color: rgb(var(--c-accent));
  background: rgb(var(--c-accent) / 0.15);
}
.hub-task-list > li[data-overdue] [data-tone="danger"] {
  color: rgb(var(--p-danger));
}
.hub-today-swatch {
  flex: none;
  width: 0.25rem;
  align-self: stretch;
}
.hub-today-time {
  flex: none;
  width: 6.5rem;
  padding-top: 0.15rem;
}

/* Workspace categories (Phase 8): a rail heading that folds its workspaces away. */
.hub-nav-category {
  display: flex;
  width: 100%;
  min-height: 2rem;
  align-items: center;
  gap: 0.375rem;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-align: left;
  cursor: pointer;
}
.hub-nav-category:hover {
  color: rgb(var(--c-heading));
}

/* Formulas (Phase 8): the function reference under a formula. */
.hub-formula-help {
  display: grid;
  gap: 0.5rem;
  max-height: 16rem;
  overflow-y: auto;
  margin: 0;
}
.hub-formula-help dd {
  margin: 0;
}

/* Timeline view (Phase 8): rows down the side, a time axis across, a bar per row. */
.hub-timeline {
  border: 1px solid var(--hairline);
  overflow-x: auto;
}
.hub-timeline-head,
.hub-timeline-rows > li {
  display: grid;
  /* Wide enough that every column heading fits; the timeline scrolls sideways if needed. */
  grid-template-columns: minmax(8rem, 14rem) minmax(var(--timeline-width, 48rem), 1fr);
}
.hub-timeline-head {
  border-bottom: 1px solid var(--hairline);
}
.hub-timeline-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hub-timeline-rows > li + li {
  border-top: 1px solid var(--hairline);
}
.hub-timeline-name {
  position: sticky;
  left: 0;
  z-index: 2;
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  background: rgb(var(--c-surface));
  border-right: 1px solid var(--hairline);
}
.hub-timeline-track {
  position: relative;
  min-height: 2.5rem;
}
.hub-timeline-col {
  position: absolute;
  top: 0;
  bottom: 0;
  padding: 0.6rem 0.35rem;
  border-left: 1px solid var(--hairline);
  font-size: 0.75rem;
  white-space: nowrap;
  color: rgb(var(--c-text-muted));
}
.hub-timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--hairline);
}
.hub-timeline-today {
  position: absolute;
  top: 0;
  bottom: -100vh;
  border-left: 2px solid rgb(var(--c-accent));
  pointer-events: none;
}
.hub-timeline-bar {
  position: absolute;
  top: 0.4rem;
  bottom: 0.4rem;
  z-index: 1;
  display: flex;
  align-items: center;
  min-width: 1.5rem;
  padding: 0 0.6rem;
  border: 1px solid rgb(var(--c-accent));
  background: rgb(var(--c-accent) / 0.22);
  color: rgb(var(--c-heading));
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
  touch-action: none;
}
.hub-timeline-bar[data-editable] {
  cursor: grab;
}
.hub-timeline-bar[data-clipped-start] {
  border-left-style: dashed;
}
.hub-timeline-bar[data-clipped-end] {
  border-right-style: dashed;
}
.hub-timeline-bar:hover,
.hub-timeline-bar:focus-visible {
  background: rgb(var(--c-accent) / 0.4);
}
.hub-timeline-edge {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 0.5rem;
  cursor: ew-resize;
}
.hub-timeline-edge[data-edge="start"] {
  left: 0;
}
.hub-timeline-edge[data-edge="end"] {
  right: 0;
}
.hub-timeline-off {
  position: absolute;
  top: 0.7rem;
  left: 0.5rem;
}
/* A row of toggle buttons where one is chosen, such as the timeline's scale. */
.hub-segmented {
  display: inline-flex;
  gap: 0.25rem;
  margin: 0;
  padding: 0;
  border: 0;
}
.hub-segmented .btn[aria-pressed="true"] .btn-face {
  border-color: rgb(var(--c-accent));
  background: rgb(var(--c-accent) / 0.2);
  color: rgb(var(--c-heading));
}

/* Synced blocks (Phase 8): a framed area whose content lives on its home page. */
.hub-synced {
  margin: 0.25rem 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgb(var(--c-accent) / 0.55);
  border-left-width: 3px;
}
.hub-synced-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.hub-synced .bn-editor {
  padding-inline: 0;
}

/* Server status (Phase 8): a Minecraft server's state as the game's server list shows it. */
.hub-server {
  display: flex;
  gap: 0.875rem;
  width: 100%;
  margin: 0.25rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--hairline-strong);
  background: rgb(var(--c-background));
}
.hub-server-icon {
  width: 3rem;
  height: 3rem;
  flex: none;
  image-rendering: pixelated;
  background: rgb(var(--c-surface));
  border: 1px solid var(--hairline);
}
.hub-server-body {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 0.25rem;
}
.hub-server-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}
.hub-server-address {
  font-weight: 600;
  color: rgb(var(--c-heading));
  overflow-wrap: anywhere;
}
.hub-server-motd {
  white-space: pre-line;
  color: rgb(var(--c-text-main));
}
.hub-server-count {
  color: rgb(var(--c-heading));
}
.hub-server-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

/* Custom domains and Josh's websites (Phase 8): one bordered row per entry. */
.hub-domain,
.hub-site {
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--hairline-strong);
}
.hub-domain-name,
.hub-site-name {
  font-weight: 600;
  color: rgb(var(--c-heading));
  overflow-wrap: anywhere;
}
.hub-domain-record {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 0.75rem;
  margin: 0.5rem 0;
}
.hub-domain-record dt {
  color: rgb(var(--c-text-muted));
}
.hub-domain-record dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* Version diff (Phase 8): what changed between page versions. */
.hub-diff {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--hairline);
}
.hub-diff-row,
.hub-diff-fold {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem 0.75rem;
  border-top: 1px solid var(--hairline);
}
.hub-diff > li:first-child {
  border-top: 0;
}
.hub-diff-row[data-kind="added"] {
  border-left: 3px solid rgb(var(--p-positive));
}
.hub-diff-row[data-kind="removed"] {
  border-left: 3px solid rgb(var(--p-danger));
}
.hub-diff-row[data-kind="changed"] {
  border-left: 3px solid rgb(var(--p-caution));
}
.hub-diff-tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(var(--c-text-muted));
}
.hub-diff-text {
  white-space: pre-wrap;
}
.hub-diff ins {
  background: rgb(var(--p-positive) / 0.18);
  color: rgb(var(--c-heading));
  text-decoration: none;
  border-bottom: 2px solid rgb(var(--p-positive));
}
.hub-diff del {
  background: rgb(var(--p-danger) / 0.15);
  color: rgb(var(--c-heading));
  text-decoration: line-through;
}

/* ---------------------------------------------------------------------------
 * App shell (redesign, 20 October 2026): a strip of worlds, a sidebar for
 * where you are, and a top bar over the content. Below 1280px the strip and
 * sidebar slide in as a drawer; below 640px a tab bar sits at the bottom.
 * ------------------------------------------------------------------------- */
.hub-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr);
  /* A plain field: red is never a background wash on a tool screen. */
  background: rgb(var(--c-background));
}
.hub-navpanel {
  display: none;
}
.hub-navpanel[data-open="true"] {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 60;
  display: flex;
  width: min(21rem, 92vw);
  box-shadow: var(--shadow-panel);
}
.hub-navpanel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  border: 0;
  background: rgb(var(--c-shade) / 0.5);
}
@media (min-width: 1280px) {
  .hub-shell {
    grid-template-columns: 4.5rem 16.5rem minmax(0, 1fr);
  }
  .hub-navpanel,
  .hub-navpanel[data-open="true"] {
    position: static;
    display: contents;
    width: auto;
    box-shadow: none;
  }
  .hub-navpanel-backdrop {
    display: none;
  }
}

.hub-strip {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  width: 4.5rem;
  flex: none;
  flex-direction: column;
  align-items: center;
  gap: 0.625rem;
  overflow-y: auto;
  border-right: 1px solid var(--hairline);
  background: rgb(var(--c-background-soft));
  padding: 0.875rem 0;
}
.hub-strip-tile {
  --ch: 10px;
  position: relative;
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  place-items: center;
  border: 0;
  background: rgb(var(--c-surface));
  font-family: var(--font-russo);
  font-synthesis: none;
  font-size: 1rem;
  font-weight: 400;
  color: var(--tile-accent, rgb(var(--c-heading)));
  text-decoration: none;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - var(--ch)) 0, 100% var(--ch), 100% 100%, 0 100%);
  transition: background-color 0.2s ease;
}
.hub-strip-tile:hover {
  background: rgb(var(--c-surface-hover));
}
.hub-strip-tile::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 0;
  width: 3px;
  background: var(--tile-accent, transparent);
}
.hub-strip-tile[aria-current="page"],
.hub-strip-tile[data-current="true"] {
  background: rgb(var(--c-surface-hover));
  box-shadow: inset 0 0 0 2px var(--tile-accent, rgb(var(--c-signal)));
}
.hub-strip-tile[data-current="true"]::before,
.hub-strip-tile[aria-current="page"]::before {
  display: none;
}
.hub-strip-tile[data-kind="home"] {
  clip-path: polygon(
    0 0,
    calc(100% - var(--ch)) 0,
    100% var(--ch),
    100% 100%,
    var(--ch) 100%,
    0 calc(100% - var(--ch))
  );
}
.hub-strip-tile[data-kind="ghost"] {
  border: 1px dashed rgb(var(--c-text-muted));
  background: transparent;
  color: rgb(var(--c-text-muted));
  clip-path: none;
}
.hub-strip-tile[data-kind="plain"] {
  background: transparent;
  color: rgb(var(--c-text-muted));
  clip-path: none;
}
.hub-strip-tile[data-kind="plain"]:hover {
  color: rgb(var(--c-heading));
}
.hub-strip-rule {
  width: 1.75rem;
  height: 1px;
  flex: none;
  background: var(--hairline);
}

.hub-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  width: 16.5rem;
  flex: none;
  flex-direction: column;
  gap: 1.125rem;
  overflow-y: auto;
  border-right: 1px solid var(--hairline);
  background: rgb(var(--c-background-soft));
  padding: 1rem 0.75rem 1.25rem;
}
@media (max-width: 1279px) {
  .hub-sidebar {
    flex: 1;
    width: auto;
  }
}
.hub-sidebar-head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: var(--font-russo);
  font-synthesis: none;
  font-size: 1.125rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(var(--c-heading));
  text-decoration: none;
  /* The head lines up with the top bar, and its rule continues the bar's. */
  min-height: 3.5rem;
  margin: -1rem -0.75rem 0;
  border-bottom: 1px solid var(--hairline);
  padding: 0 1.125rem;
}
.hub-kbd {
  border: 1px solid var(--hairline);
  padding: 0 0.375rem;
  font-family: inherit;
  font-size: 0.6875rem;
  color: rgb(var(--c-text-muted));
}
.hub-sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}
.hub-sidebar-label {
  display: flex;
  min-height: 1.75rem;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--c-text-muted));
}
.hub-sidebar-label .link,
.hub-sidebar-label .hub-nav-category {
  font-size: 0.75rem;
  letter-spacing: 0;
  text-transform: none;
}
/* Sidebar links rest in muted text at regular weight, so the current one,
   in heading colour with its accent rule, is the only thing that leads. */
.hub-sidebar .hub-nav-item {
  min-height: 2.25rem;
  border-left: 0;
  padding: 0.25rem 0.625rem;
  font-weight: 400;
  color: rgb(var(--c-text-muted));
}
.hub-sidebar .hub-nav-item:hover {
  color: rgb(var(--c-heading));
}
.hub-sidebar .hub-nav-item[aria-current="page"],
.hub-sidebar .hub-nav-item[data-status="active"] {
  box-shadow: inset 2px 0 0 var(--place-accent, rgb(var(--c-signal)));
  background: rgb(var(--c-surface));
  font-weight: 600;
  color: rgb(var(--c-heading));
}
.hub-sidebar .hub-nav-item > svg {
  flex: none;
  opacity: 0.8;
}
.hub-sidebar .hub-nav-item[aria-current="page"] > svg,
.hub-sidebar .hub-nav-item[data-status="active"] > svg {
  color: var(--place-accent, rgb(var(--c-signal)));
  opacity: 1;
}
/* The tree's own controls stay out of the way until the row is in use. */
.hub-sidebar .hub-tree-row .hub-icon-btn {
  width: 1.5rem;
  height: 2.25rem;
  font-weight: 400;
}
.hub-sidebar .hub-tree-row > .hub-nav-item + .hub-icon-btn {
  opacity: 0;
}
.hub-sidebar .hub-tree-row:hover > .hub-icon-btn,
.hub-sidebar .hub-tree-row:focus-within > .hub-icon-btn {
  opacity: 1;
}
@media (hover: none) {
  .hub-sidebar .hub-tree-row > .hub-nav-item + .hub-icon-btn {
    opacity: 1;
  }
}
.hub-sidebar-count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgb(var(--c-signal));
}
.hub-josh-card {
  --ch: 12px;
  display: flex;
  width: 100%;
  align-items: center;
  gap: 0.625rem;
  border: 1px solid var(--hairline);
  background: rgb(var(--c-surface));
  padding: 0.625rem 0.75rem;
  font: inherit;
  color: rgb(var(--c-text-main));
  text-align: left;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - var(--ch)) 0, 100% var(--ch), 100% 100%, 0 100%);
}
.hub-josh-card:hover {
  background: rgb(var(--c-surface-hover));
}
.hub-josh-dot {
  width: 1.75rem;
  height: 1.75rem;
  flex: none;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgb(var(--c-mint)), rgb(var(--c-teal)) 70%);
}

.hub-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
}
.hub-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  min-height: 3.5rem;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  background: rgb(var(--c-background) / 0.92);
  padding: 0.5rem 1rem;
  backdrop-filter: blur(8px);
}
/* The accent rule: the one Teal-to-Mint line on screen runs under the top bar and
   fades out before the far edge. */
.hub-bar::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background:
    linear-gradient(
      90deg,
      rgb(var(--c-teal)) 0%,
      rgb(var(--c-teal)) 30%,
      rgb(var(--c-mint)) 55%,
      transparent 88%
    ),
    var(--hairline);
  pointer-events: none;
}
@media (min-width: 1024px) {
  .hub-bar {
    padding: 0.5rem 1.75rem;
  }
}
.hub-bar-place {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: rgb(var(--c-text-muted));
}
.hub-bar-place strong {
  overflow: hidden;
  font-weight: 500;
  color: rgb(var(--c-heading));
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-bar-search {
  display: none;
  min-height: var(--control-height-sm);
  width: min(26rem, 40vw);
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--hairline);
  background: rgb(var(--c-surface));
  padding: 0 0.625rem;
  font: inherit;
  font-size: 0.8125rem;
  color: rgb(var(--c-text-muted));
  cursor: pointer;
}
.hub-bar-search:hover {
  color: rgb(var(--c-heading));
}
@media (min-width: 768px) {
  .hub-bar-search {
    display: flex;
  }
}
.hub-icon-button {
  position: relative;
  display: inline-grid;
  width: var(--control-height-sm);
  height: var(--control-height-sm);
  flex: none;
  place-items: center;
  border: 0;
  background: transparent;
  color: rgb(var(--c-text-muted));
  text-decoration: none;
  cursor: pointer;
}
.hub-icon-button:hover {
  background: rgb(var(--c-surface));
  color: rgb(var(--c-heading));
}
.hub-icon-badge {
  position: absolute;
  top: -0.375rem;
  right: -0.375rem;
  min-width: 1.125rem;
  height: 1.125rem;
  border-radius: 999px;
  background: rgb(var(--c-accent));
  padding: 0 0.3rem;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1.125rem;
  color: rgb(var(--c-on-accent));
  text-align: center;
}
.hub-new {
  position: relative;
}
.hub-new-menu {
  position: absolute;
  top: calc(100% + 0.375rem);
  right: 0;
  z-index: 40;
  display: flex;
  min-width: 15rem;
  flex-direction: column;
  border: 1px solid var(--hairline-strong);
  background: rgb(var(--c-surface));
  padding: 0.375rem;
  box-shadow: var(--shadow-menu);
}
.hub-new-menu[data-place="up"] {
  top: auto;
  bottom: calc(100% + 0.5rem);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}
.hub-new-menu button,
.hub-new-menu a {
  display: flex;
  min-height: var(--control-height);
  align-items: center;
  border: 0;
  background: none;
  padding: 0 0.75rem;
  font: inherit;
  color: rgb(var(--c-text-main));
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.hub-new-menu button:hover,
.hub-new-menu a:hover,
.hub-new-menu button:focus-visible,
.hub-new-menu a:focus-visible {
  background: rgb(var(--c-surface-hover));
  color: rgb(var(--c-heading));
}

.hub-content {
  min-width: 0;
  padding: 1.5rem 1rem 6rem;
}
.hub-content-inner {
  max-width: 76rem;
}
@media (min-width: 1024px) {
  .hub-content {
    padding: 2rem 1.75rem 6rem;
  }
}

.hub-phone-tabs {
  display: none;
}
@media (max-width: 639px) {
  .hub-phone-tabs {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    border-top: 1px solid var(--hairline);
    background: rgb(var(--c-background-soft));
    padding: 0.375rem 0.25rem calc(0.5rem + env(safe-area-inset-bottom));
  }
  .hub-content {
    padding-bottom: 7rem;
  }
}
.hub-phone-tab {
  position: relative;
  display: flex;
  min-height: var(--control-height);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.6875rem;
  color: rgb(var(--c-text-muted));
  text-decoration: none;
  cursor: pointer;
}
.hub-phone-tab[aria-current="page"],
.hub-phone-tab[data-status="active"] {
  font-weight: 600;
  color: rgb(var(--c-heading));
}
.hub-phone-tab .hub-icon-badge {
  top: 0;
  right: calc(50% - 1.25rem);
}
.hub-phone-new {
  --ch: 12px;
  display: grid;
  width: 3.25rem;
  height: 3.25rem;
  justify-self: center;
  place-items: center;
  border: 0;
  background: var(--brand-gradient);
  color: rgb(var(--c-on-brand));
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - var(--ch)) 0, 100% var(--ch), 100% 100%, 0 100%);
}
/* On phones the orb and its tips sit above the tab bar. */
@media (max-width: 639px) {
  .hub-orb-launcher {
    bottom: calc(5.25rem + env(safe-area-inset-bottom));
  }
  .hub-josh-nudge {
    bottom: calc(5.5rem + env(safe-area-inset-bottom));
  }
}

/* Home and cards (redesign): one big greeting, then sections of chamfered cards. */
.hub-display {
  margin: 0;
  font-family: var(--font-russo);
  font-synthesis: none;
  font-size: clamp(2rem, 4vw, var(--type-44));
  font-weight: 400;
  line-height: 1.05;
  color: rgb(var(--c-heading));
  text-wrap: balance;
}
/* Section headings on overview screens: small capitals in Russo One, so they
   label a group without competing with what is in it.
   The rule for headings (11 November 2026): a screen you read (home, a
   world's overview and its pages list) labels its groups with
   .hub-section-title; a screen you work in (settings, builders, dialogs,
   panels) names each panel with .hub-h2, and .hub-h3 inside one. */
.hub-section-title {
  margin: 0;
  font-family: var(--font-russo);
  font-synthesis: none;
  font-size: 0.9375rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--c-text-muted));
}
.hub-kicker {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(var(--c-text-muted));
}
.hub-card-grid {
  display: grid;
  gap: 0.875rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
.hub-card {
  --ch: 12px;
  display: flex;
  height: 100%;
  min-height: 6.5rem;
  flex-direction: column;
  gap: 0.375rem;
  border: 1px solid var(--hairline);
  background: rgb(var(--c-surface));
  padding: 1rem;
  color: rgb(var(--c-text-main));
  text-decoration: none;
  clip-path: polygon(0 0, calc(100% - var(--ch)) 0, 100% var(--ch), 100% 100%, 0 100%);
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
}
.hub-card:hover {
  border-color: var(--hairline-strong);
  background: rgb(var(--c-surface-hover));
}
.hub-card[data-tone="signal"] {
  border-color: var(--hairline-strong);
}
.hub-card[data-tone="signal"] .hub-kicker {
  color: rgb(var(--c-signal));
}
.hub-card-title {
  font-weight: 600;
  color: rgb(var(--c-heading));
}
.hub-card-meta {
  margin-top: auto;
  font-size: 0.75rem;
  color: rgb(var(--c-text-muted));
}
.hub-card-place {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: rgb(var(--c-text-muted));
}
.hub-card-place .hub-dot {
  width: 0.5rem;
  height: 0.5rem;
}
.hub-world-card {
  --ch: 14px;
  position: relative;
  display: flex;
  height: 100%;
  min-height: 7rem;
  flex-direction: column;
  gap: 0.5rem;
  /* The world's colour is a rule down the leading edge, as in the sidebar. */
  box-shadow: inset 3px 0 0 var(--card-accent, rgb(var(--c-text-muted)));
  background: rgb(var(--c-surface));
  padding: 1rem 1.125rem 1.125rem 1.25rem;
  color: rgb(var(--c-text-main));
  text-decoration: none;
  clip-path: polygon(0 0, calc(100% - var(--ch)) 0, 100% var(--ch), 100% 100%, 0 100%);
  transition: background-color 0.2s ease;
}
.hub-world-card:hover {
  background: rgb(var(--c-surface-hover));
}
.hub-world-card-name {
  min-width: 0;
  font-family: var(--font-russo);
  font-synthesis: none;
  font-size: 1.25rem;
  font-weight: 400;
  line-height: 1.1;
  color: rgb(var(--c-heading));
  overflow-wrap: anywhere;
}
/* The profile tile in the strip: a full 44px target, like the world tiles. */
.hub-strip .hub-avatar {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 0.8125rem;
}

/* A world (redesign): a header tinted with the world's accent, edge to edge
   under the top bar, tabs underlined in that accent, then cards. */
.hub-world-head {
  margin: -1.5rem -1rem 0;
  border-bottom: 1px solid var(--hairline);
  /* No accent wash: the world's colour is its mark, its tab rule and its
     sidebar rule. */
  padding: 1.5rem 1rem 0;
}
@media (min-width: 1024px) {
  .hub-world-head {
    margin: -2rem -1.75rem 0;
    padding: 1.75rem 1.75rem 0;
  }
}
.hub-world-tabs {
  display: flex;
  gap: 0.25rem;
  margin-top: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.hub-world-tabs::-webkit-scrollbar {
  display: none;
}
.hub-world-tabs a {
  display: flex;
  flex: none;
  white-space: nowrap;
  min-height: var(--control-height);
  align-items: center;
  padding: 0 0.875rem;
  color: rgb(var(--c-text-muted));
  text-decoration: none;
}
.hub-world-tabs a:hover {
  color: rgb(var(--c-heading));
}
.hub-world-tabs a[data-status="active"],
.hub-world-tabs a[aria-current="page"] {
  font-weight: 600;
  color: rgb(var(--c-heading));
  box-shadow: inset 0 -2px 0 var(--world-accent);
}

.hub-world-cards {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.hub-world-card-tile,
.hub-world-panel {
  --ch: 14px;
  min-width: 0;
  background: rgb(var(--c-surface));
  padding: 1.25rem;
  clip-path: polygon(0 0, calc(100% - var(--ch)) 0, 100% var(--ch), 100% 100%, 0 100%);
}
.hub-world-big {
  margin: 0.625rem 0 0.25rem;
  font-family: var(--font-russo);
  font-synthesis: none;
  font-size: var(--type-32);
  font-weight: 400;
  line-height: 1.1;
  color: rgb(var(--c-heading));
}
.hub-world-big .hub-muted {
  font-family: var(--font-inter);
}

.hub-board-columns {
  display: grid;
  gap: 0.875rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13.75rem), 1fr));
}
.hub-board-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.625rem;
  background: rgb(var(--c-background-soft));
  padding: 0.75rem;
}
/* A world may pick any accent, so it marks the column as a rule beside the
   name and never colours the text (contrast, 11 November 2026). */
.hub-board-column[data-column="inProgress"] .hub-board-column-name {
  box-shadow: inset 2px 0 0 var(--world-accent, rgb(var(--c-signal)));
  padding-left: 0.5rem;
  color: rgb(var(--c-heading));
}
.hub-board-column[data-column="fixed"] .hub-board-column-name {
  color: rgb(var(--p-positive));
}
.hub-board-card {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  border: 1px solid var(--hairline);
  background: rgb(var(--c-surface));
  padding: 0.75rem;
  color: rgb(var(--c-text-main));
  text-decoration: none;
}
.hub-board-card:hover {
  border-color: var(--hairline-strong);
}
.hub-change-row {
  display: flex;
  align-items: baseline;
  gap: 0.625rem;
  border-top: 1px solid var(--hairline);
  padding: 0.5625rem 0;
}

/* One primary button per screen: when the screen has its own main action,
   the top bar's New steps back to an ordinary button. */
.hub-shell:has(.hub-content .btn-primary) .hub-bar .btn-primary {
  filter: none;
}
.hub-shell:has(.hub-content .btn-primary) .hub-bar .btn-primary .btn-face {
  background: rgb(var(--c-surface));
  color: rgb(var(--c-heading));
  box-shadow: inset 0 0 0 1px var(--hairline-strong);
}
.hub-logo-preview {
  display: inline-grid;
  width: 3.5rem;
  height: 3.5rem;
  place-items: center;
  background: rgb(var(--c-background-soft));
}

/* ---------------------------------------------------------------------------
 * A page (redesign, 26 October 2026): focus mode. Only the strip stays; the
 * sidebar opens over the page from the page's own bar, which takes the top
 * bar's place. A document reads in one column, with comments beside it.
 * ------------------------------------------------------------------------- */
.hub-bar-slot {
  display: contents;
}
@media (min-width: 1280px) {
  .hub-shell[data-focus="true"] {
    grid-template-columns: 4.5rem minmax(0, 1fr);
  }
  .hub-shell[data-focus="true"] .hub-sidebar {
    display: none;
  }
  .hub-shell[data-focus="true"] .hub-navpanel[data-open="true"] .hub-sidebar {
    position: fixed;
    inset: 0 auto 0 4.5rem;
    z-index: 60;
    display: flex;
    width: 16.5rem;
    box-shadow: var(--shadow-panel);
  }
  .hub-shell[data-focus="true"] .hub-navpanel-backdrop {
    display: block;
  }
}
.hub-shell[data-focus="true"] .hub-content {
  padding: 0;
}
.hub-shell[data-focus="true"] .hub-content-inner {
  max-width: none;
}

.hub-page-bar {
  gap: 0.5rem 0.625rem;
}
.hub-page-crumbs {
  min-width: 0;
  flex: 0 1 auto;
  font-size: 0.8125rem;
}
.hub-page-crumbs .hub-breadcrumb {
  flex-wrap: nowrap;
  overflow: hidden;
}
.hub-page-crumbs li {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hub-page-crumbs li:not(:last-child) {
  max-width: 12rem;
}
.hub-page-crumbs li:last-child {
  font-weight: 500;
  color: rgb(var(--c-heading));
}
/* On narrow screens the breadcrumb shrinks to share the first row with the
   menu, and the actions take the second. */
@media (max-width: 767px) {
  .hub-page-crumbs {
    flex: 1 1 0;
  }
  .hub-page-crumbs li:not(:first-child, :last-child) {
    display: none;
  }
}
.hub-save-state {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: rgb(var(--c-text-muted));
  white-space: nowrap;
}
.hub-save-dot {
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: rgb(var(--c-text-muted));
}
.hub-save-state[data-tone="positive"] .hub-save-dot {
  background: rgb(var(--p-positive));
}
.hub-save-state[data-tone="caution"] .hub-save-dot {
  background: rgb(var(--p-caution));
}
.hub-save-state[data-tone="danger"] {
  color: rgb(var(--p-danger));
}
.hub-save-state[data-tone="danger"] .hub-save-dot {
  background: rgb(var(--p-danger));
}
.hub-presence {
  display: flex;
  flex: none;
  align-items: center;
}
.hub-presence-face {
  display: grid;
  width: 1.75rem;
  height: 1.75rem;
  margin-left: -0.375rem;
  place-items: center;
  border: 2px solid rgb(var(--c-background));
  background: rgb(var(--c-surface-hover));
  font-size: 0.6875rem;
  font-weight: 700;
  color: rgb(var(--c-ink));
}
.hub-presence-face:nth-child(2) {
  margin-left: 0;
}
.hub-presence-face:not([style]) {
  color: rgb(var(--c-heading));
}
.hub-page-actions {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.hub-count-pill {
  min-width: 1.25rem;
  border-radius: 999px;
  background: var(--hairline);
  padding: 0 0.375rem;
  font-size: 0.6875rem;
  line-height: 1.25rem;
  text-align: center;
}

/* More: the panel stays in the page while closed, hidden rather than removed,
   so a dialog opened from it stays open once the panel closes. */
.hub-more {
  position: relative;
}
.hub-more-panel {
  position: absolute;
  top: calc(100% + 0.375rem);
  right: 0;
  z-index: 45;
  display: flex;
  min-width: 16rem;
  max-height: calc(100vh - 5rem);
  flex-direction: column;
  overflow-y: auto;
  border: 1px solid var(--hairline-strong);
  background: rgb(var(--c-surface));
  padding: 0.375rem;
  font-size: 0.875rem;
  box-shadow: var(--shadow-menu);
  visibility: hidden;
}
.hub-more-panel[data-open="true"],
.hub-more-panel dialog[open] {
  visibility: visible;
}
.hub-more-panel .hub-menu-item {
  min-height: var(--control-height);
  padding: 0 0.75rem;
  text-decoration: none;
}
.hub-more-panel .hub-menu-item:hover,
.hub-more-panel .hub-menu-item:focus-visible {
  background: rgb(var(--c-surface-hover));
}
.hub-more-panel .hub-menu-item[data-tone="danger"] {
  color: rgb(var(--p-danger));
}
.hub-more-panel > .btn,
.hub-more-panel > span > .btn {
  width: 100%;
  font-size: inherit;
  font-weight: 400;
}
.hub-more-panel > span {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.hub-more-panel > .btn > .btn-face,
.hub-more-panel > span > .btn > .btn-face {
  min-height: var(--control-height);
  justify-content: flex-start;
  border: 0;
  background: transparent;
  padding: 0 0.75rem;
  clip-path: none;
}
.hub-more-panel > .btn > .btn-face::before,
.hub-more-panel > .btn > .btn-face::after,
.hub-more-panel > span > .btn > .btn-face::before,
.hub-more-panel > span > .btn > .btn-face::after {
  display: none;
}
.hub-more-panel > .btn:hover > .btn-face,
.hub-more-panel > span > .btn:hover > .btn-face {
  background: rgb(var(--c-surface-hover));
}
.hub-more-rule {
  width: 100%;
  margin: 0.375rem 0;
  border: 0;
  border-top: 1px solid var(--hairline);
}

.hub-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1280px) {
  .hub-page[data-comments="true"] {
    grid-template-columns: minmax(0, 1fr) 22.5rem;
  }
}
.hub-page-main {
  min-width: 0;
  padding: 1.75rem 1rem 6rem;
}
@media (min-width: 1024px) {
  .hub-page-main {
    padding: 2rem 1.75rem 6rem;
  }
}
@media (max-width: 639px) {
  .hub-page-main {
    padding-bottom: 7rem;
  }
}
.hub-page-column {
  max-width: 47.5rem;
  margin: 0 auto;
}
.hub-page-column[data-wide="true"] {
  max-width: none;
}
.hub-page-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
}
.hub-page-doc {
  margin-top: 1.5rem;
}
.hub-page-props {
  border-top: 1px solid var(--hairline);
  padding-top: 0.5rem;
}

/* Comments: beside the page from 1280px, over it below that. */
.hub-comments-panel {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: 50;
  width: min(24rem, 100vw);
  overflow-y: auto;
  border-left: 1px solid var(--hairline);
  background: rgb(var(--c-background-soft));
  padding: 1.25rem 1.125rem 7rem;
  box-shadow: -24px 0 80px rgb(var(--c-shade) / 0.35);
}
@media (min-width: 1280px) {
  .hub-comments-panel {
    position: sticky;
    top: 3.5rem;
    z-index: auto;
    width: auto;
    height: calc(100vh - 3.5rem);
    align-self: start;
    padding-bottom: 2rem;
    box-shadow: none;
  }
}
.hub-josh-suggest {
  --ch: 12px;
  --edge: rgb(var(--c-accent) / 0.7);
  background: rgb(var(--c-surface));
  padding: 0.875rem;
}
.hub-josh-suggest .hub-josh-dot {
  width: 1.25rem;
  height: 1.25rem;
}

/* The approval banner: where it stands on the left, the decision on the right. */
.hub-approval {
  --ch: 12px;
  --edge: var(--hairline-strong);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  background: rgb(var(--c-surface));
  padding: 0.875rem 1rem;
}
.hub-approval[data-tone="success"] {
  --edge: rgb(var(--p-positive) / 0.6);
  background: rgb(var(--p-positive) / 0.1);
}
.hub-approval[data-tone="error"] {
  --edge: rgb(var(--p-danger) / 0.7);
}
.hub-approval-text {
  min-width: 0;
  flex: 1 1 16rem;
}
.hub-approval-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
}

/* The document's text lines up with the title; the editor's side gutter (drag
   handles) hangs out to the left. Its background is cleared in editor.css. */
@media (min-width: 768px) {
  .hub-page-doc {
    margin-inline: -2.75rem;
  }
}

/* ---------------------------------------------------------------------------
 * Public pages (redesign, 26 October 2026): the world's own header (logo,
 * name, its public pages, one primary Report button) over a glow in its
 * accent, a display title, and a board of chamfered cards.
 * ------------------------------------------------------------------------- */
.hub-public {
  display: flex;
  flex-direction: column;
  /* A plain ground (11 November 2026): the world's colour is a line under
     the header, never a wash behind the page. */
  background: rgb(var(--c-background));
}
.hub-public-head {
  background-image:
    linear-gradient(90deg, var(--world-accent, rgb(var(--c-accent))), transparent 60%),
    linear-gradient(var(--hairline), var(--hairline));
  background-repeat: no-repeat;
  background-position: bottom;
  background-size: 100% 1px;
}
.hub-public-head-inner,
.hub-public-main,
.hub-public-foot {
  width: 100%;
  max-width: 75rem;
  margin: 0 auto;
  padding-inline: 1rem;
}
@media (min-width: 640px) {
  .hub-public-head-inner,
  .hub-public-main,
  .hub-public-foot {
    padding-inline: 1.5rem;
  }
}
.hub-public-head-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding-block: 0.875rem;
}
.hub-public-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.625rem;
  color: rgb(var(--c-heading));
  text-decoration: none;
}
.hub-public-logo {
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  object-fit: contain;
}
.hub-public-emoji {
  font-size: 1.75rem;
  line-height: 1;
}
.hub-public-name {
  overflow: hidden;
  font-family: var(--font-russo);
  font-synthesis: none;
  font-size: 1.375rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.hub-public-nav {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.hub-public-nav a {
  display: flex;
  min-height: var(--control-height);
  align-items: center;
  padding: 0 0.75rem;
  color: rgb(var(--c-text-muted));
  text-decoration: none;
}
.hub-public-nav a:hover {
  color: rgb(var(--c-heading));
}
.hub-public-nav a[aria-current="page"] {
  font-weight: 600;
  color: rgb(var(--c-heading));
  box-shadow: inset 0 -2px 0 var(--world-accent, rgb(var(--c-signal)));
}
.hub-public-main {
  flex: 1;
  padding-block: 2rem 3.5rem;
}
.hub-public-intro {
  max-width: 40rem;
  margin: 0.375rem 0 0;
  color: rgb(var(--c-text-muted));
}
.hub-public-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.625rem;
  margin-top: 1.375rem;
}
.hub-public-filters .field-label:not(.grow) {
  min-width: 11rem;
}
.hub-public-foot {
  padding-block: 0 2.5rem;
  font-size: 0.8125rem;
  color: rgb(var(--c-text-muted));
}

.hub-public-lane {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.75rem;
  background: rgb(var(--c-background-soft));
  padding: 0.875rem;
}
.hub-public-lane-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(var(--c-text-muted));
}
.hub-public-lane[data-group="in_progress"] .hub-public-lane-name > span:first-child {
  color: rgb(var(--p-caution));
}
.hub-public-lane[data-group="done"] .hub-public-lane-name > span:first-child {
  color: rgb(var(--p-positive));
}
.hub-public-bug {
  --ch: 12px;
  display: flex;
  gap: 0.75rem;
  background: rgb(var(--c-surface));
  padding: 0.875rem;
}
.hub-public-votes {
  display: flex;
  width: 3.25rem;
  min-height: 3.5rem;
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.125rem;
  border: 1px solid var(--hairline-strong);
  font-weight: 700;
  color: rgb(var(--c-heading));
}
.hub-public-bug-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.375rem 0.625rem;
  margin-top: 0.375rem;
  font-size: 0.75rem;
  color: rgb(var(--c-text-muted));
}

/* ---------------------------------------------------------------------------
 * Rework (27 October 2026): the older screens share these primitives, so they
 * take the redesign's look from here: panels as soft tiles, headings in the
 * display face, kicker-style table headers, tabs underlined in the world's
 * accent, rows that answer the pointer.
 * ------------------------------------------------------------------------- */

/* Panels: a tile with a cut corner and a soft edge, not a boxed-in card. */
.hub-panel {
  --edge: rgb(var(--c-text-main) / 0.09);
  padding: 1.375rem 1.5rem 1.5rem;
}
.hub-panel.chamfer-edge {
  border-color: var(--edge);
}
.hub-panel > .hub-h2:first-child,
.hub-panel > .flex:first-child > .hub-h2,
.hub-panel > div:first-child > .hub-h2 {
  font-size: 1.0625rem;
}
.hub-panel > .hub-h2 + .hub-muted,
.hub-panel > .hub-h2 + p.hub-muted {
  margin-top: 0.375rem;
  font-size: 0.9375rem;
}

/* Page headings: the display face, sized for a screen rather than a world. */
.hub-title {
  font-size: clamp(1.75rem, 2.6vw, 2.25rem);
  letter-spacing: 0.005em;
}

/* A screen's head: kicker, title and intro on the left, actions on the right. */
.hub-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
  margin-bottom: 1.5rem;
}
.hub-page-head > .hub-page-head-text {
  min-width: min(100%, 18rem);
  flex: 1 1 24rem;
}
.hub-page-head .hub-kicker {
  display: block;
  margin-bottom: 0.375rem;
}
.hub-page-head .hub-title + p {
  max-width: 44rem;
  margin-top: 0.5rem;
  color: rgb(var(--c-text-muted));
}
.hub-page-head > .hub-page-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Tables: header as a kicker, rows that light up, numbers aligned. */
.hub-table th[scope="col"] {
  border-bottom-color: var(--hairline);
  padding: 0.5rem 0.75rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.hub-table :where(td, th[scope="row"]) {
  border-bottom-color: rgb(var(--c-text-main) / 0.07);
  padding: 0.625rem 0.75rem;
}
.hub-table tbody tr {
  transition: background-color 0.15s ease;
}
.hub-table tbody tr:hover {
  background: rgb(var(--c-text-main) / 0.035);
}
.hub-table tr > :is(th, td):first-child {
  padding-left: 0.5rem;
}
.hub-table tr > :is(th, td):last-child {
  padding-right: 0.5rem;
}
/* Buttons in a row are quieter than buttons on the page. */
.hub-table .btn-sm .btn-face {
  --edge: rgb(var(--c-text-main) / 0.22);
  font-weight: 500;
}
.hub-table .btn-sm:hover .btn-face {
  --edge: rgb(var(--c-text-main) / 0.6);
}
.hub-table .btn-sm.btn-danger .btn-face {
  --edge: rgb(var(--p-danger) / 0.55);
}

/* On a narrow screen the table scrolls sideways before a name breaks mid-word. */
.hub-table th[scope="row"] {
  min-width: 13rem;
}
/* More actions for a row (11 November 2026): one quiet button that opens a
   menu, placed on the viewport so a scrolling table never clips it. */
.hub-row-menu-button {
  display: inline-grid;
  width: var(--control-height-sm);
  height: var(--control-height-sm);
  flex: none;
  place-items: center;
  border: 0;
  background: none;
  padding: 0;
  color: rgb(var(--c-text-muted));
  cursor: pointer;
}
.hub-row-menu-button:hover,
.hub-row-menu-button[aria-expanded="true"] {
  background: rgb(var(--c-surface-hover));
  color: rgb(var(--c-heading));
}
.hub-popover.hub-row-menu {
  position: fixed;
  left: auto;
  min-width: 13rem;
  border: 1px solid var(--hairline-strong);
}
.hub-menu-item[data-tone="danger"] {
  color: rgb(var(--p-danger));
}
/* The question a row's menu asked, answered under that row's actions. */
.hub-row-ask {
  display: flex;
  max-width: 26rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 0.5rem 0 0 auto;
  border: 0;
  padding: 0;
  text-align: right;
}
.hub-table td > .status-line {
  max-width: 26rem;
  margin-left: auto;
}

/* Josh's orb sits at the end of the top bar from tablet width up (11 November
   2026), so it never floats over the end of a row; the bar makes room for
   it. His tips drop from the bar and point up at him. Phones keep the
   floating orb above the tab bar. */
@media (min-width: 640px) {
  .hub-orb-launcher {
    top: 0.375rem;
    right: 1rem;
    bottom: auto;
    width: 2.75rem;
    height: 2.75rem;
  }
  .hub-orb-launcher .hub-orb {
    scale: 0.75;
  }
  body:has(.hub-orb-launcher) .hub-bar {
    padding-right: 4.25rem;
  }
  .hub-josh-nudge {
    top: 4rem;
    right: 1rem;
    bottom: auto;
  }
  .hub-josh-nudge::after {
    top: -7px;
    right: 1rem;
    bottom: auto;
    transform: rotate(-45deg);
  }
}
@media (min-width: 1024px) {
  .hub-orb-launcher {
    right: 1.75rem;
  }
  body:has(.hub-orb-launcher) .hub-bar {
    padding-right: 5rem;
  }
  .hub-josh-nudge {
    right: 1.75rem;
  }
}

/* Tabs: underlined in the world's accent, like the world's own tabs. */
.hub-tabs {
  gap: 0 0.25rem;
  border-bottom-color: var(--hairline);
}
.hub-tabs a {
  padding: 0 0.875rem;
  border-bottom: 0;
}
.hub-tabs a:hover {
  color: rgb(var(--c-heading));
}
.hub-tabs a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--world-accent, rgb(var(--c-accent)));
  font-weight: 600;
  color: rgb(var(--c-heading));
}
.hub-db-toolbar .hub-tabs {
  gap: 0 0.125rem;
}
.hub-db-toolbar .hub-tabs button {
  min-height: var(--control-height);
  padding: 0 0.75rem;
  border-bottom: 0;
}
.hub-db-toolbar .hub-tabs button:hover {
  color: rgb(var(--c-heading));
}
.hub-db-toolbar .hub-tabs button[aria-current="true"] {
  box-shadow: inset 0 -2px 0 var(--world-accent, rgb(var(--c-accent)));
  font-weight: 600;
}
.hub-db-toolbar {
  gap: 0.5rem 1rem;
  padding-bottom: 0.625rem;
}
/* Filter, Sort, Group and Properties are quiet until wanted (11 November
   2026): the view's one loud control is New. A count or a pressed state
   brings the edge back. */
.hub-db-toolbar .btn-sm:not(.btn-primary) .btn-face,
.hub-quiet-btn .btn-face {
  --edge: transparent;
  background: transparent;
  padding-inline: 0.625rem;
  font-weight: 500;
  color: rgb(var(--c-text-muted));
}
.hub-db-toolbar
  .btn-sm:not(.btn-primary):is(
    :hover,
    :focus-visible,
    [aria-expanded="true"],
    [aria-pressed="true"]
  )
  .btn-face,
.hub-quiet-btn:is(:hover, :focus-visible) .btn-face {
  --edge: var(--hairline-strong);
  background: rgb(var(--c-surface));
  color: rgb(var(--c-heading));
}
.hub-db-toolbar .field {
  min-height: var(--control-height-sm);
  margin-top: 0;
  padding-block: 0.25rem;
  font-size: var(--text-tool);
}

/* Inbox rows: unread ones carry a tint, and the read toggle stays quiet. */
.hub-inbox-item {
  margin: 0 -0.75rem;
  padding: 0.75rem;
  border-top: 1px solid rgb(var(--c-text-main) / 0.07);
  transition: background-color 0.15s ease;
}
.hub-inbox-item[data-unread="true"] {
  background: color-mix(in srgb, rgb(var(--c-accent)) 5%, transparent);
}
.hub-inbox-item:hover {
  background: rgb(var(--c-text-main) / 0.035);
}
.hub-inbox-item .btn-sm .btn-face {
  --edge: transparent;
  background: transparent;
  padding-inline: 0.5rem;
  font-weight: 500;
  color: rgb(var(--c-text-muted));
}
.hub-inbox-item .btn-sm:hover .btn-face,
.hub-inbox-item .btn-sm:focus-visible .btn-face {
  --edge: rgb(var(--c-text-main) / 0.4);
  color: rgb(var(--c-heading));
}
.hub-inbox-kind {
  display: inline-block;
  margin-right: 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--world-accent, rgb(var(--c-signal)));
}

/* Day headings in lists (the inbox, the audit log) read as kickers. */
.hub-day-head {
  display: block;
  margin: 1.5rem 0 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(var(--c-text-muted));
}

/* The lines list (review screens): a little more air. */
.hub-lines > div {
  padding: 0.75rem 0;
}

/* A settings screen: an index on the left that follows you, groups of tiles on the right. */
.hub-settings {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1100px) {
  .hub-settings {
    grid-template-columns: 11rem minmax(0, 1fr);
    gap: 2.5rem;
  }
  .hub-settings-index {
    position: sticky;
    top: 5rem;
    align-self: start;
  }
}
.hub-settings-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem 0.75rem;
}
@media (min-width: 1100px) {
  .hub-settings-index {
    flex-direction: column;
  }
}
.hub-settings-index .hub-kicker {
  width: 100%;
  margin-bottom: 0.375rem;
}
.hub-settings-link {
  display: inline-flex;
  min-height: 2.25rem;
  align-items: center;
  border-left: 2px solid transparent;
  padding: 0 0.625rem;
  color: rgb(var(--c-text-muted));
  text-decoration: none;
}
.hub-settings-link:hover {
  color: rgb(var(--c-heading));
}
.hub-settings-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2.5rem;
}
.hub-settings-group {
  scroll-margin-top: 5rem;
}
.hub-settings-group-title {
  margin: 0 0 0.875rem;
  font-family: var(--font-russo);
  font-synthesis: none;
  font-size: 1.375rem;
  font-weight: 400;
  color: rgb(var(--c-heading));
}
.hub-settings-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  align-items: start;
}
.hub-settings-grid > form:first-child {
  grid-row: span 2;
}

/* Audit log rows: who, what (as a chip in the code face), on what, and when. */
.hub-audit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.25rem 1rem;
  align-items: start;
  border-top: 1px solid rgb(var(--c-text-main) / 0.07);
  padding: 0.75rem 0;
}
.hub-audit-action {
  display: inline-block;
  border: 1px solid rgb(var(--c-text-main) / 0.14);
  background: rgb(var(--c-surface));
  padding: 0 0.4rem;
  font-family: var(--font-code);
  font-size: 0.75rem;
  line-height: 1.375rem;
  color: rgb(var(--c-heading));
}

/* Wide screens: the content grows to 90rem and sits centred in its column,
   and a world's header band bleeds across the whole column however wide it
   is, measured from the column (a size container) rather than the viewport. */
.hub-content {
  container-type: inline-size;
}
.hub-content-inner {
  max-width: 90rem;
  margin-inline: auto;
}
.hub-world-head {
  /* cqw is the column's content box, so its own padding is added back. */
  margin-inline: calc((100% - 100cqw) / 2 - 1rem);
  padding-inline: calc((100cqw - 100%) / 2 + 1rem);
}
@media (min-width: 1024px) {
  .hub-world-head {
    margin-inline: calc((100% - 100cqw) / 2 - 1.75rem);
    padding-inline: calc((100cqw - 100%) / 2 + 1.75rem);
  }
}

/* ---------------------------------------------------------------------------
 * Profile pictures and direct messages (ADR-0009, 28 October 2026).
 * ------------------------------------------------------------------------- */

/* A picture fills its cut-corner tile; initials stay as they were. */
.hub-avatar {
  overflow: hidden;
}
.hub-avatar > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hub-strip-me {
  display: inline-grid;
  border-radius: 2px;
}
.hub-strip-me:focus-visible {
  outline: 2px solid rgb(var(--c-accent));
  outline-offset: 3px;
}

/* Your chats beside the open one; the pair fills the screen below the head. */
.hub-dm {
  --edge: rgb(var(--c-text-main) / 0.09);
  display: grid;
  grid-template-columns: minmax(16rem, 22rem) minmax(0, 1fr);
  /* Ends above the Josh button in the corner, so it never covers Send. */
  height: max(28rem, calc(100dvh - 19rem));
  border: 1px solid var(--edge);
  background: rgb(var(--c-surface));
}
.hub-dm-list {
  overflow-y: auto;
  border-right: 1px solid var(--edge);
}
.hub-dm-chat {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid rgb(var(--c-text-main) / 0.05);
  padding: 0.75rem 1rem;
  color: inherit;
  text-decoration: none;
}
.hub-dm-chat:hover {
  background: rgb(var(--c-text-main) / 0.04);
}
.hub-dm-chat[aria-current="page"] {
  background: rgb(var(--c-text-main) / 0.07);
  box-shadow: inset 3px 0 0 rgb(var(--c-accent));
}
.hub-dm-chat:focus-visible {
  outline: 2px solid rgb(var(--c-accent));
  outline-offset: -2px;
}
.hub-dm-chat-top {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
.hub-dm-chat-name {
  min-width: 0;
  flex: 1;
  font-weight: 600;
  color: rgb(var(--c-heading));
}
.hub-dm-chat-time {
  flex: none;
  font-size: 0.75rem;
  color: rgb(var(--c-text-muted));
}
.hub-dm-chat-preview {
  display: block;
  margin-top: 0.125rem;
  font-size: 0.875rem;
  color: rgb(var(--c-text-muted));
}
.hub-dm-chat[data-unread="true"] .hub-dm-chat-preview {
  color: rgb(var(--c-text-main));
}
.hub-dm-faces {
  display: inline-flex;
  flex: none;
}
.hub-dm-faces > .hub-avatar + .hub-avatar {
  margin-left: -0.625rem;
  margin-top: 0.625rem;
  box-shadow: 0 0 0 2px rgb(var(--c-surface));
}
.hub-dm-muted {
  flex: none;
  border: 1px solid var(--hairline);
  padding: 0 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgb(var(--c-text-muted));
}

/* The open chat: a head, the scrolling log, the composer. */
.hub-dm-thread {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}
.hub-dm-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--edge);
  padding: 0.75rem 1rem;
}
.hub-dm-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  color: rgb(var(--c-heading));
}
.hub-dm-back {
  display: inline-grid;
  width: var(--control-height-sm);
  height: var(--control-height-sm);
  flex: none;
  place-items: center;
  font-size: 1.5rem;
  line-height: 1;
  color: rgb(var(--c-heading));
  text-decoration: none;
}
.hub-dm-note {
  margin: 0;
  border-bottom: 1px solid var(--edge);
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  color: rgb(var(--c-text-muted));
}
.hub-dm-rename {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
  border-bottom: 1px solid var(--edge);
  padding: 0.75rem 1rem;
}
.hub-dm-log {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.25rem 0 0.75rem;
}
.hub-dm-log:focus-visible {
  outline: 2px solid rgb(var(--c-accent));
  outline-offset: -2px;
}
.hub-dm-messages {
  margin: 0;
  padding: 0;
  list-style: none;
}
.hub-dm-day {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding: 0.75rem 0 0.25rem;
}
.hub-dm-day > span {
  background: rgb(var(--c-surface));
  padding: 0.125rem 0.625rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgb(var(--c-text-muted));
}
.hub-dm-system {
  padding: 0.375rem 1rem;
  text-align: center;
  font-size: 0.8125rem;
  color: rgb(var(--c-text-muted));
}
.hub-dm-message {
  position: relative;
  display: flex;
  gap: 0.75rem;
  padding: 0.5rem 1rem 0.125rem;
}
.hub-dm-message[data-continues] {
  padding-top: 0.0625rem;
}
.hub-dm-message:hover,
.hub-dm-message:focus-within {
  background: rgb(var(--c-text-main) / 0.03);
}
.hub-dm-gutter {
  display: flex;
  width: 2.25rem;
  flex: none;
  justify-content: center;
}
.hub-dm-hover-time {
  visibility: hidden;
  padding-top: 0.1875rem;
  font-size: 0.6875rem;
  color: rgb(var(--c-text-muted));
}
.hub-dm-message:hover .hub-dm-hover-time,
.hub-dm-message:focus-within .hub-dm-hover-time {
  visibility: visible;
}
.hub-dm-meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin: 0;
}
.hub-dm-author {
  font-weight: 600;
  color: rgb(var(--c-heading));
}
.hub-dm-meta time {
  font-size: 0.75rem;
  color: rgb(var(--c-text-muted));
}
.hub-dm-body {
  margin: 0.0625rem 0 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.hub-dm-actions {
  position: absolute;
  top: 0.25rem;
  right: 1rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
  background: rgb(var(--c-surface));
  padding: 0.125rem 0.25rem;
}
.hub-dm-action {
  border: 0;
  background: none;
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  color: rgb(var(--c-text-muted));
  opacity: 0;
  cursor: pointer;
}
.hub-dm-message:hover .hub-dm-action,
.hub-dm-action:focus-visible {
  opacity: 1;
}
.hub-dm-action:hover {
  color: rgb(var(--c-heading));
  text-decoration: underline;
}
/* Touch screens have no hover: the delete control stays in view. */
@media (hover: none) {
  .hub-dm-action {
    opacity: 1;
  }
  .hub-dm-hover-time {
    visibility: visible;
  }
}
.hub-dm-footer {
  padding: 0.125rem 1rem 0 4rem;
  font-size: 0.75rem;
  color: rgb(var(--c-text-muted));
}
.hub-dm-composer {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
  border-top: 1px solid var(--edge);
  padding: 0.75rem 1rem;
}
.hub-dm-input {
  min-width: 0;
  flex: 1;
  resize: none;
  line-height: 1.45;
}
.hub-dm-hint {
  width: 100%;
  margin: 0;
  font-size: 0.6875rem;
  color: rgb(var(--c-text-muted));
}
.hub-dm-empty {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

/* Choosing people: a scrolling list of checkboxes with faces. */
.hub-dm-people {
  max-height: 18rem;
  overflow-y: auto;
  margin: 0;
  border: 1px solid var(--hairline);
  padding: 0.25rem 0;
}
.hub-dm-person {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
}
.hub-dm-person:hover {
  background: rgb(var(--c-text-main) / 0.04);
}
.hub-dm-chosen {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  cursor: pointer;
}
.hub-dm-transcript {
  max-height: 70vh;
  overflow-y: auto;
  border-top: 1px solid var(--hairline);
}

/* Phones and narrow windows: the list or the open chat, one at a time. */
@media (max-width: 767px) {
  .hub-dm {
    grid-template-columns: minmax(0, 1fr);
    height: max(24rem, calc(100dvh - 17rem));
    margin-inline: -1rem;
    border-inline: 0;
  }
  .hub-dm-list {
    border-right: 0;
  }
  .hub-dm[data-open] .hub-dm-list,
  .hub-dm:not([data-open]) .hub-dm-thread {
    display: none;
  }
  /* An open chat takes the screen between the bar and the tabs. */
  .hub-dm-page[data-open] > .hub-page-head {
    display: none;
  }
  .hub-dm[data-open] {
    height: calc(100dvh - 9.5rem);
    margin-top: -0.5rem;
  }
  /* Josh steps aside so the composer's Send is never under it; he is in the menu. */
  body:has(.hub-dm[data-open]) .hub-orb-launcher {
    display: none;
  }
  .hub-dm-hint {
    display: none;
  }
}

/* Josh at work (ADR-0010): the dots, and beside them what he is checking. */
.hub-josh-working {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.75rem;
}
.hub-josh-step {
  font-size: 0.8125rem;
  color: rgb(var(--c-text-muted));
}

/* Job roles (28 October 2026): what someone does, under their name. */
.hub-job-role {
  font-weight: 500;
  color: rgb(var(--c-text-main));
}

/* A colour wheel (28 October 2026): hue around the edge, strength towards
   the middle, brightness as a veil over the whole disc. */
.hub-wheel {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem 1.25rem;
  margin-top: 0.375rem;
}
.hub-wheel-disc {
  position: relative;
  width: 10.5rem;
  height: 10.5rem;
  flex: none;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, rgb(var(--c-paper)), rgb(var(--c-paper) / 0)),
    conic-gradient(#f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
  box-shadow: 0 0 0 1px rgb(var(--c-text-main) / 0.18);
  cursor: crosshair;
  touch-action: none;
}
.hub-wheel-disc::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgb(var(--c-shade));
  opacity: var(--wheel-dim, 0);
  pointer-events: none;
}
.hub-wheel-disc:focus-visible {
  outline: 2px solid rgb(var(--c-accent));
  outline-offset: 4px;
}
.hub-wheel-marker {
  position: absolute;
  z-index: 1;
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid rgb(var(--c-paper));
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgb(var(--c-shade) / 0.6),
    0 1px 4px rgb(var(--c-shade) / 0.5);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.hub-wheel-side {
  display: flex;
  min-width: 10rem;
  flex-direction: column;
  gap: 0.75rem;
}
.hub-wheel-preview {
  width: 3rem;
  height: 3rem;
  outline: 1px solid rgb(var(--c-text-muted) / 0.75);
  background-image: none;
}
.hub-wheel-range {
  width: 100%;
  margin-top: 0.375rem;
  accent-color: var(--wheel-hue, rgb(var(--c-accent)));
}

/* Reordering the strip (28 October 2026): the tile being dragged fades, and a
   line shows where it will land. */
.hub-strip-tile[data-dragging="true"] {
  opacity: 0.4;
}
.hub-strip-tile[data-drop]::after {
  content: "";
  position: absolute;
  left: -0.25rem;
  right: -0.25rem;
  height: 3px;
  background: rgb(var(--c-accent));
  pointer-events: none;
}
.hub-strip-tile[data-drop="before"]::after {
  top: -0.4rem;
}
.hub-strip-tile[data-drop="after"]::after {
  bottom: -0.4rem;
}
/* The same in the sidebar's Worlds list (11 November 2026): a grip shows on
   hover or focus to say the row can be dragged. */
.hub-sidebar .hub-nav-world {
  position: relative;
  cursor: grab;
}
.hub-sidebar .hub-nav-world > svg:last-child {
  margin-left: auto;
  flex: none;
  opacity: 0;
}
.hub-sidebar .hub-nav-world:hover > svg:last-child,
.hub-sidebar .hub-nav-world:focus-visible > svg:last-child {
  opacity: 0.6;
}
.hub-nav-world[data-dragging="true"] {
  opacity: 0.4;
}
.hub-nav-world[data-drop]::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  height: 2px;
  background: rgb(var(--c-accent));
  pointer-events: none;
}
.hub-nav-world[data-drop="before"]::after {
  top: -1px;
}
.hub-nav-world[data-drop="after"]::after {
  bottom: -1px;
}
/* Touch: no link callout or text selection when a world is held to be moved. */
.hub-strip-tile[draggable="true"] {
  -webkit-touch-callout: none;
  user-select: none;
}
.hub-dm-job {
  font-size: 0.75rem;
  color: rgb(var(--c-text-muted));
}

/* Direct messages: images, edits and the live composer (28 October 2026). */
.hub-dm-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.375rem;
}
.hub-dm-image {
  display: block;
  max-width: min(20rem, 100%);
  border: 1px solid var(--hairline);
  line-height: 0;
}
.hub-dm-image img {
  max-width: 100%;
  max-height: 15rem;
  object-fit: contain;
  background: rgb(var(--c-background));
}
.hub-dm-image:focus-visible {
  outline: 2px solid rgb(var(--c-accent));
  outline-offset: 2px;
}
.hub-dm-edited {
  font-size: 0.75rem;
  color: rgb(var(--c-text-muted));
}
.hub-dm-edit {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.hub-dm-composer[data-over="true"] {
  outline: 2px dashed rgb(var(--c-accent));
  outline-offset: -4px;
}
.hub-dm-attach .btn-face {
  padding-inline: 0.625rem;
}
.hub-dm-pending {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hub-dm-pending > li {
  position: relative;
  width: 4.5rem;
  height: 4.5rem;
  border: 1px solid var(--hairline);
}
.hub-dm-pending > li img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hub-dm-pending > li[data-state="uploading"] img {
  opacity: 0.45;
}
.hub-dm-pending > li[data-state="failed"] {
  border-color: rgb(var(--p-danger));
}
.hub-dm-pending-problem {
  position: absolute;
  inset: auto 0 0 0;
  background: rgb(var(--c-shade) / 0.72);
  padding: 0.125rem 0.25rem;
  font-size: 0.625rem;
  line-height: 1.2;
  color: rgb(var(--c-on-accent));
}
.hub-dm-pending-remove {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  display: grid;
  width: 1.5rem;
  height: 1.5rem;
  place-items: center;
  border: 1px solid var(--hairline-strong);
  border-radius: 50%;
  background: rgb(var(--c-surface));
  font-size: 0.875rem;
  line-height: 1;
  color: rgb(var(--c-heading));
  cursor: pointer;
}
.hub-dm-pending-remove:focus-visible {
  outline: 2px solid rgb(var(--c-accent));
  outline-offset: 2px;
}

/* Staff activity (28 October 2026): a small bar per day, scaled to the busiest. */
.hub-activity-bars {
  display: inline-flex;
  height: 1.75rem;
  align-items: flex-end;
  gap: 2px;
}
.hub-activity-bars > span {
  width: 0.5rem;
  min-height: 2px;
  background: var(--world-accent, rgb(var(--c-accent)));
}
.hub-activity-bars > span[data-empty] {
  background: rgb(var(--c-text-main) / 0.15);
}
.hub-tabs-pick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin: 0;
  border: 0;
  padding: 0;
}
.hub-tabs-pick .btn[aria-pressed="true"] .btn-face {
  background: var(--hairline);
  color: rgb(var(--c-heading));
}

/* Morning briefing (28 October 2026). */
.hub-briefing-list {
  display: grid;
  gap: 0.625rem;
  margin: 0;
  padding-left: 1.125rem;
  list-style: disc;
}
.hub-briefing-list > li::marker {
  color: rgb(var(--c-text-main) / 0.45);
}
