/* ============================================================
   ESTIMATE — route/suggested/unrouted controls (v6)
   ============================================================ */

/* Category header gains a SUGGESTED chip when flagged */
.ep2-cat__sw {
  background: rgba(46,125,80,0.14); color: #1f5e3a;
  padding: 2px 6px; border-radius: 3px;
  font-size: 9px; letter-spacing: 0.08em;
}
.ep2-cat.is-suggested { background: rgba(46,125,80,0.03); }

/* Unrouted tone — uses warm-red to read as "needs attention" */
.ep2-route__dot--unrouted   { background: #ED0800; }
.ep2-route--unrouted .ep2-route__hd { background: rgba(237,8,0,0.06); }
.ep2-route--unrouted        { border-color: rgba(237,8,0,0.30); }
.ep2-route__warn { background: rgba(237,8,0,0.10); color: var(--red); padding: 2px 8px; border-radius: 3px; font-family: var(--font-mono); }

.ep2-route__hd {
  /* let the warning chip + total share row when present */
  grid-template-columns: 12px 40px auto auto 1fr auto auto;
}

/* Route controls now live in the category header row. */
.ep2-cat__route {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 10px;
  margin: 4px 0 6px;
  background: rgba(26,26,26,0.025);
  border-radius: 3px;
  flex-wrap: wrap;
}
.ep2-cat__route .t-label { font-size: 9px; color: #6b6760; margin-right: 2px; }
.ep2-cat__route--locked { background: rgba(37,99,235,0.06); border: 1px solid rgba(37,99,235,0.14); }
.ep2-cat__locked-copy { font-size: 11px; color: #3D3831; }
.ep2-cat__locked-pill {
  justify-self: start;
  border: 1px solid rgba(37,99,235,0.16);
  border-radius: 3px;
  background: rgba(37,99,235,0.07);
  color: #1d4ed8;
  padding: 2px 6px;
  white-space: nowrap;
}
.ep2-cat__chips { display: flex; gap: 4px; flex-wrap: wrap; }
.ep2-cat__chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px;
  border: 1px solid rgba(26,26,26,0.12);
  background: #FFFDF9;
  border-radius: 3px;
  font-size: 11px;
  color: #3D3831;
  cursor: pointer;
}
.ep2-cat__chip:hover { background: #F1EEE8; border-color: rgba(26,26,26,0.25); }
.ep2-cat__chip .mono { font-family: var(--font-mono); font-weight: 600; color: #6b6760; font-size: 10px; letter-spacing: 0.06em; }
.ep2-cat__chip.is-on {
  background: #1A1A1A; color: #fff; border-color: #1A1A1A;
}
.ep2-cat__chip.is-on .mono,
.ep2-cat__chip.is-on .ep2-route__dot { filter: brightness(1.6); }
.ep2-cat__chip--supply.is-on  { background: #2563eb; border-color: #2563eb; }
.ep2-cat__chip--install.is-on { background: #10b981; border-color: #10b981; }
.ep2-cat__chip--cert.is-on    { background: #0ea5e9; border-color: #0ea5e9; }
.ep2-cat__chip--addon.is-on   { background: #d97706; border-color: #d97706; }
.ep2-cat__chip--unrouted      { color: #6b6760; border-style: dashed; }
.ep2-cat__chip--unrouted.is-on{ background: #ED0800; color: #fff; border-color: #ED0800; border-style: solid; }

.ep2-cat__route--inline {
  margin: 0;
  padding: 0;
  background: transparent;
  gap: 6px;
  flex-wrap: nowrap;
  justify-self: start;
}
.ep2-cat__route--inline .t-label {
  margin-right: 0;
  font-size: 9px;
}
.ep2-cat__route--inline .ep2-cat__chips {
  flex-wrap: nowrap;
  gap: 3px;
}
.ep2-cat__route--inline .ep2-cat__chip {
  min-width: 34px;
  justify-content: center;
  padding: 3px 7px;
  gap: 4px;
}
.ep2-cat__route--inline .ep2-cat__chip .ep2-route__dot {
  width: 7px;
  height: 7px;
}

.ep2-cat__sw-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 0;
  cursor: pointer;
  white-space: nowrap;
}
.ep2-cat__sw-toggle input { accent-color: #1f5e3a; }

/* Unrouted segment in totals bar gets a small warning glow */
.ep2-totalsbar__seg--warn {
  background: rgba(237,8,0,0.06);
  padding: 6px 8px;
  border-radius: 3px;
}
.ep2-totalsbar__seg--warn .t-label { color: var(--red); }

/* Dark mode */
[data-mode="banzai"] .ep2-cat__route { background: rgba(255,255,255,0.04); }
[data-mode="banzai"] .ep2-cat__chip { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.10); color: rgba(255,255,255,0.85); }
[data-mode="banzai"] .ep2-cat__chip:hover { background: rgba(255,255,255,0.08); }
[data-mode="banzai"] .ep2-cat__chip.is-on { background: #fff; color: #141412; border-color: #fff; }
[data-mode="banzai"] .ep2-cat__chip.is-on .mono { color: #141412; }

/* ============================================================
   NAVIGATION CONSOLIDATION — chrome variants
   - 'pillRow' — Deal Home gets a sticky pill row, top tabs gone
   - 'commandBar' — Tool switcher collapses to a single ⌘K-style trigger
   ============================================================ */

/* Hide top tabs when the consolidated nav is active */
.shell--pillRow .chrome__tabs,
.shell--commandBar .chrome__tabs { display: none; }
.shell--pillRow .chrome,
.shell--commandBar .chrome { padding: 8px 16px; }

/* Pill row variant — sits inside the deal header */
.tp-head__pillrow {
  display: flex; gap: 4px;
  margin-top: 12px;
  padding: 4px;
  background: rgba(26,26,26,0.04);
  border-radius: 3px;
  width: fit-content;
}
.tp-head__pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 3px;
  font-size: 12px; font-weight: 500;
  color: var(--fg2);
  position: relative;
}
.tp-head__pill:hover { color: var(--fg1); }
.tp-head__pill.is-on {
  background: var(--bg-elevated);
  color: var(--fg1);
  box-shadow: 0 1px 3px rgba(26,26,26,0.06);
}
.tp-head__pill-count {
  font-family: var(--font-mono); font-size: 9px;
  padding: 1px 5px; border-radius: 3px;
  background: rgba(26,26,26,0.06); color: var(--fg3);
}
.tp-head__pill.is-on .tp-head__pill-count { background: rgba(237,8,0,0.10); color: var(--red); }
.tp-head__pill[disabled] { opacity: 0.35; cursor: not-allowed; }

[data-mode="banzai"] .tp-head__pillrow { background: rgba(255,255,255,0.04); }
[data-mode="banzai"] .tp-head__pill.is-on { background: rgba(255,255,255,0.10); }
[data-mode="banzai"] .tp-head__pill-count { background: rgba(255,255,255,0.06); }

/* Command bar variant — a single chip in the chrome opens a dropdown */
.chrome__cmd {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--stroke);
  border-radius: 3px;
  background: var(--bg-elevated);
  font-family: var(--font-head); font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  min-width: 240px;
}
.chrome__cmd:hover { background: var(--row-hover); }
.chrome__cmd-l { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.chrome__cmd-l > span:first-child { font-size: 13px; }
.chrome__cmd-l .t-label { font-size: 9px; color: var(--fg3); }
.chrome__cmd-kbd {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 9px;
  padding: 2px 6px;
  background: rgba(26,26,26,0.05); color: var(--fg3);
  border-radius: 3px;
  letter-spacing: 0.06em;
}

.chrome__cmd-menu {
  position: absolute; top: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  min-width: 380px; max-width: 480px;
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
  border-radius: 3px;
  box-shadow: 0 12px 28px rgba(26,26,26,0.10);
  padding: 8px;
  z-index: 30;
}
.chrome__cmd-eyebrow { padding: 6px 8px 4px; font-size: 9px; }
.chrome__cmd-item {
  display: grid; grid-template-columns: 22px 1fr auto;
  gap: 10px; align-items: center;
  width: 100%; padding: 9px 10px;
  border-radius: 3px;
  text-align: left;
  color: var(--fg1);
}
.chrome__cmd-item:hover { background: var(--row-hover); }
.chrome__cmd-item.is-on { background: rgba(237,8,0,0.06); }
.chrome__cmd-item.is-disabled { opacity: 0.4; cursor: not-allowed; }
.chrome__cmd-item-l { display: flex; flex-direction: column; line-height: 1.2; }
.chrome__cmd-item-l > span:first-child { font-size: 13px; font-weight: 500; }
.chrome__cmd-item-l .t-label { font-size: 9px; }
.chrome__cmd-foot {
  margin-top: 4px; padding: 8px 10px 4px;
  border-top: 1px solid var(--stroke);
  font-size: 9px; color: var(--fg3);
}

[data-mode="banzai"] .chrome__cmd,
[data-mode="banzai"] .chrome__cmd-menu { background: var(--bg-elevated); border-color: rgba(255,255,255,0.10); }
[data-mode="banzai"] .chrome__cmd-kbd { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.7); }
[data-mode="banzai"] .chrome__cmd-item.is-on { background: rgba(255,255,255,0.06); }

/* Position the cmd trigger in the centre of the chrome */
.chrome__cmd-wrap {
  flex: 1;
  display: flex; justify-content: center;
  position: relative;
}

/* ============================================================
   RATE LIBRARY — route lanes + splits + palette groups
   Mirrors the Estimate tool's SUP/INS/C&C/ADD model.
   ============================================================ */

/* Master library rail — grouped by route */
.rc-rail-group { margin-top: 8px; }
.rc-rail-group:first-of-type { margin-top: 4px; }
.rc-rail-group__hd {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; margin-bottom: 4px;
  border-radius: var(--radius);
  font-family: var(--font-head); font-weight: 600; font-size: 12px;
  background: rgba(26,26,26,0.04);
  color: var(--fg1);
}
.rc-rail-group__hd--supply  { background: rgba(37,99,235,0.10); color: #1d4ed8; }
.rc-rail-group__hd--install { background: rgba(16,185,129,0.12); color: #065f46; }
.rc-rail-group__hd--cert    { background: rgba(14,165,233,0.12); color: #075985; }
.rc-rail-group__hd--addon   { background: rgba(217,119,6,0.12);  color: #92400e; }
.rc-rail-group__hd .t-label { margin-left: auto; font-size: 9px; opacity: 0.7; }
.rc-rail-group__code { font-size: 10px; letter-spacing: 0.06em; }

[data-mode="banzai"] .rc-rail-group__hd { background: rgba(255,255,255,0.05); }
[data-mode="banzai"] .rc-rail-group__hd--supply  { background: rgba(37,99,235,0.22); color: #c0d4ff; }
[data-mode="banzai"] .rc-rail-group__hd--install { background: rgba(16,185,129,0.22); color: #b4f3da; }
[data-mode="banzai"] .rc-rail-group__hd--cert    { background: rgba(14,165,233,0.22); color: #bae6fd; }
[data-mode="banzai"] .rc-rail-group__hd--addon   { background: rgba(217,119,6,0.22); color: #fadeb6; }

/* Category editor — route picker */
.rc-route-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.rc-route-hint { font-size: 11px; color: var(--fg3); margin: 6px 0 0; text-wrap: pretty; line-height: 1.5; }
.rc-route-hint strong { color: var(--fg1); }

/* Snapshot route splits — same row as estimate totals bar */
.rc-routesplits {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.rc-routesplit {
  display: grid; grid-template-columns: 12px 36px 1fr auto;
  gap: 10px; align-items: center;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--stroke);
}
.rc-routesplit--supply  { background: rgba(37,99,235,0.05); border-color: rgba(37,99,235,0.20); }
.rc-routesplit--install { background: rgba(16,185,129,0.05); border-color: rgba(16,185,129,0.20); }
.rc-routesplit--cert    { background: rgba(14,165,233,0.05); border-color: rgba(14,165,233,0.20); }
.rc-routesplit--addon   { background: rgba(217,119,6,0.05);  border-color: rgba(217,119,6,0.20); }
.rc-routesplit__code  { font-size: 11px; font-weight: 600; }
.rc-routesplit__l     { display: flex; flex-direction: column; min-width: 0; }
.rc-routesplit__label { font-family: var(--font-head); font-weight: 600; font-size: 13px; }
.rc-routesplit__l .t-label { font-size: 9px; color: var(--fg3); }
.rc-routesplit__val   { font-family: var(--font-mono); font-weight: 600; font-size: 14px; }

[data-mode="banzai"] .rc-routesplit { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.10); }
[data-mode="banzai"] .rc-routesplit--supply  { background: rgba(37,99,235,0.14); }
[data-mode="banzai"] .rc-routesplit--install { background: rgba(16,185,129,0.14); }
[data-mode="banzai"] .rc-routesplit--cert    { background: rgba(14,165,233,0.14); }
[data-mode="banzai"] .rc-routesplit--addon   { background: rgba(217,119,6,0.14); }

/* Snapshot — categories grouped into route lanes */
.rc-routelane {
  margin-top: 14px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  overflow: hidden;
}
.rc-routelane:first-of-type { margin-top: 0; }
.rc-routelane__hd {
  display: grid; grid-template-columns: 12px 36px auto 1fr auto;
  gap: 10px; align-items: center;
  padding: 10px 14px;
  font-size: 14px;
}
.rc-routelane__hd--supply  { background: rgba(37,99,235,0.07); }
.rc-routelane__hd--install { background: rgba(16,185,129,0.08); }
.rc-routelane__hd--cert    { background: rgba(14,165,233,0.08); }
.rc-routelane__hd--addon   { background: rgba(217,119,6,0.08); }
.rc-routelane--supply  { border-left: 3px solid #2563eb; }
.rc-routelane--install { border-left: 3px solid #10b981; }
.rc-routelane--cert    { border-left: 3px solid #0ea5e9; }
.rc-routelane--addon   { border-left: 3px solid #d97706; }
.rc-routelane__code   { font-family: var(--font-mono); font-weight: 600; font-size: 12px; letter-spacing: 0.06em; }
.rc-routelane__label  { font-weight: 600; font-size: 14px; }
.rc-routelane__helper { color: var(--fg3); font-size: 12px; }
.rc-routelane__total  { font-family: var(--font-mono); font-weight: 600; }

/* Per-category route chip (inherited from library) */
.rc-cat__route {
  margin-left: auto;
  margin-right: 12px;
  padding: 2px 6px !important;
  font-size: 10px;
}

/* Library palette — grouped by route lane */
.rc-palette__group { margin-bottom: 12px; }
.rc-palette__grouphd {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; margin-bottom: 4px;
  border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.06em;
  background: rgba(26,26,26,0.04);
  color: var(--fg2);
  text-transform: uppercase;
}
.rc-palette__grouphd--supply  { background: rgba(37,99,235,0.12); color: #1d4ed8; }
.rc-palette__grouphd--install { background: rgba(16,185,129,0.14); color: #065f46; }
.rc-palette__grouphd--cert    { background: rgba(14,165,233,0.14); color: #075985; }
.rc-palette__grouphd--addon   { background: rgba(217,119,6,0.14);  color: #92400e; }

[data-mode="banzai"] .rc-palette__grouphd { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.7); }
[data-mode="banzai"] .rc-palette__grouphd--supply  { background: rgba(37,99,235,0.22); color: #c0d4ff; }
[data-mode="banzai"] .rc-palette__grouphd--install { background: rgba(16,185,129,0.22); color: #b4f3da; }
[data-mode="banzai"] .rc-palette__grouphd--cert    { background: rgba(14,165,233,0.22); color: #bae6fd; }
[data-mode="banzai"] .rc-palette__grouphd--addon   { background: rgba(217,119,6,0.22); color: #fadeb6; }
[data-mode="banzai"] .rc-routelane { border-color: rgba(255,255,255,0.10); }
[data-mode="banzai"] .rc-routelane__hd--supply  { background: rgba(37,99,235,0.20); }
[data-mode="banzai"] .rc-routelane__hd--install { background: rgba(16,185,129,0.20); }
[data-mode="banzai"] .rc-routelane__hd--cert    { background: rgba(14,165,233,0.20); }
[data-mode="banzai"] .rc-routelane__hd--addon   { background: rgba(217,119,6,0.20); }
