/*
 * Content primitives (roadmap phase 6 task 8).
 *
 * Every widget body is built from one of these. A widget may add variant classes; it
 * may not ship its own rules. Colours come from tokens, sizes from the type scale.
 */

/* ---- .kt-table: the data table ---- */
.kt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}

.kt-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: var(--sp-1) var(--sp-2);
  background: var(--bg-3);
  border-bottom: var(--hairline) solid var(--line-strong);
  color: var(--text-dim);
  font-size: var(--fs-xxs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Every header is a sort control (backlog F4, wired in `widgets/sortable.js`). The
   affordance has to be there before the click, or the feature is one nobody finds; the
   arrow appears only on the column actually in force. */
.kt-table[data-kt-sortable="on"] th {
  cursor: pointer;
  user-select: none;
}
.kt-table[data-kt-sortable="on"] th:hover { color: var(--text); }
.kt-table th:focus-visible {
  outline: var(--hairline) solid var(--orange);
  outline-offset: -2px;
}
.kt-table th[aria-sort]::after {
  content: '';
  margin-left: 0.35em;
  color: var(--text-faint);
}
.kt-table th[aria-sort="none"]:hover::after   { content: '\2195'; }   /* up-down arrow */
.kt-table th[aria-sort="ascending"]::after    { content: '\2191'; color: var(--orange); }
.kt-table th[aria-sort="descending"]::after   { content: '\2193'; color: var(--orange); }
.kt-table th[aria-sort="ascending"],
.kt-table th[aria-sort="descending"] { color: var(--orange); }

.kt-table td {
  padding: var(--sp-1) var(--sp-2);
  border-bottom: var(--hairline) solid var(--line);
  vertical-align: middle;
  white-space: nowrap;
}

.kt-table tbody tr:hover { background: var(--bg-hover); }

/* The column that gives way when the cell is narrow.
 *
 * Every cell is `nowrap`, so one long label — a faction, an activity, a commodity — sets
 * the table's minimum width and the whole thing scrolls sideways inside its body. Mark
 * the label column `.ellipsis` and it truncates instead: `max-width: 0` makes the cell
 * take what is left after the other columns, which is exactly what should happen. Put the
 * full text in a `title` so nothing is lost. */
.kt-table .ellipsis {
  max-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kt-table .num {
  text-align: right;
  font-family: var(--ff-mono);
  font-variant-numeric: tabular-nums;
}

.kt-table .value { color: var(--amber); }
.kt-table .dim   { color: var(--text-dim); }

/* Bar cell: a value with its share of the maximum drawn behind it. */
.kt-table .is-bar {
  position: relative;
  min-width: 8rem;
}
/* The gradient itself is set inline by the widget: hue carries meaning (rank in the
   table, or the activity a value came from), so it cannot be a fixed token. */
.kt-table .is-bar .bar {
  position: absolute;
  inset: 2px auto 2px 0;
  background: linear-gradient(90deg, var(--orange-dim), rgba(255, 113, 0, 0.15));
  border-radius: 0 1px 1px 0;
  opacity: 0.85;
}
.kt-table .is-bar .bar-label {
  position: relative;
  display: block;
  padding-right: var(--sp-1);
  color: var(--text);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  font-family: var(--ff-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ---- .kt-kv: label/value list ---- */
.kt-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-1) var(--sp-3);
  align-content: start;
  margin: 0;
  font-size: var(--fs-sm);
}
.kt-kv dt {
  color: var(--text-faint);
  font-size: var(--fs-xxs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.kt-kv dd {
  margin: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
}
.kt-kv dd.value { color: var(--amber); font-family: var(--ff-mono); }
.kt-kv dd.muted { color: var(--text-dim); }

/* ---- .kt-tiles: image tile grid ---- */
.kt-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
  gap: var(--sp-2);
}
.kt-tile {
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 2px;
  padding: var(--sp-1);
  background: var(--bg-3);
  border: var(--hairline) solid var(--line);
  text-align: center;
}
.kt-tile img {
  width: 100%;
  height: 3.5rem;
  object-fit: contain;
}
.kt-tile .tile-name  { color: var(--text); font-size: var(--fs-xs); }
.kt-tile .tile-value { color: var(--amber); font-size: var(--fs-xs); font-family: var(--ff-mono); }
.kt-tile .tile-count {
  position: absolute;
  color: var(--text-dim);
  font-size: var(--fs-xxs);
}
.kt-tile.hit { animation: kt-tile-hit var(--t-slow) ease-out; }
@keyframes kt-tile-hit {
  from { box-shadow: var(--glow-strong); border-color: var(--orange); }
  to   { box-shadow: none; }
}

/* ---- .kt-list: compact single-column list ---- */
.kt-list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: var(--fs-sm);
}
.kt-list li {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-1) 0;
  border-bottom: var(--hairline) solid var(--line);
}

/* ---- .kt-progress: shared bar ---- */
.kt-progress {
  position: relative;
  height: 0.5rem;
  background: var(--bg-3);
  border: var(--hairline) solid var(--line);
  overflow: hidden;
}
.kt-progress > span {
  display: block;
  height: 100%;
  background: var(--orange);
}

/* ---- empty state ---- */
.kt-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--text-faint);
  font-size: var(--fs-xs);
}

/* ---- pagination footer (kills) ---- */
.kt-pager {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  color: var(--text-dim);
  font-size: var(--fs-xs);
}
.kt-pager .page-info { font-family: var(--ff-mono); min-width: 5.5em; text-align: center; }

/* ---- .kt-card: card list with optional progress ---- */
.kt-cards {
  display: grid;
  gap: var(--sp-2);
  align-content: start;
}

.kt-card {
  display: grid;
  gap: var(--sp-1);
  padding: var(--sp-2);
  background: var(--bg-3);
  border: var(--hairline) solid var(--line);
  border-left: 2px solid var(--orange-dim);
  font-size: var(--fs-sm);
}

.kt-card.is-ready   { border-left-color: var(--ok); }
.kt-card.is-urgent  { border-left-color: var(--warn); }
.kt-card.is-done    { border-left-color: var(--ok); opacity: 0.65; }

.kt-card .card-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
}
.kt-card .card-title {
  flex: 1 1 auto;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kt-card .card-value {
  color: var(--amber);
  font-family: var(--ff-mono);
  white-space: nowrap;
}

.kt-card .card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-3);
  color: var(--text-dim);
  font-size: var(--fs-xs);
}
.kt-card .card-meta .sep { color: var(--text-faint); }
/* The meta line that is the point of the card rather than a footnote to it. */
.kt-card .card-meta.lede { color: var(--text); font-size: var(--fs-sm); }
/* A figure in a meta line that is itself good or bad news — the reinforcement and
   undermining totals under a contest bar, where the colour has to match the segment
   above it or the bar cannot be read. */
.kt-card .card-meta .good { color: var(--ok); }
.kt-card .card-meta .bad  { color: var(--bad); }

/* Tags label a row or a card; they are not card-specific. */
.tag {
  display: inline-block;
  margin-left: 0.4em;
  padding: 0.05em 0.4em;
  border: var(--hairline) solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--text-dim);
  font-size: var(--fs-xxs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: baseline;
  white-space: nowrap;
}
.kt-card .tag { margin-left: 0; }
.tag.vip     { color: var(--gold); }
.tag.wanted  { color: var(--bad); }
.tag.wing    { color: var(--info); }
.tag.ready   { color: var(--ok); }
.tag.urgent  { color: var(--warn); }
/* Domain-neutral variants, for a tag whose meaning is not a bounty or a wing. The three
   existing colours already say good, bad and other; naming them again for each subject
   is how a palette becomes a thesaurus. Matches `.kt-table td.good` / `.bad`. */
.tag.good    { color: var(--ok); }
.tag.bad     { color: var(--bad); }
.tag.info    { color: var(--info); }
.tag.muted   { color: var(--text-dim); }

/* A group of missions that share a target faction. */
.kt-group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-1) 0;
  color: var(--orange);
  font-size: var(--fs-xs);
  font-weight: var(--fw-bold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: var(--hairline) solid var(--line);
}
.kt-group-head .group-count { color: var(--amber); font-family: var(--ff-mono); }

/* ---- density: a widget shows more when it is given more room ----
 * The widget body is the query container, so a widget in a wide band or on a tablet
 * surface reveals columns that would be noise in a narrow cell. Columns opt in by
 * priority: 2 appears at medium width, 3 only when there is real room.
 */
.widget-body { container-type: inline-size; container-name: widget; }

[data-priority="2"], [data-priority="3"] { display: none; }

@container widget (min-width: 34rem) {
  [data-priority="2"] { display: table-cell; }
}
@container widget (min-width: 52rem) {
  [data-priority="3"] { display: table-cell; }
}

/* Summary strip above a dense table: the figures that survive at any width. */
.kt-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-4);
  padding: 0 0 var(--sp-2);
  margin-bottom: var(--sp-2);
  border-bottom: var(--hairline) solid var(--line);
}
.kt-summary .stat { display: flex; align-items: baseline; gap: var(--sp-1); }
.kt-summary .stat-label {
  color: var(--text-faint);
  font-size: var(--fs-xxs);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.kt-summary .stat-value {
  color: var(--amber);
  font-family: var(--ff-mono);
  font-size: var(--fs-md);
  font-variant-numeric: tabular-nums;
}
.kt-summary .stat-value.good { color: var(--ok); }
.kt-summary .stat-value.bad  { color: var(--bad); }

.kt-table td.good { color: var(--ok); }
.kt-table td.bad  { color: var(--bad); }
/* Markets · Runs: the BGS column is the destination's demand as a word. */
.kt-table td.bgs-high { color: var(--ok); }
.kt-table td.bgs-none { color: var(--bad); }

/* A table's own caveat, shown under it when the figures need one. */
.kt-note {
  margin: var(--sp-2) 0 0;
  color: var(--text-faint);
  font-size: var(--fs-xxs);
  font-style: italic;
}

/* ---- stacked bar: one row, segments coloured by the thing they represent ---- */
.kt-stack {
  display: flex;
  height: 0.7rem;
  overflow: hidden;
  background: var(--bg-3);
  border: var(--hairline) solid var(--line);
}
.kt-stack .seg { height: 100%; min-width: 1px; }

/* A stacked bar inside a table cell. Without a width it is a flex box that takes
   everything going, and the label column beside it — the one that names the row — is the
   one that gives way, which is the wrong way round. */
.kt-table .kt-stack { width: 6rem; }
/* A column that is a stacked bar and nothing else: it gets a share of the row rather than
   the six rems a bar beside a label gets, so the bar's length can be read. */
.kt-table td.is-stack { width: 34%; }
.kt-table td.is-stack .kt-stack { min-width: 2px; }

.kt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-3);
  padding-top: var(--sp-2);
  color: var(--text-dim);
  font-size: var(--fs-xxs);
}
.kt-legend .key { display: inline-flex; align-items: center; gap: 0.35em; }
.kt-legend .swatch {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 1px;
}

/* A system's row: name, stacked bar, total. */
.kt-stack-row {
  display: grid;
  grid-template-columns: minmax(6rem, 12rem) 1fr auto;
  gap: var(--sp-2);
  align-items: center;
  padding: var(--sp-1) 0;
}
.kt-stack-row .name {
  color: var(--text);
  font-size: var(--fs-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The row that is yours, in a list of rivals. */
.kt-stack-row .name.mine { color: var(--amber); font-weight: var(--fw-bold); }
.kt-stack-row .total {
  color: var(--amber);
  font-family: var(--ff-mono);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}


/* ---------------------------------------------------------------------------
 * Segmented control: the options, visible, one press each.
 *
 * Replaces a `<select>` wherever the choice is small and the labels are short
 * (backlog F10). A dropdown of three costs two clicks and hides two thirds of the answer
 * until asked; showing them costs a little width and nothing else. Above four options,
 * or with long labels, a select is still the right control.
 * ------------------------------------------------------------------------ */
.kt-segment {
  display: inline-flex;
  border: var(--hairline) solid var(--line-strong);
  border-radius: var(--radius-sm, 2px);
  overflow: hidden;
}
.kt-segment + .kt-segment { margin-left: var(--sp-1); }

.kt-segment .seg-btn {
  appearance: none;
  margin: 0;
  padding: 0 var(--sp-2);
  background: transparent;
  border: 0;
  border-left: var(--hairline) solid var(--line);
  color: var(--text-dim);
  font: inherit;
  font-size: var(--fs-sm);
  line-height: 1.9;
  white-space: nowrap;
  cursor: pointer;
}
.kt-segment .seg-btn:first-child { border-left: 0; }
.kt-segment .seg-btn:hover { background: var(--bg-hover); color: var(--text); }
.kt-segment .seg-btn:focus-visible {
  outline: var(--hairline) solid var(--orange);
  outline-offset: -2px;
}

/* The chosen one reads as chosen without a second glance. */
.kt-segment .seg-btn.is-on {
  background: var(--orange-dim);
  color: var(--text);
  font-weight: var(--fw-bold);
}


/* ---------------------------------------------------------------------------
 * Filter chips: categories you can switch on, several at once, none meaning all.
 * A segmented control picks one of a few; chips narrow a list by any of several.
 * ------------------------------------------------------------------------ */
.kt-chips { display: flex; flex-wrap: wrap; gap: var(--sp-1); padding-bottom: var(--sp-2); }
.kt-chips[hidden] { display: none; }
.kt-chips .chip {
  appearance: none;
  padding: 0.1em 0.6em;
  background: var(--bg-2);
  border: var(--hairline) solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-dim);
  font: inherit;
  font-size: var(--fs-xs);
  cursor: pointer;
}
.kt-chips .chip b { color: var(--text); font-family: var(--ff-mono); font-weight: var(--fw-normal); }
.kt-chips .chip:hover { border-color: var(--orange); color: var(--text); }
.kt-chips .chip.is-on { background: var(--orange-dim); border-color: var(--orange); color: var(--text); }
.kt-chips .chip.is-none { opacity: 0.45; }
.kt-chips .chip:focus-visible { outline: var(--hairline) solid var(--orange); outline-offset: 1px; }

/* ---- .jn-*: the Journey widget (F3) ---------------------------------------------------
   The band is the Status widget's facts as chips; the strip is every stop this session;
   the stop is one place and what happened there. Colours are the tokens, tones follow the
   tag palette (ok, bad, urgent, info). */
.jn-band {
  display: grid;
  gap: var(--sp-1);
  padding: 0 0 var(--sp-2);
  border-bottom: var(--hairline) solid var(--line);
}
.jn-band.is-back { padding: 0; }
.jn-head { display: flex; align-items: baseline; gap: var(--sp-2); min-width: 0; }
.jn-cmdr { font-family: var(--ff-display); font-weight: var(--fw-bold); font-size: var(--fs-md); letter-spacing: 0.03em; color: var(--text); white-space: nowrap; }
.jn-ship { color: var(--text-dim); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jn-state { margin-left: auto; color: var(--amber); font-size: var(--fs-xs); white-space: nowrap; }
.jn-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.jn-chip {
  display: inline-flex; align-items: center;
  padding: 0.05em 0.4em;
  border: var(--hairline) solid var(--line);
  color: var(--text-dim);
  font-size: var(--fs-xxs);
  white-space: nowrap;
}
.jn-chip b { font-family: var(--ff-mono); font-weight: var(--fw-normal); color: var(--text); margin-left: 0.3em; }
.jn-chip svg { width: 0.8em; height: 0.8em; margin-right: 0.3em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.jn-chip.ok     { color: var(--ok);   border-color: rgba(0, 255, 0, 0.35); }
.jn-chip.bad    { color: var(--bad);  border-color: rgba(255, 0, 0, 0.45); }
.jn-chip.urgent { color: var(--warn); border-color: rgba(255, 204, 0, 0.4); }
.jn-chip.info   { color: var(--info); border-color: rgba(119, 221, 255, 0.35); }
.jn-gauges {
  display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 2px var(--sp-2); align-items: center;
  color: var(--text-faint); font-size: var(--fs-xxs); letter-spacing: 0.06em; text-transform: uppercase;
}
.jn-gauge { position: relative; height: 4px; background: var(--bg-3); border: var(--hairline) solid var(--line); }
.jn-gauge > span { position: absolute; inset: 0 auto 0 0; background: var(--orange); }
.jn-gauge.low > span { background: var(--bad); }
.jn-pips { display: inline-flex; gap: 3px; align-items: center; font-family: var(--ff-mono); letter-spacing: 0; text-transform: none; color: var(--text-dim); }
.jn-pips i { display: inline-block; width: 5px; height: 8px; background: var(--line-strong); }
.jn-pips i.on { background: var(--amber); }
.jn-pips i.half { background: linear-gradient(to top, var(--amber) 50%, var(--line-strong) 50%); }
.jn-back {
  display: flex; gap: var(--sp-2); align-items: baseline; width: 100%;
  padding: 3px 0; border: 0; background: transparent; text-align: left; cursor: pointer;
  color: var(--text-dim); font: inherit; font-size: var(--fs-xs);
}
.jn-back b { color: var(--text-faint); font-weight: var(--fw-normal); font-size: var(--fs-xxs); letter-spacing: 0.08em; text-transform: uppercase; }
.jn-back:hover { color: var(--orange); }
.jn-back:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }

.jn-nav { display: inline-flex; align-items: center; gap: var(--sp-1); }
.jn-btn {
  width: 1.6em; height: 1.35em; padding: 0; cursor: pointer;
  font: inherit; font-family: var(--ff-mono); font-size: var(--fs-sm); line-height: 1;
  color: var(--text-dim); background: transparent; border: var(--hairline) solid var(--line-strong);
}
.jn-btn:hover:not(:disabled) { color: var(--orange); border-color: var(--orange); }
.jn-btn:disabled { opacity: 0.35; cursor: default; }
.jn-btn:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.jn-pos { min-width: 3.4em; text-align: center; font-family: var(--ff-mono); font-size: var(--fs-xs); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.jn-pos.is-live { color: var(--ok); }

.jn-strip { display: flex; align-items: flex-end; gap: 2px; height: 9px; margin: var(--sp-2) 0; }
.jn-strip:empty { display: none; }
.jn-strip i { flex: 1 1 0; display: block; height: 5px; background: var(--line-strong); cursor: pointer; }
.jn-strip i.docked { height: 9px; }
.jn-strip i.earned { background: var(--orange-dim); }
.jn-strip i.is-current { background: var(--orange); box-shadow: var(--glow-strong); }

.jn-stop { display: grid; gap: var(--sp-2); align-content: start; }
.jn-stop-head { display: grid; gap: 2px; }
.jn-system { font-family: var(--ff-display); font-weight: var(--fw-bold); font-size: var(--fs-xl); line-height: 1.05; letter-spacing: 0.02em; color: var(--text); }
.jn-station { color: var(--amber); font-size: var(--fs-sm); }
.jn-station.transit { color: var(--text-dim); font-style: italic; }
.jn-stations { color: var(--text-dim); font-size: var(--fs-xs); }  /* every station docked at in this system */
.jn-meta { display: flex; flex-wrap: wrap; gap: 2px var(--sp-3); color: var(--text-dim); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.jn-meta b { font-weight: var(--fw-normal); font-family: var(--ff-mono); color: var(--text); }
.jn-badge {
  padding: 0.15em 0.5em; border: var(--hairline) solid var(--line-strong); background: var(--bg-3);
  color: var(--text-dim); font-size: var(--fs-xxs); letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap;
}
.jn-badge b { font-family: var(--ff-mono); font-weight: var(--fw-bold); color: var(--amber); letter-spacing: 0; }
.jn-badge.bounty { border-color: var(--orange-dim); }
.jn-badge.wing b { color: var(--info); }
.jn-badge.missions b { color: var(--ok); }
.jn-panel {
  display: grid; gap: var(--sp-1); padding: var(--sp-2);
  background: var(--bg-3); border: var(--hairline) solid var(--line); border-left: 2px solid var(--orange-dim);
  font-size: var(--fs-sm);
}
.jn-panel.bounty    { border-left-color: var(--orange); }
.jn-panel.missions  { border-left-color: var(--ok); }
.jn-panel.wing      { border-left-color: var(--info); }
.jn-panel.trade     { border-left-color: var(--gold); }
.jn-panel-head { display: flex; align-items: baseline; gap: var(--sp-2); }
.jn-panel-title { flex: 1; color: var(--text-faint); font-size: var(--fs-xxs); letter-spacing: 0.08em; text-transform: uppercase; }
.jn-panel-value { font-family: var(--ff-mono); color: var(--amber); white-space: nowrap; font-variant-numeric: tabular-nums; }
.jn-kv { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--sp-3); margin: 0; font-size: var(--fs-xs); }
.jn-kv dt { color: var(--text-faint); font-size: var(--fs-xxs); letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.jn-kv dd { margin: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jn-kv dd.n { font-family: var(--ff-mono); color: var(--amber); font-variant-numeric: tabular-nums; }
.jn-bars { display: grid; gap: 3px; }
.jn-bars:empty { display: none; }
.jn-bar { display: grid; grid-template-columns: 1fr auto; gap: 0 var(--sp-2); align-items: center; font-size: var(--fs-xs); }
.jn-bar .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.jn-bar .n { font-family: var(--ff-mono); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.jn-bar .track { grid-column: 1 / -1; height: 4px; background: var(--bg-2); border: var(--hairline) solid var(--line); }
.jn-bar .track > span { display: block; height: 100%; background: var(--orange); }

/* ---- the Cargo Hold widget's carrier block: a titled second table under the ship's ---- */
.cargo-carrier-note { padding: var(--sp-1) 0 0; font-size: var(--fs-xxs); }
.cargo-carrier-note[hidden] { display: none; }

/* ---- .cz-*: the Conflict Zones widget (F18) -------------------------------------------
   Built from the Journey primitives: the summary is a meta line for the session, the strip
   is one tick per visit (ground visits stand taller), the visit is a stop. */
.cz-summary { padding: 0 0 var(--sp-2); border-bottom: var(--hairline) solid var(--line); align-items: center; }
.cz-summary[hidden] { display: none; }
.cz-session { color: var(--text-faint); font-size: var(--fs-xxs); letter-spacing: 0.08em; text-transform: uppercase; }
.cz-war .jn-panel-value.ok  { color: var(--ok); }
.cz-war .jn-panel-value.bad { color: var(--bad); }
.cz-deaths { display: inline-flex; align-items: center; gap: 0.3em; color: var(--bad); }
.cz-deaths svg { width: 0.9em; height: 0.9em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cz-live svg { animation: cz-pulse 1.6s ease-in-out infinite; }
@keyframes cz-pulse { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.jn-strip i.ground { height: 9px; }
@media (prefers-reduced-motion: reduce) { .cz-live svg { animation: none; } }

/* ---- .cr-*: the Carrier widget (F19) ---------------------------------------------------
   Journey primitives again: gauges for tritium and space, a facts list, a panel per
   scheduled jump, the jump history and the standing orders as ruled rows. */
.jn-stop.cr-stop { gap: var(--sp-1); }
.cr-line { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--sp-2); min-width: 0; }
.cr-services { color: var(--text-faint); font-size: var(--fs-xxs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-stop .jn-panel { padding: var(--sp-1) var(--sp-2); gap: 2px; }
.cr-jump-d { min-width: 3.4em; color: var(--text-faint); font-size: var(--fs-xxs); white-space: nowrap; }
.cr-older { color: var(--text-faint); font-size: var(--fs-xxs); }
.cr-when { color: var(--text-dim); font-size: var(--fs-xs); }
.cr-when b { font-family: var(--ff-mono); font-weight: var(--fw-normal); color: var(--warn); font-variant-numeric: tabular-nums; }
.jn-panel-value svg { width: 0.9em; height: 0.9em; margin-right: 0.3em; vertical-align: -0.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cr-jumps, .cr-orders { display: grid; gap: 2px; }
.cr-jump, .cr-order { display: grid; grid-template-columns: auto 1fr auto; gap: 0 var(--sp-2); align-items: baseline; font-size: var(--fs-xs); }
.cr-jump { grid-template-columns: auto auto 1fr auto; }
.cr-jump-t, .cr-order-price { font-family: var(--ff-mono); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.cr-jump-route { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.cr-jump-route i { font-style: normal; color: var(--orange); }
.cr-jump-fuel { font-family: var(--ff-mono); color: var(--amber); font-variant-numeric: tabular-nums; }
.cr-order-name { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-order-side { color: var(--text-dim); white-space: nowrap; }
.cr-order-side b { font-family: var(--ff-mono); font-weight: var(--fw-normal); color: var(--amber); }
.jn-bar.dim .track > span { background: var(--orange-dim); }
.jn-earned { display: flex; align-items: baseline; gap: var(--sp-2); padding-top: var(--sp-1); border-top: var(--hairline) solid var(--line); }
.jn-earned .k { flex: 1; color: var(--text-faint); font-size: var(--fs-xxs); letter-spacing: 0.08em; text-transform: uppercase; }
.jn-earned .v { font-family: var(--ff-mono); font-size: var(--fs-lg); color: var(--amber); font-variant-numeric: tabular-nums; }
.jn-earned .v small { margin-left: 0.3em; font-size: var(--fs-xs); color: var(--text-dim); }
.jn-quiet { color: var(--text-faint); font-size: var(--fs-xs); font-style: italic; }

/* ---- Inventory: a material held against its storage cap (F9) ---- */
.kt-table .is-bar.is-full .bar { background: linear-gradient(90deg, var(--ok), rgba(0, 255, 0, 0.15)); }
.kt-table .is-bar .bar-label .dim { color: var(--text-faint); font-size: 0.85em; }
.kt-table tr.is-full td:first-child { color: var(--ok); }
.kt-chips.is-families .chip { font-size: var(--fs-xxs); }

/* Markets: which of the markets seen to use. A chip per market; a dimmed one is left out. */
.mk-filter { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: var(--sp-2); }
.mk-filter[hidden] { display: none; }
.mk-chip { cursor: pointer; }
.mk-chip.is-off { opacity: 0.4; text-decoration: line-through; }
.kt-table tr.mk-group td { color: var(--orange); font-family: var(--ff-display); font-weight: var(--fw-bold); letter-spacing: 0.04em; text-transform: uppercase; padding-top: var(--sp-2); border-bottom: var(--hairline) solid var(--line); }
