
#crewHud {
  --ch1-ground: #0b1118;
  --ch1-dark: #141c26;
  --ch1-mid: #1e2a38;
  --ch1-line: #3a4656;
  --ch1-cardinal: #C41E3A;
  --ch1-working: #3ddc97;
  --ch1-stuck: #ff5a5f;
  --ch1-gold: #e6c47a;
  --ch1-text: #e6edf5;
  --ch1-muted: #9fb0c3;
  --ch1-dim: #6e8094;
  --fam-claude: #D97757;
  --fam-gpt: #10A37F;
  --fam-kimi: #027AFF;
  --fam-house: #C41E3A;
  --fam-gemini-grad: linear-gradient(90deg, #8AB4F8 0%, #A78BFA 50%, #D96570 100%);
  --ch1-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --ch1-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  color-scheme: dark;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  color: var(--ch1-text);
  background: transparent;
  font: 12px/1.25 var(--ch1-font);
  text-align: left;
  isolation: isolate;
}

#crewHud *,
#crewHud *::before,
#crewHud *::after {
  box-sizing: border-box;
}

#crewHud button {
  appearance: none;
  margin: 0;
  border: 0;
  padding: 0;
  max-width: 100%;
  min-width: 0;
  background: none;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: inherit;
  cursor: pointer;
}

#crewHud button:focus-visible {
  outline: 2px solid var(--ch1-working);
  outline-offset: 2px;
  border-radius: 2px;
}

#crewHud .ch1-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  max-width: 1488px;
  min-width: 0;
  margin: 0 auto;
  padding: 6px 10px;
  background: var(--ch1-dark);
  border: 1px solid var(--ch1-line);
  border-top: 2px solid var(--ch1-cardinal);
  border-radius: 4px;
}

#crewHud .ch1-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 8px;
  min-width: 0;
  min-height: 24px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--ch1-line);
}

#crewHud .ch1-brand {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 5px 10px;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

#crewHud .ch1-brand-tag {
  flex: 0 0 auto;
  padding: 2px 6px;
  background: var(--ch1-mid);
  border: 1px solid var(--ch1-line);
  border-left: 3px solid var(--ch1-cardinal);
  color: var(--ch1-text);
  font-size: 12px;
  white-space: nowrap;
}

#crewHud .ch1-sec-status {
  min-width: 0;
  color: var(--ch1-text);
  font-size: 12px;
  overflow-wrap: anywhere;
}

#crewHud .ch1-summary-strip {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 5px 12px;
  min-width: 0;
  color: var(--ch1-muted);
  font-size: 12px;
}

#crewHud .ch1-summary-item {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 4px;
  max-width: 100%;
  min-width: 0;
  padding: 2px 7px;
  background: var(--ch1-mid);
  border: 1px solid var(--ch1-line);
  border-radius: 3px;
}

#crewHud .ch1-summary-hours {
  line-height: 1.35;
}

#crewHud .ch1-clock .ch1-num {
  white-space: nowrap;
}

#crewHud .ch1-set-aside {
  color: var(--ch1-muted);
  border-style: dashed;
}

#crewHud .ch1-set-aside .ch1-num {
  color: var(--ch1-text);
}

#crewHud .ch1-reading-count {
  color: var(--ch1-dim);
  font: 10px/1 var(--ch1-mono);
  white-space: nowrap;
}

#crewHud .ch1-job-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 10px;
  padding: 4px;
  border-bottom: 1px solid var(--ch1-line);
  color: var(--ch1-muted);
  font-size: 11px;
}

#crewHud .ch1-job-status .ch1-num {
  margin-left: 2px;
}

#crewHud .ch1-casualty {
  color: var(--ch1-stuck);
}

#crewHud .ch1-toggle {
  flex: 0 0 auto;
  padding: 3px 9px;
  background: var(--ch1-mid);
  border: 1px solid var(--ch1-line);
  border-radius: 3px;
  color: var(--ch1-text);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.12s ease;
}

#crewHud .ch1-toggle:hover {
  background: #28384a;
  color: var(--ch1-text);
}

#crewHud .ch1-collapsed .ch1-summary-strip,
#crewHud .ch1-collapsed .ch1-sec-status {
  display: none;
}

#crewHud .ch1-collapsed .ch1-topbar {
  flex-wrap: nowrap;
  padding-bottom: 0;
  border-bottom: 0;
}

#crewHud .ch1-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

#crewHud .ch1-lead-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
}

#crewHud .ch1-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 5px 8px;
  background: var(--ch1-mid);
  border: 1px solid var(--ch1-line);
  border-radius: 3px;
}

#crewHud .ch1-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 3px 8px;
  min-width: 0;
  padding-bottom: 3px;
  border-bottom: 1px solid rgba(58, 70, 86, 0.7);
}

#crewHud .ch1-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--ch1-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#crewHud .ch1-section-title::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: 3px;
  height: 12px;
  background: var(--ch1-cardinal);
}

#crewHud .ch1-section-sub {
  color: var(--ch1-muted);
  font-size: 12px;
}

#crewHud .ch1-dim {
  color: var(--ch1-muted);
}

#crewHud .ch1-num,
#crewHud .ch1-num-link {
  font-family: var(--ch1-mono);
  font-variant-numeric: tabular-nums;
}

#crewHud .ch1-num {
  font-weight: 600;
}

#crewHud .ch1-num-link {
  font-weight: 700;
  border-bottom: 1px dotted rgba(159, 176, 195, 0.45);
}

#crewHud .ch1-missing {
  color: var(--ch1-dim);
  font-family: inherit;
  font-size: 11px;
  font-weight: 400;
}

#crewHud .c-claude { color: var(--fam-claude); }
#crewHud .c-gpt { color: var(--fam-gpt); }
#crewHud .c-kimi { color: var(--fam-kimi); }
#crewHud .c-house { color: var(--fam-house); }
#crewHud .c-grok { color: #d8dbe6; }
#crewHud .c-cursor { color: #C9D1D9; }
#crewHud .c-working { color: var(--ch1-working); }
#crewHud .ch1-gold { color: var(--ch1-gold); }

#crewHud .c-gemini {
  display: inline-block;
  padding-right: 2px;
  background: var(--fam-gemini-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.3;
}

#crewHud .ch1-waiting-item {
  color: var(--ch1-gold);
  border-color: rgba(230, 196, 122, 0.55);
}

#crewHud .ch1-saved {
  color: var(--ch1-working);
  font-family: var(--ch1-mono);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

#crewHud .ch1-saved-missing {
  color: var(--ch1-dim);
}

#crewHud .ch1-periods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

#crewHud .ch1-period-card {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: 3px 6px;
  background: var(--ch1-dark);
  border: 1px solid var(--ch1-line);
  border-radius: 3px;
}

#crewHud .ch1-period-card:hover {
  border-color: #52647a;
}

#crewHud .ch1-period-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
  color: var(--ch1-muted);
  font-size: 12px;
}

#crewHud .ch1-period-label > span:first-child {
  min-width: 0;
}

#crewHud .ch1-period-label > span:last-child {
  flex: 0 0 auto;
  white-space: nowrap;
}

#crewHud .ch1-period-metrics {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 5px;
  min-width: 0;
  font-size: 12px;
}

#crewHud .ch1-period-metrics > span {
  min-width: 0;
}

#crewHud .ch1-period-human {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 4px;
  text-align: right;
}

#crewHud .ch1-period-human > .ch1-dim {
  white-space: nowrap;
}

#crewHud .ch1-hu-stack {
  display: inline-flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  max-width: 100%;
  min-width: 0;
  vertical-align: top;
  text-align: right;
}

#crewHud .ch1-hu-line {
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
}

#crewHud .ch1-hu-kind {
  color: var(--ch1-dim);
  font-family: var(--ch1-font);
  font-weight: 400;
}

#crewHud .ch1-family-table .ch1-unfinished {
  display: block;
  margin-top: 1px;
  color: var(--ch1-dim);
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
}

#crewHud .ch1-split {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 6px;
  min-width: 0;
  align-items: start;
}


#crewHud .ch1-hours-rail {
  display: contents;
}

#crewHud .ch1-split .ch1-periods {
  grid-column: 1 / -1;
}

#crewHud .ch1-sub-table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--ch1-dark);
  border: 1px solid var(--ch1-line);
  border-radius: 3px;
  scrollbar-width: thin;
  scrollbar-color: var(--ch1-line) var(--ch1-dark);
}

#crewHud .ch1-family-wrap {
  overflow: visible;
  max-height: none;
}

#crewHud .ch1-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  color: var(--ch1-text);
  font-size: 12px;
  line-height: 1.25;
}

#crewHud .ch1-table th,
#crewHud .ch1-table td {
  min-width: 0;
  padding: 2px 4px;
  overflow: hidden;
  border-bottom: 1px solid rgba(58, 70, 86, 0.45);
  text-align: left;
  vertical-align: top;
}

#crewHud .ch1-table th {
  background: #101720;
  color: var(--ch1-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow-wrap: normal;
}

#crewHud .ch1-table tbody tr:last-child td {
  border-bottom: 0;
}

#crewHud .ch1-data-row:hover {
  background: rgba(58, 70, 86, 0.35);
}

#crewHud .ch1-right {
  text-align: right !important;
}

#crewHud .ch1-family-name {
  font-weight: 700;
  white-space: nowrap;
}

#crewHud .ch1-fam-name-col { width: 23%; }
#crewHud .ch1-fam-jobs-col { width: 12%; }
#crewHud .ch1-fam-saved-col { width: 25%; }

#crewHud .ch1-job-col { width: 24%; }
#crewHud .ch1-seat-col { width: 21%; }
#crewHud .ch1-hour-col { width: 11%; }
#crewHud .ch1-saved-col { width: 12%; }
#crewHud .ch1-verdict-col { width: 21%; }

#crewHud .ch1-sort {
  display: inline;
  max-width: 100%;
  color: var(--ch1-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow-wrap: normal;
}

#crewHud .ch1-right .ch1-sort {
  text-align: right;
}

#crewHud .ch1-sort:hover {
  color: var(--ch1-text);
}

#crewHud .ch1-sort-mark {
  white-space: nowrap;
}

#crewHud .ch1-clip {
  display: block;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#crewHud .ch1-job-line {
  display: flex;
  align-items: baseline;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
}

#crewHud .ch1-job-line .ch1-clip {
  flex: 1 1 auto;
}

#crewHud .ch1-job-name {
  font-family: var(--ch1-mono);
  font-weight: 600;
}

#crewHud .ch1-suspect {
  flex: 0 0 auto;
  color: var(--ch1-dim);
  font-size: 10px;
  font-weight: 400;
  white-space: nowrap;
}

#crewHud .ch1-job-table td {
  white-space: nowrap;
}

#crewHud .ch1-job-table td.ch1-verdict {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.2;
}

#crewHud .ch1-verdict-head {
  white-space: normal;
}

#crewHud .ch1-job-toggle-bar {
  display: flex;
  justify-content: center;
  padding: 4px;
  border-top: 1px solid var(--ch1-line);
}

#crewHud .ch1-usage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  min-width: 0;
}

#crewHud .ch1-usage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
  padding: 3px 6px;
  background: var(--ch1-dark);
  border: 1px solid var(--ch1-line);
  border-radius: 3px;
  font-size: 12px;
}

#crewHud .ch1-usage-bar > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

#crewHud .ch1-usage-wrap {
  max-height: 142px;
}

#crewHud .ch1-usage-table {
  table-layout: auto;
}

#crewHud .ch1-usage-table th,
#crewHud .ch1-usage-table td {
  white-space: nowrap;
}

#crewHud .ch1-usage-table th:first-child {
  width: 19%;
}

#crewHud .ch1-usage-table th:nth-child(2) {
  width: 18%;
}

#crewHud .ch1-usage-table th:nth-child(3) {
  width: 20%;
}

#crewHud .ch1-usage-table th:nth-child(4) {
  width: 17%;
}

#crewHud .ch1-token-note {
  color: var(--ch1-muted);
  font-size: 12px;
  line-height: 1.25;
}


@media (min-width: 1400px) {
  #crewHud .ch1-panel {
    max-width: none;
  }

  #crewHud .ch1-split {
    grid-template-columns: minmax(400px, 0.72fr) minmax(0, 1.28fr);
    gap: 8px;
    height: 392px;
    align-items: stretch;
  }

  #crewHud .ch1-hours-rail {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 6px;
    min-width: 0;
    min-height: 0;
  }

  #crewHud .ch1-split .ch1-periods {
    grid-column: auto;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  #crewHud .ch1-period-card {
    padding: 4px 7px;
  }

  #crewHud .ch1-family-wrap {
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  #crewHud .ch1-family-table {
    height: 100%;
  }

  #crewHud .ch1-split > .ch1-job-wrap {
    height: 100%;
    min-height: 0;
    border-left-color: var(--ch1-gold);
  }

  #crewHud .ch1-job-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
  }

  #crewHud .ch1-usage-layout {
    grid-template-columns: minmax(260px, 0.55fr) minmax(0, 1.45fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 6px 10px;
    height: 178px;
  }

  #crewHud .ch1-usage-bar {
    grid-column: 1;
    grid-row: 1;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 6px;
    min-height: 0;
    padding: 6px 8px;
  }

  #crewHud .ch1-usage-wrap {
    grid-column: 2;
    grid-row: 1 / 3;
    height: 100%;
    min-height: 0;
    max-height: none;
    border-left-color: var(--ch1-gold);
  }

  #crewHud .ch1-usage-table {
    table-layout: fixed;
    height: 100%;
  }

  #crewHud .ch1-usage-table th:first-child { width: 18%; }
  #crewHud .ch1-usage-table th:nth-child(2) { width: 16%; }
  #crewHud .ch1-usage-table th:nth-child(3) { width: 15%; }
  #crewHud .ch1-usage-table th:nth-child(4) { width: 15%; }

  #crewHud .ch1-token-note {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
  }
}

@media (max-width: 1000px) {
  #crewHud .ch1-brand {
    flex: 1 1 360px;
  }

  #crewHud .ch1-summary-strip {
    order: 3;
    flex: 1 1 100%;
    justify-content: flex-start;
  }

  #crewHud .ch1-collapsed .ch1-brand {
    flex-basis: auto;
  }
}

@media (max-width: 900px) {
  #crewHud .ch1-lead-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  #crewHud .ch1-periods {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #crewHud .ch1-split {
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 0;
    max-height: none;
  }

  #crewHud .ch1-family-wrap {
    max-height: none;
  }

  #crewHud .ch1-job-wrap {
    max-height: none;
  }

  #crewHud .ch1-job-col { width: 23%; }
  #crewHud .ch1-seat-col { width: 23%; }
  #crewHud .ch1-hour-col { width: 10%; }
  #crewHud .ch1-saved-col { width: 11%; }
  #crewHud .ch1-verdict-col { width: 23%; }
}

@media (max-width: 560px) {
  #crewHud .ch1-panel {
    padding-right: 7px;
    padding-left: 7px;
  }

  #crewHud .ch1-brand {
    flex-basis: 100%;
  }

  #crewHud .ch1-collapsed .ch1-brand {
    flex-basis: auto;
  }

  #crewHud .ch1-summary-hours {
    flex: 1 1 100%;
  }

  #crewHud .ch1-periods {
    grid-template-columns: minmax(0, 1fr);
  }

  #crewHud .ch1-section {
    padding-right: 6px;
    padding-left: 6px;
  }

  #crewHud .ch1-table th,
  #crewHud .ch1-table td {
    padding-right: 3px;
    padding-left: 3px;
  }

  #crewHud .ch1-family-table .ch1-fam-name-col { width: 14%; }
  #crewHud .ch1-family-table .ch1-fam-jobs-col { width: 9%; }

  #crewHud .ch1-family-table th {
    font-size: 11px;
  }

  #crewHud .ch1-family-table .ch1-hu-line,
  #crewHud .ch1-family-table .ch1-unfinished {
    font-size: 10px;
  }

  #crewHud .ch1-usage-table {
    table-layout: fixed;
  }

  #crewHud .ch1-usage-table th {
    white-space: nowrap;
    overflow-wrap: normal;
  }

  #crewHud .ch1-usage-table td {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  #crewHud *,
  #crewHud *::before,
  #crewHud *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
