/* Entity view — SELF-CONTAINED stylesheet (does not depend on any other CSS,
   so the page renders identically whichever server hosts it). Light theme. */
* { box-sizing: border-box; }
html, body { margin: 0; }
.entity-body { font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
  Helvetica, Arial, sans-serif; color: #1d2733; background: #f4f6f9;
  min-height: 100vh; display: flex; flex-direction: column; }
header { padding: 10px 18px; background: #16263b; color: #fff; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; }
header h1 { font-size: 17px; margin: 0; font-weight: 650; }
header .sub { font-size: 12px; color: #b9c6d6; margin-top: 2px; }
.muted { color: #6b7a8d; font-size: 12px; }
button, .btn-link { font: inherit; font-size: 13px; padding: 7px 14px; border: 0;
  border-radius: 6px; background: #2563eb; color: #fff; cursor: pointer; text-decoration: none; }
button.secondary { background: #e2e8f0; color: #1d2733; }
.btn-link.secondary { background: #2b3f57; color: #fff; }
.btn-link { flex: 0 0 auto; font-weight: 600; }
.panel { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px 14px; }
.panel h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em;
  color: #5a6b80; margin: 0 0 8px; }
#entity-main { padding: 16px 20px 40px; max-width: 1180px; margin: 0 auto; width: 100%; }
.hidden { display: none !important; }

/* --- landing --- */
.landing-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.ltab { background: #e2e8f0; color: #1d2733; }
.ltab.active { background: #2563eb; color: #fff; }
#landing-search, #case-filter { width: 100%; box-sizing: border-box; padding: 8px 10px;
  border: 1px solid #cbd5e1; border-radius: 6px; font: inherit; font-size: 13px; margin: 4px 0 10px; }
#landing-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px; }
.land-row { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 12px; background: #fff; border: 1px solid #e2e8f0; border-radius: 6px;
  text-decoration: none; color: #1d2733; }
.land-row:hover { background: #f3f7ff; border-color: #cfe0ff; }
.land-name { font-size: 13px; display: flex; align-items: center; gap: 7px; }
.land-meta { display: flex; align-items: center; gap: 8px; }
.land-n { background: #16263b; color: #fff; border-radius: 10px; padding: 1px 9px; font-size: 12px; font-weight: 600; }

/* type-of-work landing: per-row 100%-stacked willfulness bar */
#landing-list:has(.wf-row) { grid-template-columns: 1fr; }
.land-row.wf-row { display: grid; grid-template-columns: 210px 1fr auto; align-items: center; gap: 12px; }
/* multiple labelled bars stacked vertically in the middle cell (work landing) */
.stack-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stack-line { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 8px; }
.stack-lab { font-size: 10px; color: #8a94a0; text-align: right; white-space: nowrap; }
.stack-line .wf-stack { height: 15px; min-width: 100px; }
.wf-stack { display: flex; height: 18px; border-radius: 4px; overflow: hidden; background: #eef1f5; min-width: 120px; }
.wf-stack.empty::after { content: "no cases"; color: #9aa7b4; font-size: 11px; padding: 0 6px; }
.wf-seg { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 10px;
  font-weight: 600; min-width: 0; overflow: hidden; white-space: nowrap; }
.wf-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 2px 0 10px; }
.wf-leg-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: #3a4757; }
.wf-leg-sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* --- entity detail --- */
.crumb { color: #cfe0ff; text-decoration: none; }
.crumb:hover { text-decoration: underline; }
.meta-card { margin-bottom: 14px; }
.meta-tbl { border-collapse: collapse; font-size: 13px; }
.meta-tbl td { padding: 3px 14px 3px 0; vertical-align: top; }
.meta-tbl td:first-child { color: #5a6b80; white-space: nowrap; }
.ent-swatch, .clus-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: middle; }
.clus-dot { width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; }
h2 .ent-swatch { margin-right: 8px; }

/* --- distributions grid --- */
.dist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-bottom: 14px; }
.dist-card h2 { margin-bottom: 10px; }
.distrow { display: grid; grid-template-columns: 120px 1fr 32px; align-items: center; gap: 8px; margin: 3px 0; }
.distlabel { font-size: 11.5px; color: #3a4757; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.distbar-wrap { background: #eef1f5; border-radius: 3px; height: 15px; overflow: hidden; }
.distbar { height: 100%; border-radius: 3px; min-width: 0; transition: width .2s; }
.distn { font-size: 11.5px; color: #5a6b80; text-align: right; font-variant-numeric: tabular-nums; }
.cover-note { margin-top: 8px; padding-top: 7px; border-top: 1px dashed #e2e8f0;
  font-size: 11px; color: #5a6b80; line-height: 1.4; cursor: help; }
.cover-note b { color: #16263b; }
.cover-why { color: #8a94a0; }
.cover-why em { font-style: italic; color: #5a6b80; }

/* --- case table --- */
.case-table { display: flex; flex-direction: column; gap: 3px; }
.crow { display: flex; justify-content: space-between; gap: 14px; padding: 8px 10px;
  background: #fff; border: 1px solid #eef1f5; border-radius: 6px; }
.crow:hover { background: #f8fafc; border-color: #dbe3ef; }
.c-main { min-width: 0; }
.c-title { font-size: 13px; font-weight: 600; color: #1d4ed8; text-decoration: none; }
.c-title:hover { text-decoration: underline; }
.c-sub { font-size: 11px; color: #6b7a8d; margin-top: 1px; }
.c-pid { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.c-work { font-size: 11px; color: #7c3aed; margin-top: 1px; }
.c-side { flex: 0 0 auto; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.c-dmg { font-size: 12px; color: #16263b; font-variant-numeric: tabular-nums; }
.c-clus { font-size: 11px; color: #5a6b80; }
.ch-badge.wf { display: inline-block; font-size: 10.5px; padding: 1px 7px; border-radius: 9px; color: #fff; margin-bottom: 2px; }
.ch-badge.wf.wf-found { background: #cc3311; }
.ch-badge.wf.wf-deems { background: #ee7733; }
.ch-badge.wf.wf-nd { background: #0077bb; }
.small { font-size: 11px; }
