/* ============================================================================
 * shippers.css — the Shippers tab.
 * ----------------------------------------------------------------------------
 * Two views in one panel:
 *
 *   Roster    every configured shipper as one scannable row. Three columns —
 *             name, how we quote it, its fuel — because the four that used to
 *             follow them were numbers you could not act on from here.
 *
 *   Summary   one account, answer first: a strip of four figures, then fuel,
 *             then rules collapsed by axis, then the base rate in a sentence.
 *
 * WHY A TABLE AND NOT CARDS. The Fuel tab is cards because a fuel table is a
 * block of configuration you read one at a time. A roster is the opposite job:
 * forty accounts compared down a column, where "which of these has no fuel
 * table" should be answerable by running an eye down one edge of the screen.
 *
 * TYPE WEIGHT. Nothing here goes above 600. An earlier pass had the client
 * name at 800, the column headers, pills, figures and rule names all at 700,
 * and the result read as shouting: when everything is bold nothing is
 * emphasised, it is just heavy. Emphasis on this tab comes from colour and
 * placement — the name is the only near-black text in its row, the dollar
 * figure is the only one right-aligned — and weight is left to do the small
 * amount of work it is good at.
 *
 * Tokens are the real ones from styles.css: --text-primary, --text-sec,
 * --text-muted, --accent-primary, --surface / -1 / -2 / -3, --border,
 * --border-strong, --warning, --error, --radius, --radius-sm, --shadow-sm.
 * (--text-pri and --accent do not exist in this project and silently render as
 * nothing — the Fuel tab shipped with both for a while.)
 * ==========================================================================*/

/* ── Toolbar ──────────────────────────────────────────────────────────────── */

.shp-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.shp-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 240px;
  min-width: 200px;
  max-width: 340px;
}

.shp-search svg {
  position: absolute;
  left: 11px;
  color: var(--text-muted);
  pointer-events: none;
}

.shp-search input {
  width: 100%;
  padding: 9px 12px 9px 33px;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.88rem;
}

.shp-search input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* Three chips: All, Line Haul, All In. Mixed and Needs-attention were removed
   — Mixed sat disabled at 0 on any real book of accounts, and Needs-attention
   duplicated the ⚠ line that already prints inside the row it would have
   filtered to. A chip that would return nothing is disabled rather than
   hidden: a greyed-out "All In 0" is a fact about the data, whereas a missing
   chip makes the reader wonder whether the filter exists. */
.shp-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.shp-chip {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-sec);
  font: inherit;
  font-size: 0.79rem;
  font-weight: 550;
  cursor: pointer;
  transition: var(--transition, all 0.15s ease);
  white-space: nowrap;
}

.shp-chip:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.shp-chip.active {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--amber-glow, var(--accent-soft));
}

.shp-chip:disabled {
  opacity: 0.45;
  cursor: default;
}

.shp-chip .n {
  opacity: 0.7;
  font-weight: 500;
  margin-left: 3px;
}

.shp-btn {
  padding: 8px 13px;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-sec);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 550;
  cursor: pointer;
  transition: var(--transition, all 0.15s ease);
  white-space: nowrap;
}

.shp-btn:hover:not(:disabled) {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.shp-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.shp-btn-primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--white, #fff);
}

.shp-btn-primary:hover:not(:disabled) {
  color: var(--white, #fff);
  filter: brightness(1.06);
}

.shp-btn-primary:disabled {
  opacity: 0.45;
}

/* An action that reads as a link but is a button, so it keeps keyboard and
   screen-reader semantics. Used inside sentences — the flash line, the
   duplicate-name error, the summary's Expand all. */
.shp-linkbtn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
  font-weight: 600;
  color: var(--accent-primary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.shp-linkbtn:hover {
  filter: brightness(1.1);
}

/* margin-left:auto pushes this and everything after it — Refresh, then Add
   shipper — to the right edge of the toolbar. */
.shp-count {
  margin-left: auto;
  margin-right: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.shp-spacer {
  flex: 1;
}

/* Visually hidden, still read out. The roster's last column is a chevron with
   no header text; a blank <th> is a column a screen reader announces as
   nothing at all. */
.shp-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Notices ──────────────────────────────────────────────────────────────── */

.shp-notice {
  margin-bottom: 12px;
  padding: 9px 12px;
  border: 1px solid var(--warning);
  border-radius: var(--radius-sm, 10px);
  font-size: 0.8rem;
  color: var(--text-sec);
  background: transparent;
}

/* One dismissible sentence above the roster. It reports the outcome of
   something the user just did — currently only the Add dialog — and it is a
   line rather than a toast because the follow-up action lives inside it and a
   toast would take that action away after four seconds. */
.shp-flash {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--accent-primary);
  border-radius: var(--radius-sm, 10px);
  background: var(--amber-glow, var(--accent-soft));
  font-size: 0.82rem;
  color: var(--text-sec);
  line-height: 1.5;
}

.shp-flash-text {
  flex: 1;
}

.shp-flash-text strong {
  color: var(--text-primary);
}

.shp-flash-x {
  flex: none;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.shp-flash-x:hover {
  color: var(--text-primary);
}

.shp-error {
  padding: 14px 16px;
  border: 1px solid var(--error);
  border-radius: var(--radius-sm, 10px);
  color: var(--error);
  font-size: 0.85rem;
  background: transparent;
}

.shp-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius, 14px);
}

.shp-empty strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Roster ───────────────────────────────────────────────────────────────── */

.shp-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius, 14px);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm, none);
}

.shp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

/* Three data columns leave slack, and slack has to go somewhere deliberate.
   It goes to the name: it is the longest string, it carries the aliases and
   the ⚠ line underneath, and it is what the eye tracks down. Quoting and Fuel
   are fixed so they line up as columns rather than drifting with content. */
.shp-col-name {
  width: auto;
}

.shp-col-mode {
  width: 150px;
}

.shp-col-fuel {
  width: 260px;
}

.shp-col-go {
  width: 44px;
}

.shp-table th {
  text-align: left;
  padding: 11px 16px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.shp-table th.num,
.shp-table td.num {
  text-align: right;
}

.shp-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-sec);
  vertical-align: top;
}

.shp-table tbody tr:last-child td {
  border-bottom: none;
}

/* The whole row is the target, not a link at the end of it. Reaching for a
   3-pixel chevron to open a record you can see the name of is a needless
   piece of precision work. */
.shp-row {
  cursor: pointer;
  transition: var(--transition, all 0.15s ease);
}

.shp-row:hover {
  background: var(--surface-2);
}

.shp-row:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

.shp-row.flagged {
  box-shadow: inset 3px 0 0 var(--warning);
}

.shp-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.88rem;
}

.shp-sub {
  margin-top: 3px;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.shp-flag {
  display: block;
  margin-top: 5px;
  font-size: 0.74rem;
  color: var(--warning);
  line-height: 1.4;
}

.shp-muted {
  color: var(--text-muted);
}

.shp-go {
  color: var(--text-muted);
  font-size: 1.1rem;
  text-align: right;
}

.shp-row:hover .shp-go {
  color: var(--accent-primary);
}

/* Quoting mode. Same vocabulary and the same colour logic as the summary's
   badge, because they are the same fact seen from two distances. */
.shp-mode {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-sec);
  white-space: nowrap;
}

.shp-mode.lh {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.shp-mode.mixed,
.shp-mode.off {
  border-color: var(--warning);
  color: var(--warning);
}

/* ── The Global row ──────────────────────────────────────────────── */
/*
 * Sits in the same table as the accounts and opens the same way — that was the
 * ask: treat global like its own client. What it must NOT do is read as a
 * customer, so it gets a tinted band and a tag rather than blending in.
 *
 * Deliberately understated: it is pinned above forty rows people scan every
 * day, and a loud row in a fixed position becomes noise within a week.
 */
.shp-mode.global {
  border-style: dashed;
}

.shp-row-global {
  background: var(--surface-2);
}

.shp-row-global td {
  border-bottom: 1px solid var(--border-strong);
}

.shp-global-tag {
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px dashed var(--border-strong);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
  vertical-align: middle;
  white-space: nowrap;
}

/* ── Add-shipper dialog ───────────────────────────────────────────────────── */
/*
 * Its own overlay rather than .modal-overlay from styles.css. That class is
 * z-index 3000 with a 12px backdrop blur and a bounce animation tuned for the
 * rule-builder's big editors; this is a four-field form, and it should not
 * arrive with more ceremony than the thing it creates. Sharing the class would
 * also mean this tab breaks the day someone tunes that one.
 */
.shp-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(12, 10, 9, 0.28);
  backdrop-filter: blur(3px);
  animation: shpFade 0.16s ease;
}

@keyframes shpFade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Nothing behind the overlay should scroll while it is open — on a long
   roster the page scrolling under a fixed dialog reads as the dialog moving. */
body.shp-modal-open {
  overflow: hidden;
}

.shp-modal-box {
  width: min(92vw, 520px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius, 14px);
  box-shadow: var(--shadow-lg, 0 20px 50px rgba(0, 0, 0, 0.18));
  animation: shpPop 0.18s ease;
}

@keyframes shpPop {
  from {
    transform: translateY(8px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.shp-modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}

.shp-modal-head h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.shp-modal-sub {
  margin: 4px 0 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.shp-modal-x {
  flex: none;
  margin-left: auto;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.shp-modal-x:hover {
  color: var(--text-primary);
}

.shp-modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shp-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.shp-field label .req {
  color: var(--error);
}

.shp-field label .opt {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.8;
}

.shp-field input[type='text'],
.shp-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 10px);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.87rem;
  resize: vertical;
}

.shp-field input[type='text']:focus,
.shp-field textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
}

.shp-hint {
  margin: 5px 0 0;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Two options, both spelled out. A <select> here would hide the difference
   between Line Haul and All In behind a word, and that difference is the
   single largest thing about how an account is quoted. */
.shp-seg {
  display: grid;
  gap: 8px;
}

.shp-seg-opt {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 10px);
  cursor: pointer;
  transition: var(--transition, all 0.15s ease);
}

.shp-seg-opt:hover {
  border-color: var(--border-strong);
}

.shp-seg-opt input {
  margin-top: 3px;
  accent-color: var(--accent-primary);
}

.shp-seg-opt strong {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.shp-seg-opt em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.shp-seg-opt:has(input:checked) {
  border-color: var(--accent-primary);
  background: var(--amber-glow, var(--accent-soft));
}

.shp-modal-error {
  padding: 9px 12px;
  border: 1px solid var(--error);
  border-radius: var(--radius-sm, 10px);
  color: var(--error);
  font-size: 0.8rem;
  line-height: 1.5;
}

.shp-modal-error .shp-linkbtn {
  color: var(--error);
}

.shp-modal-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* The demo disclaimer. It sits in the footer next to the button it qualifies,
   not in a banner at the top where it would be read once and forgotten by the
   time anyone pressed Save. Delete this rule with the note itself when the
   endpoint lands. */
.shp-modal-note {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
  max-width: 190px;
}

/* ── Summary ──────────────────────────────────────────────────────────────
 *
 * Answer first. The strip below the client name carries the four figures the
 * page exists to report; everything under it is the working. The rules are
 * collapsed by axis because printing eleven expanded rules put the fuel
 * number four screens above the fold, and a pricing screen nobody scrolls is
 * a pricing screen people guess at.
 * ────────────────────────────────────────────────────────────────────────── */

.fsum {
  border: 1px solid var(--border);
  border-radius: var(--radius, 14px);
  background: var(--surface);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm, none);
}

.fsum-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  justify-content: space-between;
}

.fsum-client {
  margin: 0;
  font-size: 1.14rem;
  font-weight: 650;
  letter-spacing: -0.2px;
  color: var(--text-primary);
}

/* The single sentence someone is actually here for — "do we deduct fuel for
   this account, and off what". */
.fsum-headline {
  margin-top: 4px;
  font-size: 0.87rem;
  color: var(--text-sec);
}

.fsum-mode {
  flex: none;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-sec);
  white-space: nowrap;
}

.fsum-mode.lh {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.fsum-mode.mixed,
.fsum-mode.off {
  border-color: var(--warning);
  color: var(--warning);
}

.fsum-mode.global {
  border-style: dashed;
}

/* ── "Global logic also applies" ──────────────────────────────────── */
/* .fsum-globalref removed with the "Plus N global rules" line it styled
   (shp-summary.js). Global logic is reached from the Global row on the
   roster instead. Kept as a note, not a rule, so nobody wonders where the
   dashed footer box went. */

/* Two spellings of one account folding together is a data-entry problem, not
   a fact about pricing, so it reads as an aside rather than a section. */
.fsum-alias {
  margin-top: 14px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 10px);
  font-size: 0.78rem;
  color: var(--text-sec);
  line-height: 1.55;
}

.fsum-alias code,
.fsum-actions code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-primary);
}

/* ── Sections ──────────────────────────────────────────────────────────── */

.fsum-sec {
  margin-top: 24px;
}

.fsum-sec-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.fsum-sec h4 {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* An empty section collapses onto ONE line with its heading. Previously
   "nothing here" occupied the same vertical space as a section full of rules. */
.fsum-sec.empty {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.fsum-sec.empty>h4 {
  flex: none;
  margin: 0;
}

/* Collapsed columns and other asides — stated once under the thing they
   describe rather than repeated down a column. */
.fsum-sub {
  margin-top: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.fsum-line {
  font-size: 0.87rem;
  color: var(--text-sec);
  line-height: 1.6;
}

.fsum-line .muted {
  color: var(--text-muted);
}

.fsum-none {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Summary tables ────────────────────────────────────────────────────── */

.fsum-table-wrap {
  overflow-x: auto;
}

.fsum-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

.fsum-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.fsum-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-sec);
}

.fsum-table tr:last-child td {
  border-bottom: none;
}

.fsum-table .num {
  text-align: right;
  white-space: nowrap;
}

/* The dollar figure per table is the answer to "what does this client's fuel
   cost", so it is the one cell that carries weight. */
.fsum-table td.strong {
  font-weight: 600;
  color: var(--text-primary);
}

.fsum-table .unit {
  font-size: 0.75em;
  color: var(--text-muted);
  font-weight: 500;
}

.fsum-table .muted {
  color: var(--text-muted);
}

.fsum-table .warn {
  color: var(--warning);
}

.fsum-table tr.dim td {
  opacity: 0.55;
}

/* ── Rules ─────────────────────────────────────────────────────────────── */
/*
 * <details> for both levels: axis, then rule. Native disclosure gives keyboard
 * operation and Enter/Space for free, and leaves no open/closed state for the
 * renderer to track and lose on the next re-render.
 */
.fsum-axis {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 10px);
  background: var(--surface-1);
  overflow: hidden;
}

.fsum-axis+.fsum-axis {
  margin-top: 8px;
}

.fsum-axis-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 11px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

/* Default triangles differ per browser and sit at different baselines; this is
   one glyph everywhere, and it rotates. */
.fsum-axis-head::-webkit-details-marker,
.fsum-rule-top::-webkit-details-marker {
  display: none;
}

.fsum-axis-head::before,
.fsum-rule-top::before {
  content: '›';
  flex: none;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform 0.15s ease;
}

.fsum-axis[open]>.fsum-axis-head::before,
.fsum-rule[open]>.fsum-rule-top::before {
  transform: rotate(90deg);
}

.fsum-axis-head:hover {
  background: var(--surface-2);
}

.fsum-axis-head:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: -2px;
}

.fsum-axis-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
}

.fsum-axis-count {
  flex: none;
  min-width: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-sec);
  font-size: 0.72rem;
  font-weight: 600;
  text-align: center;
}

.fsum-axis-note {
  font-size: 0.74rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fsum-axis-body {
  padding: 2px 14px 12px;
}

/* The DAT lookup sentence at the top of the Base rate axis. It is where the
   number comes FROM rather than something done to it, so it reads as a lead-in
   to the rows under it rather than as one of them — no border, no chips. */
.fsum-axis-lead {
  padding: 8px 0 4px 16px;
  font-size: 0.8rem;
  color: var(--text-sec);
  line-height: 1.6;
}

.fsum-axis-lead strong {
  font-weight: 600;
  color: var(--text-primary);
}

.fsum-axis-lead .muted {
  color: var(--text-muted);
}

/* Two neutral pills in a row (Base config + who set it) need to not run
   together into one grey blob. */
.fsum-rule-top .fsum-pill.neutral+.fsum-pill.neutral {
  margin-left: -2px;
}

.fsum-rule {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.fsum-rule.dim {
  opacity: 0.6;
}

.fsum-rule-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  cursor: pointer;
  list-style: none;
}

/* A rule with nothing behind the closed row gets no arrow and no pointer —
   an affordance that opens onto the line you were already reading is a
   promise the page then breaks. */
.fsum-rule.flat>.fsum-rule-top {
  cursor: default;
}

.fsum-rule.flat>.fsum-rule-top::before {
  content: '';
  width: 0;
}

.fsum-rule-top:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.fsum-rule-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-primary);
}

.fsum-rule-sum {
  margin: 6px 0 0 16px;
  font-size: 0.79rem;
  color: var(--text-sec);
  line-height: 1.5;
}

.fsum-pill {
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.66rem;
  font-weight: 600;
  white-space: nowrap;
}

/* There is no .fsum-pill.on. A green "In force" badge printed on essentially
   every rule, which made it decoration that read like a status. The negative
   cases stayed: a rule that is NOT moving the rate today cannot look identical
   to one that is. */
.fsum-pill.off {
  color: var(--warning);
}

/* "Global" is a classification, not a status — it must not compete with the
   pill that means something is wrong. */
.fsum-pill.neutral {
  color: var(--text-muted);
  font-weight: 600;
}

/* The action chips ride on the CLOSED row: the name says what a rule is for,
   the conditions say when it fires, but this is what the rate actually did. */
.fsum-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.fsum-more {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

.fsum-branches {
  margin: 8px 0 0;
  padding-left: 32px;
  font-size: 0.78rem;
  color: var(--text-sec);
}

.fsum-branches li {
  margin-bottom: 5px;
  line-height: 1.5;
}

.fsum-branch-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-right: 6px;
}

.fsum-branches .fsum-actions {
  margin-left: 6px;
}

/* ── Docs ──────────────────────────────────────────────────────────────── */

.fsum-docs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Download-only source-PDF chip.
 *
 * A near-copy of .fuel-doc-chip rather than a reuse of it, and that is
 * deliberate: this tab would otherwise depend on fuel-admin.css for one of its
 * own components, which is exactly the kind of invisible link that breaks the
 * day somebody trims that file. The visual difference is real too — there is
 * no × here. Attaching and removing PDFs happens on the Fuel tab; a summary is
 * a page you read and hand to someone.
 */
.shp-doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 320px;
  padding: 3px 9px 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-1);
  font-size: 0.76rem;
}

.shp-doc-chip a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shp-doc-chip a:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

.shp-doc-pdf {
  flex: none;
  color: var(--error);
  font-size: 0.62rem;
  font-weight: 600;
  border: 1px solid currentColor;
  border-radius: 3px;
  padding: 0 3px;
  line-height: 1.4;
}

.fsum-foot {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ── Detail bar ───────────────────────────────────────────────────────────── */

.shp-detail-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.shp-back {
  padding: 8px 13px;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-sec);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 550;
  cursor: pointer;
  transition: var(--transition, all 0.15s ease);
}

.shp-back:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.shp-miles {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  color: var(--text-sec);
}

.shp-miles input {
  width: 78px;
  padding: 7px 9px;
  border-radius: var(--radius-sm, 10px);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.85rem;
  text-align: center;
}

.shp-miles input:focus {
  outline: none;
  border-color: var(--accent-primary);
}

/* ── Print ─────────────────────────────────────────────────────────────── */
/*
 * exportShipperSummaryPdf() sets .shp-printing on <body> and forces every
 * <details> open first (shp-export.js), so the printed page is the complete
 * document even though the screen version is collapsed. A PDF that said
 * "Price adjustments (8)" with nothing under it would be a document that lost
 * eight rules on its way to whoever it was sent to.
 *
 * The browser's own print-to-PDF renders the real page, so the export inherits
 * this stylesheet rather than needing a second renderer kept in step with it.
 *
 * (Renamed from .fuel-printing when this moved off the Fuel tab. If a stale
 * fuel-admin.css is still cached, the OLD rule matches nothing rather than
 * half-applying — which is the failure mode you want.)
 */

@media print {
  body.shp-printing * {
    visibility: hidden;
  }

  body.shp-printing .fsum,
  body.shp-printing .fsum * {
    visibility: visible;
  }

  body.shp-printing .fsum {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    border: none;
    box-shadow: none;
    padding: 0;
  }

  /* The disclosure arrows mean nothing on paper. */
  body.shp-printing .fsum-axis-head::before,
  body.shp-printing .fsum-rule-top::before {
    display: none;
  }

  /* Sections shouldn't split across a page break mid-rule — a rule whose
     status pill landed on the next sheet is how a paused rule gets read as
     live. */
  body.shp-printing .fsum-sec,
  body.shp-printing .fsum-axis,
  body.shp-printing .fsum-rule {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}