#home-host {  /* position:absolute; inset:0 comes from .section-host */
  overflow: auto;
  background: var(--bg-app);
  padding: var(--page-pad-y) var(--page-pad-x);
}
.home-loading { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 240px; padding: 40px 0; }
.spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: home-spin 0.7s linear infinite;
}
@keyframes home-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 1.6s; } }
.home-head { margin-bottom: var(--page-head-gap); }

.bento {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 116px;
  gap: 14px;
  grid-auto-flow: dense;
}
.tile {
  background: var(--surface-raised);
  border: 1px solid var(--border-list);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tile-wide    { grid-column: span 2; }
.tile-tall    { grid-row: span 3; }

.tile-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.tile-h .lucide { width: 16px; height: 16px; color: var(--text-secondary); }
.tile-h h3 { font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--text-strong); }
.tile-h .tile-link { margin-left: auto; font-size: var(--fs-sm); color: var(--accent); cursor: pointer; }
.tile-body { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 7px; }
.home-empty { padding: 6px 0; }

/* Activity tile: past / current / upcoming sections stacked top-to-bottom. */
.tile-runs { grid-column: span 2; grid-row: span 3; }
.runs-cols { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }
.runs-col { display: flex; flex-direction: column; padding: 11px 0; }
.runs-col:first-child { padding-top: 0; }
.runs-col + .runs-col { border-top: 1px solid var(--divider); }
.runs-col-h { display: flex; align-items: center; gap: 7px; margin-bottom: 8px;
  font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-muted); }
.runs-col-h .lucide { width: 14px; height: 14px; color: var(--text-secondary); }
.runs-col-n { margin-left: auto; font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--text-strong); }
.runs-col-body { display: flex; flex-direction: column; gap: 6px; }

/* Resources tile: matches the Runs-today stat — counters in one centred row. */
.tile-resources .sr { cursor: pointer; border-radius: var(--r-md); padding: 4px 8px; }
.tile-resources .sr:hover { background: var(--surface-hover); }
.tile-resources .sr-n { color: var(--text-strong); }

/* Label pinned to the top (so labels line up across tiles), the value group centred in the space below. */
.tile.stat { justify-content: flex-start; }
.stat-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.stat-k { display: flex; align-items: center; gap: 7px; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-muted); }
.stat-k .lucide { width: 14px; height: 14px; }
.stat-v { font-size: var(--fs-3xl); font-weight: var(--fw-bold); color: var(--text-strong); line-height: var(--lh-tight); }
.stat-v .stat-bad { font-size: var(--fs-md); font-weight: var(--fw-semibold); color: var(--pill-failed-fg); }

.stat-runs { display: flex; justify-content: space-between; }
.stat-runs .sr { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.stat-runs .sr-n { font-size: var(--fs-3xl); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.stat-runs .sr-l { font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); }
.stat-runs .sr-ok .sr-n { color: #1f9d57; }
.stat-runs .sr-fail .sr-n { color: #e07a2e; }
.stat-runs .sr-prog .sr-n { color: var(--text-strong); }
.stat-sub { font-size: var(--fs-xs); color: var(--text-faint); }

.sys-strip {
  background: var(--surface-raised);
  border: 1px solid var(--border-list);
  border-radius: var(--r-md);
  padding: 12px 16px 14px;
  margin-bottom: 16px;
}
.sys-strip-h {
  display: flex; align-items: center; gap: 7px;
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-secondary);
  margin-bottom: 10px;
}
.sys-strip-h .lucide { width: 15px; height: 15px; }
.sys-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.sys-item {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  font-size: var(--fs-sm);
  color: var(--text-strong);
  white-space: nowrap;
}
.sys-item b { font-weight: var(--fw-semibold); }
.sys-item.ok b    { color: #1f9d57; }
.sys-item.bad b   { color: var(--pill-failed-fg); }
.sys-item.muted b { color: var(--text-faint); }

.home-run { display: flex; align-items: center; gap: 9px; font-size: var(--fs-sm); }
.home-run-name { font-weight: var(--fw-medium); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-run-when { margin-left: auto; color: var(--accent); font-size: var(--fs-xs); font-weight: var(--fw-semibold); white-space: nowrap; font-variant-numeric: tabular-nums; }

.home-up-row { display: flex; align-items: center; gap: 9px; font-size: var(--fs-sm); padding: 3px 0; }
.home-up-name { font-weight: var(--fw-medium); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-up-when { margin-left: auto; color: var(--accent); font-size: var(--fs-xs); font-weight: var(--fw-semibold); white-space: nowrap; font-variant-numeric: tabular-nums; }

.home-colls { gap: 6px; }
.home-coll {
  display: flex; align-items: center; gap: 8px;
  background: transparent; border: 0; width: 100%; text-align: left;
  padding: 6px 8px; border-radius: var(--r-sm); cursor: pointer;
  font: inherit; font-size: var(--fs-sm); color: var(--text-strong);
}
.home-coll:hover { background: var(--surface-hover); }
.home-coll .lucide { width: 15px; height: 15px; color: var(--text-secondary); flex-shrink: 0; }
.home-coll span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-coll-name { flex: 1; min-width: 0; }
.home-coll-when { margin-left: auto; color: var(--accent); font-size: var(--fs-xs); font-weight: var(--fw-semibold); flex-shrink: 0; white-space: nowrap; font-variant-numeric: tabular-nums; }

.home-actions { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.home-actions .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 8px; border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: var(--fw-medium);
  border: 1px solid var(--border); background: var(--surface-raised); color: var(--text-strong); cursor: pointer;
  overflow: hidden; white-space: nowrap;
}
.home-actions .btn .lucide { width: 15px; height: 15px; }
.home-actions .btn:hover { border-color: var(--accent); color: var(--accent); }

.home-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gcard {
  display: flex; flex-direction: column; text-align: left;
  background: var(--surface-raised); border: 1px solid var(--border-list); border-radius: var(--r-lg);
  overflow: hidden; cursor: pointer; font: inherit; padding: 0;
  transition: border-color .12s, transform .12s, box-shadow .12s;
}
.gcard:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 10px 24px rgba(15,23,42,.1); }
.gthumb { height: 130px; }
.gthumb-img { width: 100%; object-fit: cover; }
.grad-0 { background: linear-gradient(135deg,#440154,#21908c 50%,#fde725); }
.grad-1 { background: linear-gradient(135deg,#1e3a8a,#3b82f6 50%,#93c5fd); }
.grad-2 { background: linear-gradient(135deg,#fef3c7,#f59e0b 60%,#b45309); }
.grad-3 { background: linear-gradient(135deg,#1b4332,#74c69d 55%,#d8f3dc); }
.grad-4 { background: linear-gradient(135deg,#1f2937,#6b7280 50%,#e5e7eb); }
.grad-5 { background: linear-gradient(135deg,#3f5e2a,#7d9b4a 55%,#b7d77a); }
.gmeta { padding: 11px 13px; }
.gmeta .gnm { font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--text-strong); }
.gmeta .gsub { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 2px; }

/* Home omnibox — platform-wide search */
.home-omni { position: relative; margin-bottom: calc(var(--page-head-gap) + 24px); }
.omni-head { margin-bottom: 12px; }
.omni-title { font-size: var(--fs-xl); font-weight: var(--fw-semibold); color: var(--text-strong); }
.omni-sub { margin-top: 3px; font-size: var(--fs-sm); color: var(--text-muted); }

/* Google-style landing: search centred in the upper zone, dashboard pinned to the bottom. */
#home-host { display: flex; flex-direction: column; }
.home-landing { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center;
  min-height: 44vh; padding: 24px 0 32px; }
.home-landing .home-omni { width: min(680px, 94%); margin-bottom: 0; }
.home-landing .omni-head { text-align: center; margin-bottom: 18px; }
.home-landing .omni-title { font-size: var(--fs-3xl); }
.home-landing .omni-sub { font-size: var(--fs-md); }
.home-landing .omni-box { padding: 10px 10px 10px 18px; border-radius: var(--r-xl, 16px); }
.home-landing .omni-input { font-size: var(--fs-lg); }
.home-dash { margin-top: auto; }
/* Viewer home mirrors the ops landing: the omnibox centres in the upper zone (.home-landing flex:1),
   the catalog gallery is pinned to the bottom — same idiom as .home-dash above. */
.home-viewer-cards--pinned { margin-top: auto; }

/* Search button inside the landing search box. */
.omni-go {
  flex: none; margin-left: 8px;
  padding: 9px 18px; border-radius: var(--r-md);
  border: 1px solid transparent; background: var(--accent); color: var(--accent-on, #fff);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold); cursor: pointer;
}
.omni-go:hover { filter: brightness(1.06); }

/* Search results page with preview cards. */
.results-top { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.results-back { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: none;
  border: 1px solid var(--border); background: var(--surface-raised); border-radius: var(--r-md);
  color: var(--text-strong); cursor: pointer; }
.results-back:hover { border-color: var(--accent); color: var(--accent); }
.results-back .lucide { width: 18px; height: 18px; }
.results-omni { flex: 1; }
.results-list { display: flex; flex-direction: column; gap: 8px; }
.res-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 8px 12px; border: 1px solid var(--border-list); background: var(--surface-raised);
  border-radius: var(--r-md); cursor: pointer; }
.res-row:hover { border-color: var(--accent); }
.res-thumb { flex: none; width: 64px; height: 44px; border-radius: var(--r-sm);
  background: var(--surface-hover); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.res-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.res-thumb-ph .lucide { width: 22px; height: 22px; color: var(--text-faint); }
.res-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.res-row-title { min-width: 0; font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-strong);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-row-sub { min-width: 0; font-size: var(--fs-xs); color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-row-kind { flex: none; align-self: center; font-size: var(--fs-micro); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); }
.omni-box {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}
.omni-box svg { width: 18px; height: 18px; color: var(--text-muted); flex: none; }
.omni-input {
  flex: 1; min-width: 0;
  border: none; background: transparent; outline: none;
  color: var(--text-strong); font-size: var(--fs-md);
}
.omni-degraded {
  padding: 8px 10px;
  font-size: var(--fs-sm);
  color: var(--danger, #c0392b);
  border-bottom: 1px solid var(--border);
}
.prefs-search-keyset { color: var(--text-faint); font-size: var(--fs-micro); }
.prefs-search-key { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
