/* Generator browse (G117) — the interactive compose feed: a filter rail, a card grid of server-rendered
   fanned boards, and a hold tray of pinned (persisted) plans. The detail dialog reuses the plan editor's
   .plan-compile-* drawer classes. */

.gen-body { display: flex; flex: 1; min-height: 0; overflow: hidden; }

/* filter rail */
.gen-filters {
  flex-shrink: 0; width: 240px; padding: var(--space-3);
  border-right: 1px solid var(--border); overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--space-3);
}
/* Filter rail vocabulary (title · fields · chips) now uses the canon: Section / Field / Chip
   (.filter-chip) / Button. Only the two-input wool-count range keeps its own micro-layout. */
.gen-wool { display: flex; align-items: center; gap: 6px; }
.gen-wool input {
  width: 3.5rem; padding: 3px 5px; font-family: inherit;
  background: var(--bg-panel); color: var(--text-bright); border: 1px solid var(--border); border-radius: var(--radius-sm);
}

/* feed */
.gen-main { flex: 1; min-width: 0; overflow-y: auto; padding: var(--space-3); }

.gen-tray {
  display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-3);
  padding: var(--space-2); background: var(--bg-panel, var(--bg));
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.gen-tray-label { flex-shrink: 0; font-size: var(--font-sm); color: var(--text-secondary); display: flex; align-items: center; gap: 4px; }
.gen-tray-label svg { width: var(--icon-sm); height: var(--icon-sm); }
.gen-tray-items { display: flex; gap: var(--space-2); overflow-x: auto; }
.gen-tray-chip { flex-shrink: 0; width: 96px; display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; }
.gen-tray-fig {
  display: block; width: 96px; height: 72px; padding: 2px; cursor: pointer;
  background: var(--canvas); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.gen-tray-fig svg { width: 100%; height: 100%; }
.gen-tray-name { font-size: var(--font-xs); color: var(--text-secondary); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gen-tray-x {
  position: absolute; top: 2px; right: 2px; width: 18px; height: 18px;
  display: grid; place-items: center; background: rgba(0, 0, 0, .5); color: #fff; border: none; border-radius: 50%; cursor: pointer;
}
.gen-tray-x svg { width: var(--icon-xs); height: var(--icon-xs); }
/* A held board an older composer made: its stored plan is intact, so the marker is an annotation on the
   thumbnail rather than anything that blocks opening it. */
.gen-tray-fig--stale { border-color: #d9a441; }
.gen-tray-stale {
  position: absolute; top: 2px; left: 2px; font-family: ui-monospace, monospace; font-size: 9px;
  line-height: 1.4; padding: 0 3px; border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, .55); color: #e8c579;
}

.gen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--space-3); }
.gen-card { position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-panel, var(--bg)); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.gen-card--pinned { border-color: var(--accent); }
/* the figure grows to fill any extra card height (cards stretch to the tallest in their grid row), which
   keeps the foot pinned to the bottom; the board SVG stays centred within it. */
.gen-card-fig { flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; padding: 8px; background: var(--canvas); border: none; cursor: pointer; }
.gen-card-fig svg { width: 100%; height: auto; max-height: 240px; display: block; margin: 0 auto; }
/* structure badges — read-only labels overlaying the top-left corner; clicks fall through to the figure.
   Filtering lives only in the sidebar. */
.gen-card-badges {
  position: absolute; top: 6px; left: 6px; z-index: 2; pointer-events: none;
  display: flex; flex-wrap: wrap; gap: 3px; max-width: calc(100% - 12px);
}
.gen-badge {
  padding: 1px 6px; font-size: 10px; font-family: ui-monospace, monospace; text-transform: lowercase;
  background: var(--bg-panel, var(--bg)); color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 1px 2px rgba(0, 0, 0, .18);
}
.gen-badge--wool { color: var(--accent-lighter, var(--accent)); }
.gen-scanned { margin: 0 0 var(--space-2); font-size: var(--font-xs); color: var(--text-secondary); }
.gen-card-foot { display: flex; align-items: center; gap: var(--space-2); padding: 6px 8px; border-top: 1px solid var(--border); }
.gen-card-score {
  font-family: ui-monospace, monospace; font-size: var(--font-xs); font-weight: 600;
  color: var(--accent-lighter, var(--accent)); background: var(--bg-selected); border-radius: var(--radius-sm); padding: 1px 6px;
}
.gen-card-meta { flex: 1; font-size: var(--font-xs); color: var(--text-secondary); }
.gen-pin { width: 26px; height: 26px; display: grid; place-items: center; background: transparent; color: var(--text-secondary); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.gen-pin:hover { color: var(--text-bright); border-color: var(--accent); }
.gen-pin--on { color: var(--accent); background: var(--bg-selected); border-color: var(--accent); }
.gen-pin svg { width: var(--icon-sm); height: var(--icon-sm); }

.gen-status { text-align: center; color: var(--text-secondary); font-size: var(--font-sm); padding: var(--space-3); }
.gen-sentinel { height: 1px; }
.gen-more { margin-top: var(--space-3); }

/* detail dialog */
.gen-detail-fig { padding: var(--space-2); background: var(--canvas); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.gen-detail-fig svg { width: 100%; height: auto; display: block; }
.gen-detail-meta { font-size: var(--font-sm); color: var(--text-secondary); }
.gen-detail-meta strong { color: var(--text-bright); }
.gen-descriptor {
  font-family: ui-monospace, monospace; font-size: var(--font-xs); white-space: pre; overflow-x: auto;
  color: var(--text-secondary); background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--space-2);
}

/* land spend (G148) — what the board cost against the budget it was built to. Two currencies: footprint is
   the box rect, land is the walkable terrain inside it. */
.gen-card-land {
  font-family: ui-monospace, monospace; font-size: 10px; white-space: nowrap;
  color: var(--text-secondary); background: var(--bg-selected); border-radius: var(--radius-sm); padding: 1px 5px;
}
.gen-spend { margin: var(--space-2) 0; }
.gen-spend-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2);
  font-size: var(--font-sm); color: var(--text-secondary);
}
.gen-spend-pct { font-family: ui-monospace, monospace; color: var(--accent-lighter, var(--accent)); }
.gen-spend-table { width: 100%; margin-top: 6px; border-collapse: collapse; font-size: var(--font-xs); }
.gen-spend-table th, .gen-spend-table td { padding: 3px 6px; text-align: right; border-bottom: 1px solid var(--border); }
.gen-spend-table th:first-child, .gen-spend-table td:first-child { text-align: left; }
.gen-spend-table th { font-weight: 500; color: var(--text-secondary); text-transform: lowercase; }
.gen-spend-table td { font-family: ui-monospace, monospace; color: var(--text-bright); }
.gen-spend-table tfoot td { border-bottom: none; color: var(--text-secondary); }
