/* hub-kit v1 — shared design surface for tools proxied behind the Travis
 * Admin Hub. Framework-free; drop in via:
 *
 *   <link rel="stylesheet" href="/hub-kit/v1/theme.css">
 *   <script src="/hub-kit/v1/kit.js" defer></script>
 *
 * All selectors use the `hub-` prefix so the kit never collides with a tool's
 * own stylesheet. Tokens live in tokens.css (imported below) so downstream
 * tooling can parse them separately.
 */

@import url("./tokens.css");

/* ─────────────────────────────────────────────────────────────────
 * Self-hosted Roboto subset — no external dependency on Google Fonts.
 * Keeps third-party tools GDPR-friendly and removes a blocking network
 * request on cold load. Only the Latin subset is shipped; tools that
 * need Cyrillic/Greek/Vietnamese can load their own @font-face.
 * ──────────────────────────────────────────────────────────────── */
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("./fonts/roboto-latin-400.woff2") format("woff2");
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./fonts/roboto-latin-500.woff2") format("woff2");
}
@font-face {
  font-family: "Roboto";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("./fonts/roboto-latin-700.woff2") format("woff2");
}

/* ─────────────────────────────────────────────────────────────────
 * Box-sizing reset. Scoped to body.hub-body so tools that opt into
 * the hub chrome get the predictable layout behaviour, but tools that
 * only include theme.css for component styles keep their own reset.
 * ──────────────────────────────────────────────────────────────── */
body.hub-body *,
body.hub-body *::before,
body.hub-body *::after {
  box-sizing: border-box;
}

/* ─────────────────────────────────────────────────────────────────
 * Body helper — tools that want the hub's background/typography on
 * the whole page add `class="hub-body"` to <body>. Opt-in so tools
 * that already have their own chrome aren't overridden.
 * ──────────────────────────────────────────────────────────────── */
body.hub-body {
  margin: 0;
  background: var(--hub-color-background);
  color: var(--hub-color-text);
  font-family: var(--hub-font-sans);
  font-size: var(--hub-font-size-base);
  line-height: var(--hub-line-height-base);
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────────────────────────────────────
 * Rail (unchanged from v0 — kept verbatim so tools that only used
 * the rail continue to render identically after upgrading).
 * ──────────────────────────────────────────────────────────────── */
.hub-rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--hub-rail-width);
  background: var(--hub-rail-bg);
  color: var(--hub-rail-fg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  gap: 4px;
  z-index: var(--hub-z-rail);
  font-family: var(--hub-font-sans);
  border-right: 1px solid var(--hub-rail-border);
  box-sizing: border-box;
}
body.hub-rail-present { margin-left: var(--hub-rail-width); }

.hub-rail a,
.hub-rail button {
  position: relative;
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: inherit; text-decoration: none;
  background: transparent; border: 0; padding: 0; margin: 0;
  cursor: pointer; font: inherit;
  transition: background 0.1s, color 0.1s;
}
.hub-rail a:hover, .hub-rail button:hover {
  background: var(--hub-rail-hover-bg); color: #fff;
}
.hub-rail a.hub-active {
  background: var(--hub-rail-active-bg); color: var(--hub-rail-active-fg);
}
.hub-rail a.hub-active::before,
.hub-rail a:hover::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 2px 2px 0; background: var(--hub-rail-accent);
}
.hub-rail a:hover:not(.hub-active)::before { background: rgba(107, 114, 128, 0.6); }
.hub-rail a.hub-active[data-accent="tool"]::before { background: var(--hub-rail-accent-tool); }
.hub-rail .hub-sep { width: 32px; height: 1px; background: var(--hub-rail-border); margin: 6px 0; flex-shrink: 0; }
.hub-rail .hub-spacer { flex: 1; }
.hub-rail .hub-tooltip {
  position: absolute; left: 52px; top: 50%; transform: translateY(-50%);
  background: #111827; color: #fff; padding: 4px 10px; border-radius: 6px;
  white-space: nowrap; font-size: 12px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: opacity 0.1s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.hub-rail a:hover .hub-tooltip, .hub-rail button:hover .hub-tooltip { opacity: 1; }
.hub-rail svg { width: 20px; height: 20px; stroke-width: 2.25; flex-shrink: 0; }
.hub-rail .hub-brand {
  width: 40px; height: 40px; border-radius: 8px;
  background: var(--hub-color-primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.hub-rail .hub-brand-link { width: 40px; height: 40px; margin-bottom: 4px; border-radius: 8px; padding: 0; background: transparent; }
.hub-rail .hub-brand-link:hover { background: transparent; }
.hub-rail .hub-brand-link:hover .hub-brand { background: var(--hub-color-primary-hover); }
.hub-rail .hub-brand-link:hover::before { display: none; }
.hub-rail .hub-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: #1f2937; color: #e5e7eb; border: 1px solid #374151;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 11px; letter-spacing: 0.02em;
}
.hub-rail .hub-avatar-link:hover { background: transparent; }
.hub-rail .hub-avatar-link:hover .hub-avatar { box-shadow: 0 0 0 2px #4b5563; }
.hub-rail .hub-avatar-link:hover::before { display: none; }

/* ─────────────────────────────────────────────────────────────────
 * Page header — title + description + actions row.
 *
 *   <header class="hub-page-header">
 *     <div>
 *       <h1 class="hub-page-title">Bookings</h1>
 *       <p class="hub-page-description">All reservations.</p>
 *     </div>
 *     <div class="hub-page-actions">
 *       <button class="hub-btn hub-btn-primary">New booking</button>
 *     </div>
 *   </header>
 * ──────────────────────────────────────────────────────────────── */
.hub-page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--hub-space-6); margin-bottom: var(--hub-space-6);
  flex-wrap: wrap;
}
.hub-page-title {
  font-size: var(--hub-font-size-3xl); font-weight: var(--hub-font-weight-bold);
  color: var(--hub-color-text); margin: 0 0 var(--hub-space-1); line-height: var(--hub-line-height-tight);
}
.hub-page-description {
  font-size: var(--hub-font-size-base); color: var(--hub-color-text-muted);
  margin: 0; max-width: 64ch;
}
.hub-page-actions { display: inline-flex; gap: var(--hub-space-2); flex-wrap: wrap; }

/* ─────────────────────────────────────────────────────────────────
 * Breadcrumbs.
 *
 *   <nav class="hub-breadcrumbs" aria-label="Breadcrumb">
 *     <a href="/">Home</a>
 *     <span class="hub-breadcrumb-sep" aria-hidden="true">›</span>
 *     <a href="/bookings">Bookings</a>
 *     <span class="hub-breadcrumb-sep" aria-hidden="true">›</span>
 *     <span aria-current="page">#4521</span>
 *   </nav>
 * ──────────────────────────────────────────────────────────────── */
.hub-breadcrumbs {
  display: flex; align-items: center; gap: var(--hub-space-2);
  font-size: var(--hub-font-size-sm); color: var(--hub-color-text-muted);
  margin-bottom: var(--hub-space-4);
}
.hub-breadcrumbs a { color: var(--hub-color-text-muted); text-decoration: none; }
.hub-breadcrumbs a:hover { color: var(--hub-color-primary); text-decoration: underline; }
.hub-breadcrumbs [aria-current="page"] { color: var(--hub-color-text); font-weight: var(--hub-font-weight-medium); }
.hub-breadcrumb-sep { color: var(--hub-color-border); }

/* ─────────────────────────────────────────────────────────────────
 * Grid layout — 12 column, gap-4 by default.
 *
 *   <div class="hub-grid">
 *     <div class="hub-col-12 hub-col-md-6 hub-col-lg-4">…</div>
 *   </div>
 * ──────────────────────────────────────────────────────────────── */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--hub-space-4);
}
.hub-grid-tight { gap: var(--hub-space-2); }
.hub-grid-loose { gap: var(--hub-space-6); }

.hub-col-1  { grid-column: span 1;  }
.hub-col-2  { grid-column: span 2;  }
.hub-col-3  { grid-column: span 3;  }
.hub-col-4  { grid-column: span 4;  }
.hub-col-5  { grid-column: span 5;  }
.hub-col-6  { grid-column: span 6;  }
.hub-col-7  { grid-column: span 7;  }
.hub-col-8  { grid-column: span 8;  }
.hub-col-9  { grid-column: span 9;  }
.hub-col-10 { grid-column: span 10; }
.hub-col-11 { grid-column: span 11; }
.hub-col-12 { grid-column: span 12; }

@media (min-width: 768px) {
  .hub-col-md-1  { grid-column: span 1;  }
  .hub-col-md-2  { grid-column: span 2;  }
  .hub-col-md-3  { grid-column: span 3;  }
  .hub-col-md-4  { grid-column: span 4;  }
  .hub-col-md-5  { grid-column: span 5;  }
  .hub-col-md-6  { grid-column: span 6;  }
  .hub-col-md-7  { grid-column: span 7;  }
  .hub-col-md-8  { grid-column: span 8;  }
  .hub-col-md-9  { grid-column: span 9;  }
  .hub-col-md-10 { grid-column: span 10; }
  .hub-col-md-11 { grid-column: span 11; }
  .hub-col-md-12 { grid-column: span 12; }
}
@media (min-width: 1024px) {
  .hub-col-lg-1  { grid-column: span 1;  }
  .hub-col-lg-2  { grid-column: span 2;  }
  .hub-col-lg-3  { grid-column: span 3;  }
  .hub-col-lg-4  { grid-column: span 4;  }
  .hub-col-lg-5  { grid-column: span 5;  }
  .hub-col-lg-6  { grid-column: span 6;  }
  .hub-col-lg-7  { grid-column: span 7;  }
  .hub-col-lg-8  { grid-column: span 8;  }
  .hub-col-lg-9  { grid-column: span 9;  }
  .hub-col-lg-10 { grid-column: span 10; }
  .hub-col-lg-11 { grid-column: span 11; }
  .hub-col-lg-12 { grid-column: span 12; }
}

/* ─────────────────────────────────────────────────────────────────
 * Card — primary surface container. Radius 1rem matches Travis.
 * ──────────────────────────────────────────────────────────────── */
.hub-card {
  background: var(--hub-color-surface);
  border: 1px solid var(--hub-color-border-soft);
  border-radius: var(--hub-radius-xl);
  box-shadow: var(--hub-shadow-sm);
  overflow: hidden;
}
.hub-card-header {
  padding: var(--hub-space-5) var(--hub-space-6) var(--hub-space-2);
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: var(--hub-space-4);
}
.hub-card-title {
  font-size: var(--hub-font-size-lg); font-weight: var(--hub-font-weight-semibold);
  color: var(--hub-color-text); margin: 0;
}
.hub-card-description {
  font-size: var(--hub-font-size-sm); color: var(--hub-color-text-muted);
  margin: var(--hub-space-1) 0 0;
}
.hub-card-body { padding: var(--hub-space-5) var(--hub-space-6); }
.hub-card-footer {
  padding: var(--hub-space-3) var(--hub-space-6);
  border-top: 1px solid var(--hub-color-border-soft);
  display: flex; align-items: center; justify-content: flex-end; gap: var(--hub-space-2);
  background: var(--hub-color-background);
}

/* ─────────────────────────────────────────────────────────────────
 * Button.
 * ──────────────────────────────────────────────────────────────── */
.hub-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: var(--hub-space-2);
  padding: 0.5rem 1rem;
  font-family: inherit; font-size: var(--hub-font-size-sm);
  font-weight: var(--hub-font-weight-medium); line-height: 1;
  border-radius: var(--hub-radius-md);
  border: 1px solid transparent;
  background: transparent; color: var(--hub-color-text);
  cursor: pointer; user-select: none;
  transition: background 0.1s, border-color 0.1s, color 0.1s, box-shadow 0.1s;
}
.hub-btn:focus-visible {
  outline: 2px solid var(--hub-color-primary);
  outline-offset: 2px;
}
.hub-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.hub-btn-primary {
  background: var(--hub-color-primary); color: var(--hub-color-primary-fg);
  border-color: var(--hub-color-primary);
}
.hub-btn-primary:hover:not(:disabled) {
  background: var(--hub-color-primary-hover); border-color: var(--hub-color-primary-hover);
}
.hub-btn-secondary {
  background: var(--hub-color-secondary); color: var(--hub-color-secondary-fg);
  border-color: var(--hub-color-secondary);
}
.hub-btn-secondary:hover:not(:disabled) {
  background: var(--hub-color-secondary-hover); border-color: var(--hub-color-secondary-hover);
}
.hub-btn-outline {
  background: var(--hub-color-surface); color: var(--hub-color-text);
  border-color: var(--hub-color-border);
}
.hub-btn-outline:hover:not(:disabled) {
  background: var(--hub-color-primary-tint-soft);
  border-color: var(--hub-color-primary);
  color: var(--hub-color-primary-hover);
}
.hub-btn-ghost {
  background: transparent; color: var(--hub-color-text);
}
.hub-btn-ghost:hover:not(:disabled) {
  background: var(--hub-color-surface-alt);
}
.hub-btn-danger {
  background: var(--hub-color-danger); color: #fff; border-color: var(--hub-color-danger);
}
.hub-btn-danger:hover:not(:disabled) { background: #a30000; border-color: #a30000; }

.hub-btn-sm { padding: 0.375rem 0.75rem; font-size: var(--hub-font-size-xs); }
.hub-btn-lg { padding: 0.75rem 1.5rem; font-size: var(--hub-font-size-base); }
.hub-btn-block { width: 100%; }

.hub-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────────────────
 * Label / Badge.
 *
 *   <span class="hub-badge hub-badge-success">Paid</span>
 * ──────────────────────────────────────────────────────────────── */
.hub-badge {
  display: inline-flex; align-items: center; gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  font-size: var(--hub-font-size-xs); font-weight: var(--hub-font-weight-semibold);
  line-height: 1; border-radius: var(--hub-radius-lg);
  background: var(--hub-color-surface-alt); color: var(--hub-color-text);
  border: 1px solid transparent;
}
.hub-badge-primary   { background: var(--hub-color-primary-tint); color: var(--hub-color-info-fg); }
.hub-badge-success   { background: var(--hub-color-success-bg); color: var(--hub-color-success-fg); }
.hub-badge-warning   { background: var(--hub-color-warning-bg); color: var(--hub-color-warning-fg); }
.hub-badge-danger    { background: var(--hub-color-danger-bg);  color: var(--hub-color-danger-fg);  }
.hub-badge-info      { background: var(--hub-color-info-bg);    color: var(--hub-color-info-fg);    }
.hub-badge-neutral   { background: var(--hub-color-surface-alt); color: var(--hub-color-text-subtle); }
.hub-badge-outline   { background: transparent; border-color: var(--hub-color-border); color: var(--hub-color-text-subtle); }

.hub-badge-dot::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────────
 * Table.
 * ──────────────────────────────────────────────────────────────── */
.hub-table-wrap {
  background: var(--hub-color-surface);
  border: 1px solid var(--hub-color-border-soft);
  border-radius: var(--hub-radius-xl);
  overflow: hidden; box-shadow: var(--hub-shadow-sm);
}
.hub-table {
  width: 100%; border-collapse: collapse;
  font-size: var(--hub-font-size-sm); color: var(--hub-color-text);
}
.hub-table th, .hub-table td {
  padding: var(--hub-space-3) var(--hub-space-4);
  text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--hub-color-border-soft);
}
.hub-table th {
  font-weight: var(--hub-font-weight-semibold);
  color: var(--hub-color-text-subtle);
  background: var(--hub-color-background);
  font-size: var(--hub-font-size-xs);
  letter-spacing: 0.02em; text-transform: uppercase;
}
.hub-table tbody tr:last-child td { border-bottom: 0; }
.hub-table tbody tr:hover { background: var(--hub-color-primary-tint-soft); }
.hub-table-compact th, .hub-table-compact td { padding: var(--hub-space-2) var(--hub-space-3); }

/* ─────────────────────────────────────────────────────────────────
 * Menu — horizontal app nav. Separate from the rail (rail is the
 * cross-tool nav; this is the tool's own primary nav).
 *
 *   <nav class="hub-menu">
 *     <a class="hub-menu-brand" href="/">Logo</a>
 *     <ul class="hub-menu-items">
 *       <li><a class="hub-menu-link hub-active" href="/">Dashboard</a></li>
 *       …
 *     </ul>
 *     <div class="hub-menu-end">
 *       <button class="hub-btn hub-btn-ghost">Account</button>
 *     </div>
 *   </nav>
 * ──────────────────────────────────────────────────────────────── */
.hub-menu {
  display: flex; align-items: center; gap: var(--hub-space-4);
  height: 60px; padding: 0 var(--hub-space-6);
  background: var(--hub-color-secondary); color: var(--hub-color-secondary-fg);
  font-family: var(--hub-font-sans);
}
.hub-menu-brand {
  display: inline-flex; align-items: center; gap: var(--hub-space-2);
  color: inherit; text-decoration: none;
  font-weight: var(--hub-font-weight-bold); font-size: var(--hub-font-size-lg);
}
.hub-menu-items {
  display: flex; align-items: center; gap: var(--hub-space-1);
  list-style: none; padding: 0; margin: 0;
  flex: 1;
}
.hub-menu-link {
  display: inline-flex; align-items: center; gap: var(--hub-space-2);
  padding: 0.5rem 0.875rem; border-radius: var(--hub-radius-md);
  color: rgba(255, 255, 255, 0.78); text-decoration: none;
  font-size: var(--hub-font-size-sm); font-weight: var(--hub-font-weight-medium);
  transition: background 0.1s, color 0.1s;
}
.hub-menu-link:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.hub-menu-link.hub-active { background: rgba(255, 255, 255, 0.14); color: #fff; }
.hub-menu-end { display: inline-flex; align-items: center; gap: var(--hub-space-2); margin-left: auto; }
/* Inside the dark app menu, ghost buttons read on the navy chrome. Scoped
 * so body-level ghost buttons keep their normal text colour. */
.hub-menu .hub-btn-ghost { color: #fff; }
.hub-menu .hub-btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); color: #fff; }

/* ─────────────────────────────────────────────────────────────────
 * Dropdown (for menu items and in-app menus). Driven by kit.js —
 * data-hub-dropdown on trigger, aria-controls pointing to the menu.
 * ──────────────────────────────────────────────────────────────── */
.hub-dropdown { position: relative; display: inline-block; }
.hub-dropdown-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 180px;
  background: var(--hub-color-surface); color: var(--hub-color-text);
  border: 1px solid var(--hub-color-border-soft);
  border-radius: var(--hub-radius-md);
  box-shadow: var(--hub-shadow-lg);
  padding: var(--hub-space-1); z-index: var(--hub-z-modal);
  display: none;
}
.hub-dropdown-menu[data-open="true"] { display: block; }
.hub-dropdown-item {
  display: flex; align-items: center; gap: var(--hub-space-2);
  width: 100%; padding: 0.5rem 0.75rem;
  border: 0; background: transparent; color: inherit;
  font: inherit; text-align: left; text-decoration: none;
  border-radius: var(--hub-radius-sm);
  cursor: pointer;
}
.hub-dropdown-item:hover, .hub-dropdown-item:focus {
  background: var(--hub-color-primary-tint-soft); outline: 0;
}
.hub-dropdown-sep { height: 1px; background: var(--hub-color-border-soft); margin: var(--hub-space-1) 0; }

/* ─────────────────────────────────────────────────────────────────
 * Forms.
 * ──────────────────────────────────────────────────────────────── */
.hub-field {
  display: flex; flex-direction: column; gap: var(--hub-space-1);
  margin-bottom: var(--hub-space-4);
}
.hub-label {
  font-size: var(--hub-font-size-sm); font-weight: var(--hub-font-weight-medium);
  color: var(--hub-color-text);
}
.hub-label-required::after { content: " *"; color: var(--hub-color-danger); }
.hub-input,
.hub-textarea,
.hub-select {
  font: inherit; font-size: var(--hub-font-size-sm); color: var(--hub-color-text);
  background: var(--hub-color-surface);
  border: 1px solid var(--hub-color-border);
  border-radius: var(--hub-radius-md);
  padding: 0.5rem 0.75rem; width: 100%;
  transition: border-color 0.1s, box-shadow 0.1s;
}
.hub-input:focus, .hub-textarea:focus, .hub-select:focus {
  outline: none;
  border-color: var(--hub-color-primary);
  box-shadow: 0 0 0 3px var(--hub-color-primary-tint);
}
.hub-textarea { resize: vertical; min-height: 5rem; }
.hub-help { font-size: var(--hub-font-size-xs); color: var(--hub-color-text-muted); }
.hub-error-text { font-size: var(--hub-font-size-xs); color: var(--hub-color-danger); }
.hub-field-error .hub-input,
.hub-field-error .hub-textarea,
.hub-field-error .hub-select { border-color: var(--hub-color-danger); }

.hub-checkbox, .hub-radio {
  display: inline-flex; align-items: center; gap: var(--hub-space-2);
  font-size: var(--hub-font-size-sm); color: var(--hub-color-text); cursor: pointer;
}
.hub-checkbox input, .hub-radio input { accent-color: var(--hub-color-primary); }

/* ─────────────────────────────────────────────────────────────────
 * Tabs. Interactivity wired by kit.js (data-hub-tabs).
 * ──────────────────────────────────────────────────────────────── */
.hub-tabs { display: flex; flex-direction: column; gap: var(--hub-space-4); }
.hub-tablist {
  display: inline-flex; gap: var(--hub-space-1);
  border-bottom: 1px solid var(--hub-color-border-soft);
  margin: 0; padding: 0;
}
.hub-tab {
  appearance: none; background: transparent; border: 0;
  padding: var(--hub-space-2) var(--hub-space-4);
  font: inherit; font-size: var(--hub-font-size-sm); font-weight: var(--hub-font-weight-medium);
  color: var(--hub-color-text-muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.1s, border-color 0.1s;
}
.hub-tab:hover { color: var(--hub-color-text); }
.hub-tab[aria-selected="true"] {
  color: var(--hub-color-primary);
  border-bottom-color: var(--hub-color-primary);
}
.hub-tabpanel { outline: 0; }
.hub-tabpanel[hidden] { display: none; }

/* ─────────────────────────────────────────────────────────────────
 * Modal. Opened by calling hubKit.openModal(id) or adding
 * data-hub-modal-open="<id>" to a trigger.
 * ──────────────────────────────────────────────────────────────── */
.hub-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: flex; align-items: center; justify-content: center;
  padding: var(--hub-space-6); z-index: var(--hub-z-modal);
  opacity: 0; pointer-events: none; transition: opacity 0.1s;
}
.hub-modal-backdrop[data-open="true"] { opacity: 1; pointer-events: auto; }
.hub-modal {
  background: var(--hub-color-surface); color: var(--hub-color-text);
  border-radius: var(--hub-radius-xl);
  box-shadow: var(--hub-shadow-lg);
  width: 100%; max-width: 32rem;
  /* Cap the whole modal at 90vh, but let only the body scroll so sticky
   * header and footer stay in view when the content is tall. */
  max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.hub-modal-header {
  padding: var(--hub-space-5) var(--hub-space-6) var(--hub-space-2);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--hub-space-4);
}
.hub-modal-title {
  margin: 0; font-size: var(--hub-font-size-lg);
  font-weight: var(--hub-font-weight-semibold);
}
.hub-modal-close {
  background: transparent; border: 0; cursor: pointer;
  width: 28px; height: 28px; border-radius: var(--hub-radius-full);
  color: var(--hub-color-text-muted); font-size: 20px; line-height: 1;
}
.hub-modal-close:hover { background: var(--hub-color-surface-alt); color: var(--hub-color-text); }
.hub-modal-body {
  padding: var(--hub-space-2) var(--hub-space-6) var(--hub-space-5);
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.hub-modal-footer {
  padding: var(--hub-space-3) var(--hub-space-6);
  border-top: 1px solid var(--hub-color-border-soft);
  display: flex; justify-content: flex-end; gap: var(--hub-space-2);
  background: var(--hub-color-background);
}

/* ─────────────────────────────────────────────────────────────────
 * Notification / Alert (inline).
 * ──────────────────────────────────────────────────────────────── */
.hub-alert {
  display: flex; align-items: flex-start; gap: var(--hub-space-3);
  padding: var(--hub-space-3) var(--hub-space-4);
  border: 1px solid transparent; border-left-width: 4px;
  border-radius: var(--hub-radius-md);
  background: var(--hub-color-surface);
  font-size: var(--hub-font-size-sm);
}
.hub-alert-title { font-weight: var(--hub-font-weight-semibold); margin: 0 0 2px; }
.hub-alert-body { margin: 0; color: var(--hub-color-text-subtle); }
.hub-alert-icon { flex-shrink: 0; margin-top: 2px; }
.hub-alert-info    { background: var(--hub-color-info-bg);    border-left-color: var(--hub-color-info);    color: var(--hub-color-info-fg); }
.hub-alert-success { background: var(--hub-color-success-bg); border-left-color: var(--hub-color-success); color: var(--hub-color-success-fg); }
.hub-alert-warning { background: var(--hub-color-warning-bg); border-left-color: var(--hub-color-warning); color: var(--hub-color-warning-fg); }
.hub-alert-danger  { background: var(--hub-color-danger-bg);  border-left-color: var(--hub-color-danger);  color: var(--hub-color-danger-fg);  }

/* ─────────────────────────────────────────────────────────────────
 * Toast — transient notification. kit.js hubKit.toast({...}) spawns.
 * ──────────────────────────────────────────────────────────────── */
.hub-toast-region {
  position: fixed; top: var(--hub-space-6); right: var(--hub-space-6);
  display: flex; flex-direction: column; gap: var(--hub-space-2);
  z-index: var(--hub-z-toast);
  max-width: 24rem;
}
.hub-toast {
  background: var(--hub-color-surface); color: var(--hub-color-text);
  border: 1px solid var(--hub-color-border-soft); border-left-width: 4px;
  border-radius: var(--hub-radius-md);
  box-shadow: var(--hub-shadow-lg);
  padding: var(--hub-space-3) var(--hub-space-4);
  display: flex; align-items: flex-start; gap: var(--hub-space-3);
  animation: hub-toast-in 0.15s ease-out;
}
.hub-toast-info    { border-left-color: var(--hub-color-info); }
.hub-toast-success { border-left-color: var(--hub-color-success); }
.hub-toast-warning { border-left-color: var(--hub-color-warning); }
.hub-toast-danger  { border-left-color: var(--hub-color-danger); }
.hub-toast-title { font-weight: var(--hub-font-weight-semibold); margin: 0; font-size: var(--hub-font-size-sm); }
.hub-toast-body  { margin: 2px 0 0; color: var(--hub-color-text-subtle); font-size: var(--hub-font-size-sm); }
.hub-toast-close {
  appearance: none; background: transparent; border: 0; cursor: pointer;
  color: var(--hub-color-text-muted); margin-left: auto;
  font-size: 18px; line-height: 1; padding: 0 0 0 var(--hub-space-2);
}
.hub-toast.is-leaving { animation: hub-toast-out 0.15s ease-in forwards; }

@keyframes hub-toast-in {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes hub-toast-out {
  to { opacity: 0; transform: translateX(12px); }
}

/* ─────────────────────────────────────────────────────────────────
 * Empty state.
 * ──────────────────────────────────────────────────────────────── */
.hub-empty {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: var(--hub-space-8) var(--hub-space-4);
  color: var(--hub-color-text-muted);
}
.hub-empty-icon {
  width: 48px; height: 48px; border-radius: var(--hub-radius-full);
  background: var(--hub-color-surface-alt); color: var(--hub-color-text-subtle);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: var(--hub-space-3);
}
.hub-empty-title {
  color: var(--hub-color-text); font-weight: var(--hub-font-weight-semibold);
  font-size: var(--hub-font-size-lg); margin: 0 0 var(--hub-space-1);
}
.hub-empty-body { margin: 0 0 var(--hub-space-4); max-width: 40ch; }

/* ─────────────────────────────────────────────────────────────────
 * Skeleton.
 * ──────────────────────────────────────────────────────────────── */
.hub-skeleton {
  display: block;
  background: linear-gradient(90deg, #eef0f3 0%, #f7f8fa 50%, #eef0f3 100%);
  background-size: 200% 100%;
  animation: hub-skeleton-shine 1.2s ease-in-out infinite;
  border-radius: var(--hub-radius-sm);
  height: 12px; width: 100%;
}
.hub-skeleton-text { height: 12px; margin-bottom: 8px; }
.hub-skeleton-title { height: 20px; width: 40%; margin-bottom: 12px; }
.hub-skeleton-avatar { width: 40px; height: 40px; border-radius: var(--hub-radius-full); }
.hub-skeleton-card { height: 120px; border-radius: var(--hub-radius-xl); }
@keyframes hub-skeleton-shine {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ─────────────────────────────────────────────────────────────────
 * Utilities (minimal — only what's needed by showcase patterns).
 * ──────────────────────────────────────────────────────────────── */
.hub-stack { display: flex; flex-direction: column; gap: var(--hub-space-4); }
.hub-stack-tight { gap: var(--hub-space-2); }
.hub-row   { display: flex; align-items: center; gap: var(--hub-space-3); flex-wrap: wrap; }
.hub-muted { color: var(--hub-color-text-muted); }
.hub-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
