/* ==========================================================================
   Waidrn v1.3 — HUB SHELL (proposal 03)
   One shell, every realm: rail + top bar + hotbar + filter bar + sort/view
   + facet column/drawer; Covers (3:5) and List canvases; 1280/768/360 chrome.
   Loaded after app.css so it can reuse the shared design tokens.
   ========================================================================== */

/* ---------- document ---------- */
.hub-body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body, system-ui, -apple-system, "Segoe UI", sans-serif);
  min-height: 100vh;
}
.hub-skip {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 100;
  background: var(--gold);
  color: var(--ink-inverse);
  padding: 0.5rem 1rem;
  border-radius: 0 0 8px 0;
  font-weight: 600;
}
.hub-skip:focus { left: 0; }
.hub-body :focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- top bar ---------- */
.hub-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.hub-topbar-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 1680px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
  min-height: 56px;
}
.hub-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--gold);
  text-decoration: none;
  font-family: var(--font-display, inherit);
  font-weight: 700;
  letter-spacing: 0.08em;
  min-height: 44px;
}
.hub-brand-mark { font-size: 1.2rem; }
.hub-brand-name { font-size: 1.02rem; }
.hub-command {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-3);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font: inherit;
  font-size: 0.82rem;
  cursor: not-allowed;
  max-width: 380px;
  overflow: hidden;
  white-space: nowrap;
}
.hub-command span { color: var(--gold); font-size: 0.78rem; }
.hub-search {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 220px;
  max-width: 520px;
}
.hub-search input[type="search"] {
  flex: 1;
  min-height: 40px;
  padding: 0.35rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-inset, var(--surface-2));
  color: var(--ink);
  font: inherit;
}
.hub-search input[type="search"]::placeholder { color: var(--ink-3); }
.hub-user {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}
.hub-user .inline-form { display: inline-flex; margin: 0; }
.hub-user .small { font-size: 0.8rem; }
.hub-user .icon-button {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-2);
  border-radius: 999px;
  min-width: 36px;
  min-height: 36px;
  cursor: pointer;
}
.hub-user .icon-link { position: relative; color: var(--ink-2); text-decoration: none; padding: 0.4rem; }
.hub-avatar-link { display: inline-flex; min-height: 40px; align-items: center; }
.hub-compact-menu { position: relative; }
.hub-compact-menu summary {
  list-style: none;
  cursor: pointer;
  min-width: 40px;
  min-height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-2);
}
.hub-compact-menu summary::-webkit-details-marker { display: none; }
.hub-compact-menu nav {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.4rem;
  display: grid;
  gap: 0.1rem;
  z-index: 60;
}
.hub-compact-menu nav a {
  color: var(--ink-2);
  text-decoration: none;
  padding: 0.55rem 0.6rem;
  border-radius: 6px;
  font-size: 0.9rem;
}
.hub-compact-menu nav a:hover { background: var(--gold-ghost); color: var(--ink); }

/* ---------- layout ---------- */
.hub-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.25rem;
  max-width: 1680px;
  margin: 0 auto;
  padding: 1rem;
  align-items: start;
}
.hub-main-column { min-width: 0; display: grid; gap: 0.75rem; }
.hub-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

/* ---------- rail ---------- */
.hub-rail {
  position: sticky;
  top: 72px;
  display: grid;
  gap: 1rem;
  padding: 0.25rem 0;
}
.rail-title {
  margin: 0.6rem 0 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.rail-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.4rem 0.7rem;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.95rem;
}
.rail-link:hover { background: var(--surface-2); color: var(--ink); }
.rail-link.active {
  background: var(--gold-ghost);
  border-color: var(--gold-line);
  color: var(--gold-bright);
}
.rail-glyph { width: 1.1rem; text-align: center; color: var(--gold); }
.rail-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-user {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  display: grid;
  justify-items: start;
  gap: 0.2rem;
}
.rail-user-name { margin: 0; font-weight: 600; }

/* ---------- hotbar ---------- */
.hotbar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.35rem 0.2rem;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}
.hotbar-label {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-right: 0.35rem;
}
.preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.85rem;
  white-space: nowrap;
}
.preset-chip:hover { border-color: var(--line-strong); color: var(--ink); }
.preset-chip.active { border-color: var(--gold-line); color: var(--gold-bright); background: var(--gold-ghost); }
.preset-num {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 700;
}
.dirty-dot { color: var(--warn); font-size: 0.6rem; }
.preset-save { cursor: pointer; border-style: dashed; }
.save-preset { position: relative; flex: 0 0 auto; }
.save-preset summary::-webkit-details-marker { display: none; }
.save-preset form {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 50;
  display: flex;
  gap: 0.4rem;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.5rem;
}
.save-preset form input {
  min-height: 38px;
  padding: 0.3rem 0.55rem;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface-inset, var(--surface));
  color: var(--ink);
  font: inherit;
  width: min(260px, 50vw);
}
.hotbar-hint { padding: 0.3rem 0; }
.hotbar-manage { margin-left: auto; flex: 0 0 auto; text-decoration: none; }

/* ---------- filter bar ---------- */
.hub-notice {
  margin: 0;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-size: 0.88rem;
}
.hub-notice-error { border-color: var(--danger); color: var(--danger); background: var(--danger-bg); }
.filter-bar { display: grid; gap: 0.4rem; }
.filter-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.query-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 34px;
  padding: 0.15rem 0.2rem 0.15rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 0.82rem;
}
.chip-label { white-space: nowrap; }
.chip-include { border-color: var(--gold-line); color: var(--gold-bright); }
.chip-exclude { border-color: var(--danger); color: var(--danger); }
.chip-window { color: var(--ink-2); }
.chip-search { color: var(--info); border-color: var(--info); }
.chip-remove {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  min-height: 26px;
  border-radius: 999px;
  color: inherit;
  text-decoration: none;
  font-size: 0.75rem;
}
.chip-remove:hover { background: var(--surface-3); }
.clear-all, .add-filter {
  color: var(--ink-2);
  text-decoration: none;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.7rem;
  font-size: 0.82rem;
}
.clear-all:hover, .add-filter:hover { color: var(--ink); border-color: var(--gold-line); }
.hidden-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.hidden-note a { color: var(--info); }
.hidden-note form { display: inline; margin: 0; }

/* ---------- sort + view ---------- */
.sort-view {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
}
.sort-form { display: flex; align-items: center; gap: 0.35rem; }
.sort-form select {
  min-height: 38px;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
}
.reverse-sort {
  min-width: 38px;
  min-height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  text-decoration: none;
}
.sort-prose { font-size: 0.82rem; color: var(--ink-3); }
.view-switch { display: inline-flex; gap: 0.2rem; margin-left: auto; }
.view-button {
  min-width: 40px;
  min-height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 1.05rem;
}
.view-button.active { background: var(--gold-ghost); border-color: var(--gold-line); color: var(--gold-bright); }

/* ---------- results head ---------- */
.results-head { display: grid; gap: 0.15rem; }
.hub-realm-title { margin: 0; font-size: 1.15rem; letter-spacing: 0.02em; }
.result-meta { margin: 0; color: var(--ink-3); font-size: 0.85rem; }

/* ---------- covers grid ---------- */
.covers-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.9rem;
}
.work-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  min-width: 0;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.work-card:hover { border-color: var(--line-strong); }
.card-cover-link { display: block; }
.card-cover,
.card-cover-img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 5;
  object-fit: cover;
  border: 0;
}
.cover-art {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.cover-art::after {
  content: "";
  position: absolute;
  inset: 10% 14%;
  border: 1px solid rgba(244, 236, 221, 0.16);
  border-radius: 4px;
  pointer-events: none;
}
.cover-mark {
  font-family: var(--font-display, inherit);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244, 236, 221, 0.72);
  padding: 0 0.75rem;
  text-align: center;
  z-index: 1;
}
/* twelve deterministic cover palettes (no inline styles: CSP style-src 'self') */
.cover-hue-0 { background: linear-gradient(160deg, #2b3a58 0%, #131a29 100%); }
.cover-hue-1 { background: linear-gradient(160deg, #4a2e3c 0%, #1c1117 100%); }
.cover-hue-2 { background: linear-gradient(160deg, #3d4a2c 0%, #161b10 100%); }
.cover-hue-3 { background: linear-gradient(160deg, #52391f 0%, #1d130a 100%); }
.cover-hue-4 { background: linear-gradient(160deg, #2c4152 0%, #0f171e 100%); }
.cover-hue-5 { background: linear-gradient(160deg, #452c4f 0%, #170f1c 100%); }
.cover-hue-6 { background: linear-gradient(160deg, #2f4a45 0%, #101b19 100%); }
.cover-hue-7 { background: linear-gradient(160deg, #51402a 0%, #1e1710 100%); }
.cover-hue-8 { background: linear-gradient(160deg, #30304f 0%, #121220 100%); }
.cover-hue-9 { background: linear-gradient(160deg, #4c3535 0%, #1c1212 100%); }
.cover-hue-10 { background: linear-gradient(160deg, #283f33 0%, #0f1813 100%); }
.cover-hue-11 { background: linear-gradient(160deg, #423a52 0%, #17141d 100%); }
.card-body { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.55rem 0.65rem 0.5rem; min-width: 0; }
.card-badges { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.card-franchise {
  margin: 0;
  font-size: 0.72rem;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-title { margin: 0; font-size: 0.98rem; line-height: 1.25; }
.card-title a { color: var(--ink); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a:hover { color: var(--gold-bright); }
.card-tags { display: flex; gap: 0.25rem; overflow: hidden; }
.tag-chip {
  font-size: 0.7rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tag-chip:hover { border-color: var(--gold-line); color: var(--gold-bright); }
.tag-more { border-style: dashed; }
.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
  margin-top: 0.15rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}
.jump-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-height: 34px;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.76rem;
  white-space: nowrap;
}
.jump-chip:hover { border-color: var(--gold-line); color: var(--gold-bright); }
.jump-dot { color: var(--teal); font-size: 0.55rem; }

/* ---------- card ⋯ menu ---------- */
.card-menu { position: relative; flex: 0 0 auto; }
.card-menu summary {
  list-style: none;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.card-menu summary::-webkit-details-marker { display: none; }
.menu-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 60;
  min-width: 240px;
  display: grid;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 0.35rem;
}
.menu-action {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--ink-2);
  text-decoration: none;
  font: inherit;
  font-size: 0.85rem;
  padding: 0.55rem 0.6rem;
  cursor: pointer;
}
.menu-action:hover { background: var(--gold-ghost); color: var(--ink); }
.menu-danger { color: var(--danger); }
.menu-form { display: grid; }
.facet-menu { position: relative; }
.facet-menu summary { list-style: none; cursor: pointer; color: var(--ink-3); padding: 0 0.3rem; min-height: 30px; display: grid; place-items: center; }
.facet-menu summary::-webkit-details-marker { display: none; }
.facet-menu form {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 60;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 0.3rem;
  min-width: 200px;
}

/* ---------- list rows ---------- */
.list-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.hub-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
  min-height: 64px;
  padding: 0.5rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.hub-row:hover { border-color: var(--line-strong); }
.row-thumb {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
}
.row-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.row-thumb-art { width: 100%; height: 100%; display: grid; place-items: center; }
.row-initial { font-family: var(--font-display, inherit); font-size: 1.3rem; color: rgba(244, 236, 221, 0.8); }
.row-main { min-width: 0; display: grid; gap: 0.1rem; }
.row-kicker { margin: 0; font-size: 0.74rem; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.row-title { margin: 0; font-size: 0.98rem; line-height: 1.25; }
.row-title a { color: var(--ink); text-decoration: none; }
.row-title a:hover { color: var(--gold-bright); }
.row-summary {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70ch;
}
.row-tags { display: flex; gap: 0.25rem; overflow: hidden; }
.row-stats { display: flex; flex-direction: column; align-items: flex-end; gap: 0.05rem; font-size: 0.75rem; color: var(--ink-3); white-space: nowrap; }
.row-actions { display: flex; align-items: center; gap: 0.3rem; }
.suggestion-row { grid-template-columns: minmax(0, 1fr) auto; }
.thread-row { grid-template-columns: minmax(0, 1fr) auto; }
.row-meta { margin: 0; }

/* ---------- facet panel ---------- */
.facet-aside { min-width: 0; }
.facet-drawer { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.facet-drawer-summary {
  cursor: pointer;
  list-style: none;
  padding: 0.7rem 0.8rem;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.facet-drawer-summary::-webkit-details-marker { display: none; }
.facet-search { display: flex; gap: 0.35rem; padding: 0 0.8rem 0.6rem; }
.facet-search input {
  flex: 1;
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  padding: 0.25rem 0.55rem;
}
.facet-selected-count { padding: 0 0.8rem 0.25rem; }
.facet-definition { padding: 0 0.8rem 0.5rem; margin: 0; line-height: 1.4; }
.facet-group { border-top: 1px solid var(--line); }
.facet-group-summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.8rem;
  min-height: 40px;
}
.facet-group-summary::-webkit-details-marker { display: none; }
.facet-group-title { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; }
.facet-count-selected { font-size: 0.72rem; color: var(--gold); }
.facet-list { list-style: none; margin: 0; padding: 0 0.5rem 0.6rem; display: grid; gap: 1px; }
.facet-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.35rem;
  min-height: 34px;
  padding: 0.1rem 0.25rem;
  border-radius: 6px;
}
.facet-row:hover { background: var(--surface-2); }
.facet-row.selected { background: var(--gold-ghost); }
.facet-value {
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.facet-value:hover { color: var(--gold-bright); }
.facet-row.selected .facet-value { color: var(--gold-bright); }
.facet-count { font-size: 0.75rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.facet-actions { display: inline-flex; align-items: center; gap: 2px; }
.facet-btn {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  min-height: 28px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--ink-3);
  text-decoration: none;
  font-size: 0.82rem;
}
.facet-btn:hover { border-color: var(--gold-line); color: var(--gold-bright); }
.facet-btn.active { border-color: var(--gold-line); background: var(--gold-ghost); color: var(--gold-bright); }
.facet-exclude:hover { border-color: var(--danger); color: var(--danger); }

/* ---------- realm toolbars / blacklist ---------- */
.realm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}
.tabs-like { display: inline-flex; flex-wrap: wrap; gap: 0.2rem; }
.tab-button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.84rem;
}
.tab-button:hover { color: var(--ink); border-color: var(--line-strong); }
.tab-button.active { background: var(--gold-ghost); border-color: var(--gold-line); color: var(--gold-bright); }
.tab-button.small { font-size: 0.78rem; min-height: 32px; }
.inline-search { display: inline-flex; gap: 0.35rem; align-items: center; }
.inline-search input {
  min-height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  padding: 0.2rem 0.55rem;
}
.blacklist-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.blacklist-table th, .blacklist-table td { text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--line); }
.blacklist-table th { color: var(--ink-3); font-size: 0.74rem; letter-spacing: 0.08em; text-transform: uppercase; }
.blacklist-canvas { display: grid; gap: 0.9rem; }
.blacklist-subhead { margin: 0.5rem 0 0; font-size: 1rem; }
.blacklist-add { display: grid; gap: 0.6rem; max-width: 760px; }
.blacklist-add .field-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.blacklist-add .field { display: grid; gap: 0.2rem; min-width: 150px; flex: 1; }
.blacklist-add label { font-size: 0.78rem; color: var(--ink-3); }
.blacklist-add input, .blacklist-add select {
  min-height: 38px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  padding: 0.25rem 0.5rem;
}

/* ---------- empty state ---------- */
.hub-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 2rem 1.25rem;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 0.5rem;
  background: var(--surface);
}
.hub-empty h2 { margin: 0; font-size: 1.05rem; }
.hub-empty p { margin: 0; color: var(--ink-3); max-width: 60ch; }

/* ---------- bottom tabs (phone) ---------- */
.hub-bottom-tabs { display: none; }

/* ---------- responsive: 1280 keeps facet column ---------- */
@media (min-width: 1280px) {
  .hub-content { grid-template-columns: minmax(0, 1fr) 300px; }
  .facet-aside { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow-y: auto; }
}
@media (min-width: 1024px) and (max-width: 1279px) {
  .hub-content { grid-template-columns: minmax(0, 1fr) 280px; }
  .covers-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* tablet: icon rail + flyout text hidden, 3-up covers, facet below canvas */
@media (max-width: 1023px) {
  .hub-content { grid-template-columns: minmax(0, 1fr); }
  .covers-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hub-layout { grid-template-columns: 56px minmax(0, 1fr); }
  .rail-title, .rail-label, .rail-user-name, .rail-user p, .hub-rail nav[aria-label="Personal"] .rail-label { display: none; }
  .rail-link { justify-content: center; padding: 0.4rem; }
  .hub-rail { justify-items: center; }
  .rail-user { justify-items: center; }
  .rail-user .avatar { display: none; }
  .facet-aside { order: -1; position: static; max-height: none; }
  .facet-drawer:not([open]) .facet-drawer-summary { color: var(--ink-2); }
}
/* phone: bottom tabs, one-column list geometry, 44px targets */
@media (max-width: 767px) {
  .hub-layout { display: block; padding: 0.6rem 0.6rem 5.5rem; }
  .hub-rail { display: none; }
  .hub-command { display: none; }
  .hub-topbar-inner { gap: 0.4rem; padding: 0.4rem 0.6rem; }
  .hub-search { max-width: none; }
  .hub-search input[type="search"] { min-height: 44px; }
  .hub-brand-name { font-size: 0.95rem; }
  .covers-grid { display: block; }
  .work-card { flex-direction: row; margin-bottom: 0.55rem; }
  .card-cover-link { flex: 0 0 78px; }
  .card-cover, .card-cover-img { aspect-ratio: 1 / 1; height: 100%; min-height: 104px; }
  .card-body { flex: 1; }
  .card-title a { -webkit-line-clamp: 2; }
  .card-tags { display: none; }
  .card-foot { border-top: 0; padding-top: 0.1rem; }
  .jump-chip { min-height: 44px; }
  .card-menu summary { min-width: 44px; min-height: 44px; }
  .hub-row { grid-template-columns: 56px minmax(0, 1fr) auto; row-gap: 0.25rem; }
  .row-thumb { width: 56px; height: 56px; }
  .row-stats { display: none; }
  .row-actions { grid-column: 3; grid-row: 1 / span 2; }
  .row-summary { display: none; }
  .facet-aside { margin-bottom: 0.6rem; }
  .facet-row { min-height: 44px; }
  .facet-btn { min-width: 40px; min-height: 40px; }
  .facet-menu summary { min-width: 40px; min-height: 40px; }
  .hotbar { overflow-x: auto; }
  .hub-bottom-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 0.25rem 0.25rem calc(0.25rem + env(safe-area-inset-bottom, 0px));
  }
  .bottom-tab {
    display: grid;
    justify-items: center;
    gap: 0.1rem;
    min-height: 52px;
    padding: 0.3rem 0.15rem;
    color: var(--ink-3);
    text-decoration: none;
    font-size: 0.7rem;
    border-radius: 8px;
  }
  .bottom-tab.active { color: var(--gold-bright); background: var(--gold-ghost); }
  .bottom-glyph { font-size: 1rem; }
  .pagination .page, .pagination .prev, .pagination .next { min-width: 40px; min-height: 40px; }
  .blacklist-table { display: block; overflow-x: auto; }
  .sort-view { position: sticky; bottom: 60px; background: var(--bg); padding: 0.35rem 0; }
  .view-switch { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .work-card, .flash, .menu-panel, .hub-compact-menu nav { transition: none; animation: none; }
}
@media (forced-colors: active) {
  .work-card, .hub-row, .facet-drawer { border: 1px solid CanvasText; }
  .preset-chip.active, .view-button.active { outline: 2px solid Highlight; }
}

/* ---------- filter bar: update-window quick control ---------- */
.window-control { display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.window-control select {
  min-height: 34px;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  font: inherit;
  font-size: 0.82rem;
}
.window-control select:hover { color: var(--ink); border-color: var(--line-strong); }
.menu-form .menu-action { width: 100%; }

/* ==========================================================================
   Vision 2.0 realm landings (IA lane) — reuse the v1.3 one-shell tokens.
   ART lane re-skins through scene/material tokens; layout hooks stay stable.
   ========================================================================== */
.realm-landing { display: grid; gap: 1rem; }
.realm-hero { display: grid; gap: 0.4rem; padding-bottom: 0.4rem; }
.realm-lede { margin: 0; color: var(--ink-2); max-width: 72ch; line-height: 1.45; }
.realm-counts { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; align-items: baseline; font-size: 0.85rem; color: var(--ink-2); }
.realm-counts a { color: var(--gold-bright); text-decoration: none; }
.realm-counts strong { color: var(--gold); font-variant-numeric: tabular-nums; }
.realm-tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; border-bottom: 1px solid var(--line); padding-bottom: 0.4rem; }
.realm-tab {
  min-height: 36px; display: inline-flex; align-items: center; padding: 0.2rem 0.7rem;
  border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2);
  text-decoration: none; font-size: 0.85rem;
}
.realm-tab:hover { color: var(--ink); border-color: var(--line-strong); }
.realm-tab.active { background: var(--gold-ghost); border-color: var(--gold-line); color: var(--gold-bright); }
.realm-strip { display: grid; gap: 0.35rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.realm-strip:last-child { border-bottom: 0; }
.strip-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.strip-title { margin: 0; font-size: 1rem; letter-spacing: 0.01em; }
.strip-more { color: var(--ink-3); font-size: 0.8rem; text-decoration: none; }
.strip-more:hover { color: var(--gold-bright); }
.strip-desc { margin: 0; }
.realm-items { list-style: none; margin: 0.25rem 0 0; padding: 0; display: grid; gap: 0.15rem; }
.realm-item { padding: 0.4rem 0.2rem; border-bottom: 1px dotted var(--line); }
.realm-item:last-child { border-bottom: 0; }
.realm-item-title { color: var(--ink); text-decoration: none; font-weight: 600; }
.realm-item-title:hover { color: var(--gold-bright); }
.realm-item-meta { margin: 0.1rem 0 0; }
.realm-empty-strip { margin: 0.2rem 0; }
.realm-create { padding-top: 0.75rem; }
.realm-create-links { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.realm-two-col { display: grid; gap: 1rem; }
@media (min-width: 900px) { .realm-two-col { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.realm-cards { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
@media (min-width: 900px) { .realm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.realm-card {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  padding: 0.6rem 0.7rem; display: grid; gap: 0.3rem;
}
.realm-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.4rem; }
.realm-card-title { color: var(--ink); font-weight: 600; text-decoration: none; }
.realm-card-title:hover { color: var(--gold-bright); }
.realm-card-body { margin: 0; color: var(--ink-3); font-size: 0.86rem; }
.realm-card-meta { margin: 0; }
.realm-filterbar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.realm-filterbar .inline-search { margin-left: auto; }
.realm-search { display: flex; gap: 0.35rem; max-width: 560px; }
.realm-search input[type="search"] {
  flex: 1; min-height: 40px; border-radius: 8px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink); font: inherit; padding: 0.3rem 0.6rem;
}
.medium-chips { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.35rem; }
.medium-chip {
  display: inline-flex; align-items: center; gap: 0.25rem; min-height: 34px;
  padding: 0.15rem 0.55rem; border-radius: 999px; border: 1px solid var(--line);
  color: var(--ink-2); text-decoration: none; font-size: 0.8rem;
}
.medium-chip:hover { color: var(--ink); border-color: var(--line-strong); }
.medium-chip.active { color: var(--gold-bright); border-color: var(--gold-line); background: var(--gold-ghost); }
.medium-hint, .medium-count { margin: 0.2rem 0 0; }
.search-realms { display: grid; gap: 1rem; }
.search-realm { display: grid; gap: 0.25rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.search-realm:last-of-type { border-bottom: 0; }
/* rail additions for grouped navigation */
.rail-group + .rail-group { margin-top: 0.4rem; }
.rail-link-planned { opacity: 0.55; cursor: not-allowed; }
.rail-soon {
  margin-left: auto; font-size: 0.62rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 0.35rem;
}
/* 768-1279: icon rail with hover/focus flyout labels (IA-15). */
@media (min-width: 768px) and (max-width: 1279px) {
  .hub-rail .rail-label { display: none; }
  .hub-rail .rail-link, .hub-rail .rail-link-planned { position: relative; }
  .hub-rail .rail-link:hover .rail-label,
  .hub-rail .rail-link:focus-visible .rail-label,
  .hub-rail .rail-link-planned:hover .rail-label {
    display: inline-flex; position: absolute; left: calc(100% + 10px); top: 50%;
    transform: translateY(-50%); z-index: 60; white-space: nowrap;
    background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong);
    border-radius: 6px; padding: 0.2rem 0.55rem; box-shadow: 0 6px 18px rgb(0 0 0 / 0.45);
  }
  .hub-rail .rail-title { display: none; }
  .hub-rail .rail-group + .rail-group { margin-top: 0.5rem; border-top: 1px solid var(--line); padding-top: 0.5rem; }
}
/* bottom drawer: Explore bottom tab */
.bottom-explore { display: contents; }
.bottom-explore summary::-webkit-details-marker { display: none; }
.bottom-drawer {
  position: fixed; left: 0; right: 0; bottom: 58px; z-index: 49;
  background: var(--surface); border-top: 1px solid var(--line-strong);
  padding: 0.75rem 0.9rem calc(1rem + env(safe-area-inset-bottom, 0px));
  display: grid; gap: 0.25rem; max-height: 65vh; overflow-y: auto;
}
.drawer-group-title { margin: 0.3rem 0 0.1rem; font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.drawer-link { color: var(--ink-2); text-decoration: none; min-height: 44px; display: flex; align-items: center; gap: 0.4rem; }
.drawer-link:hover { color: var(--gold-bright); }
.drawer-planned { opacity: 0.55; }
@media (max-width: 767px) {
  .realm-cards { grid-template-columns: minmax(0, 1fr); }
  .realm-filterbar .inline-search { margin-left: 0; width: 100%; }
}
