/* ==========================================================================
   TeamTrek — the industry hero panel
   --------------------------------------------------------------------------
   The frame every industry hero sits in, and nothing else.

   Six pages in the industry catalogue each carry one live panel under the
   headline. The frame is the same on all of them on purpose: the same box,
   the same chrome, the same shadow, the same footprint. That is what makes
   the six read as one catalogue rather than six separate pages, and it is
   why a reader moving between them never feels the panel resize.

   What goes inside the frame is not shared. Each page's own stylesheet
   draws its own instrument -- a board, a ledger, a log, a ribbon -- because
   each industry reads its week through a different shape. A shift floor is
   a question about the clock; a legal day is a question about sequence; a
   firm's month is a question about proportion. One table cannot be all
   three.

   Before this file, five pages carried five near-identical copies of the
   frame: 1,155 lines of stylesheet to draw one box five times. The frame
   lives here now, and the five keep only what is theirs.

   Used with the page's own sheet, which must load after this one:

     <div class="pnl shift" ...>
       <div class="pnl__bar"> dots, name, scope, meta </div>
       <div class="pnl__body"> the instrument, then <aside class="pnl__side">
       <p class="pnl__status"> two statements and a note
   ========================================================================== */
.pnl {
  position: relative;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  /* 66rem x 484px, the footprint the first of these panels had. Every page
     in the catalogue keeps it. */
  width: 100%; max-width: 66rem; margin-inline: auto;
  height: 484px;
  border: 1px solid var(--neutral-200); border-radius: var(--r-xl);
  background: #fff;
  /* The panel straddles the dark band and the dome below it, and a light
     shadow over the dark half disappears. */
  box-shadow: 0 30px 80px rgba(8, 40, 36, .28);
  overflow: hidden;
  font-size: .875rem;
  /* The hero centres its copy and the panel is inside it. A column read
     downward cannot inherit that: every cell starts at the same left edge,
     and only the figure columns are told otherwise. */
  text-align: left;
}

/* ------------------------------------------------------------------- bar */
.pnl__bar {
  display: flex; align-items: center; gap: .75rem;
  padding: .625rem .875rem;
  border-bottom: 1px solid var(--neutral-150);
  background: var(--neutral-50);
}
.pnl__dots { display: flex; gap: .375rem; }
.pnl__dots i {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--neutral-200);
}
.pnl__name {
  display: inline-flex; align-items: center; gap: .4375rem;
  font-size: .75rem; font-weight: 700; color: var(--neutral-900);
  white-space: nowrap;
}
.pnl__name .icon { width: 13px; height: 13px; color: var(--primary-600); }

/* What the panel is showing: a window, a period, a view. */
.pnl__scope {
  padding: .1875rem .5rem;
  border-radius: var(--r-pill);
  background: var(--neutral-100);
  font-size: .6875rem; font-weight: 600; color: var(--neutral-600);
  white-space: nowrap;
}

/* The one figure a reader looks at before any row: coverage, a total, an
   average. It sits at the far end of the bar on every page. */
.pnl__meta {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: .4375rem;
  font-size: .75rem; color: var(--neutral-500);
  white-space: nowrap;
}
.pnl__meta b { color: var(--neutral-900); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ body */
.pnl__body { display: grid; grid-template-columns: minmax(0, 1fr) 15rem; min-height: 0; }

/* ------------------------------------------------------------------ side */
.pnl__side {
  padding: .875rem;
  border-left: 1px solid var(--neutral-150);
  background: var(--neutral-25);
  display: grid; align-content: start; gap: .875rem;
}
.pnl__sidehead {
  font-size: .625rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--neutral-500);
}

/* A meter: one bar and the sentence under it. Four of the six panels show
   their headline proportion this way. */
.pnl__meter { display: grid; gap: .5rem; }
.pnl__track {
  height: 8px; border-radius: var(--r-pill);
  background: var(--neutral-150);
  overflow: hidden;
}
.pnl__track > span {
  display: block; height: 100%; width: var(--w, 0%);
  border-radius: var(--r-pill);
  background: var(--primary-500);
  transition: width var(--dur-ui) var(--ease-ui);
}
.pnl__meterline { font-size: .75rem; color: var(--neutral-600); }
.pnl__meterline b { color: var(--neutral-900); font-variant-numeric: tabular-nums; }

/* What the panel adds up to, as plain rows rather than tiles. */
.pnl__facts { display: grid; gap: .5rem; margin: 0; }
.pnl__fact {
  display: flex; align-items: baseline; justify-content: space-between; gap: .5rem;
  font-size: .75rem; color: var(--neutral-500);
}
.pnl__fact dt { color: inherit; }
.pnl__fact dd { margin: 0; }
.pnl__fact b {
  font-size: .8125rem; font-weight: 700; color: var(--neutral-900);
  font-variant-numeric: tabular-nums;
}

.pnl__legend {
  display: grid; gap: .375rem; margin: 0;
  padding-top: .75rem; border-top: 1px solid var(--neutral-150);
}
.pnl__legend li {
  display: flex; align-items: center; gap: .4375rem;
  font-size: .6875rem; color: var(--neutral-500);
}
.pnl__legend i { flex: none; width: 8px; height: 8px; border-radius: 50%; }

/* ---------------------------------------------------------------- status */
.pnl__status {
  display: flex; align-items: center; gap: 1.25rem;
  padding: .5rem .875rem;
  border-top: 1px solid var(--neutral-150);
  background: var(--neutral-50);
  font-size: .6875rem; color: var(--neutral-500);
}
.pnl__status b { color: var(--neutral-800); font-variant-numeric: tabular-nums; }
/* Always last, and always the sentence that says the figures are made up. */
.pnl__note { margin-left: auto; }

/* ------------------------------------------------------------- narrower */
@media (max-width: 959px) {
  /* The fixed height goes first: below this width the rail drops under the
     instrument and the panel is as tall as its contents. */
  .pnl { height: auto; }
  .pnl__body { grid-template-columns: minmax(0, 1fr); }
  .pnl__side { border-left: 0; border-top: 1px solid var(--neutral-150); }
}

/* --------------------------------------------------------------- phones */
/* The bar was the reason four of these panels hung off the right edge of a
   phone: its name, its scope chip and its figure are each nowrap, and in a
   row that could not wrap they added up to about 500px and dragged the
   panel out with them. Below 600px the bar wraps, the chip and the figure
   are allowed to shrink, and the panel fits the screen it is on.

   Nothing is hidden here. The instrument keeps every row it has; it is the
   chrome that gives way. */
@media (max-width: 599px) {
  .pnl { font-size: .8125rem; }

  .pnl__bar {
    flex-wrap: wrap;
    gap: .375rem .5rem;
    padding: .5rem .625rem;
  }
  .pnl__name { min-width: 0; }
  .pnl__scope {
    min-width: 0;
    overflow: hidden; text-overflow: ellipsis;
    font-size: .75rem;
  }
  /* The figure takes the second line to itself, where it has room to be
     read rather than truncated. */
  .pnl__meta {
    flex: 1 0 100%;
    margin-left: 0;
    font-size: .8125rem;
  }

  .pnl__side { padding: .75rem .625rem; gap: .75rem; }
  .pnl__sidehead { font-size: .75rem; }
  .pnl__meterline,
  .pnl__fact { font-size: .8125rem; }
  .pnl__fact b { font-size: .8125rem; }
  .pnl__legend li { font-size: .75rem; }

  .pnl__status {
    flex-wrap: wrap; gap: .25rem .75rem;
    padding: .5rem .625rem;
    font-size: .75rem;
  }
  /* On one line of its own, so it is not competing with the two statements
     beside it for 390px. */
  .pnl__note { flex: 1 0 100%; margin-left: 0; }
}
