/* Torvan admin workspace — single source of chrome for catalog browser,
   photo workspace, and the compact item page. */

/* Enforce [hidden] against any display:flex/grid overrides from this sheet */
[hidden] { display: none !important; }

/* Layout, color, and urgency tokens live in brand.css (:root). */

.tv-ticket-summary {
  border: 1px solid var(--hairline-color, #d8dce6);
  border-radius: 8px;
  background: var(--darkened-bg, #f7f9fc);
  padding: 12px 14px;
  margin: 0 0 14px;
}

.tv-ticket-summary h1 {
  margin: 0 0 6px;
  font-size: 1.1rem;
}

.tv-ticket-summary p {
  margin: 0;
}

.tv-ticket-lines {
  border-top: 2px solid var(--tv-brand-navy, #1b337d);
  padding-top: 10px;
}

/* Shell, panels, pills, lanes: design-system.css */
.tv-mode-tabs { display: inline-flex; gap: 6px; flex-wrap: wrap; margin-right: 4px; }
.tv-mode-tabs .tv-pill { margin: 0; }

.tv-stat-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
                 gap: 12px; max-width: var(--tv-workspace-max); margin-bottom: 20px; }
.tv-stat-card { padding: 10px 12px; border: 1px solid var(--hairline-color, #ddd);
                border-radius: 6px; background: var(--body-bg, #fff); }
.tv-stat-label { font-size: 0.85em; color: var(--body-quiet-color, #666); }
.tv-stat-value { font-size: 1.8em; font-weight: 700; line-height: 1.1; }
.tv-stat-value a { text-decoration: none; }
.tv-stat-sub { font-size: 0.8em; color: var(--body-quiet-color, #666); margin-top: 4px; }
.tv-stat-spark { display: block; margin-top: 6px; }
.tv-badge { font-weight: 700; font-size: 0.9em; }

.tv-asm-disclosure { border: 1px solid var(--hairline-color, #ccc); border-radius: 4px;
                     margin-bottom: 6px; background: var(--body-bg, #fff); }
.tv-asm-summary { list-style: none; cursor: pointer; padding: 10px 12px; font-weight: 600;
                  background: var(--darkened-bg, #f5f5f5);
                  display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 6px; }
.tv-asm-summary::-webkit-details-marker { display: none; }
.tv-asm-summary::before { content: "▸ "; }
.tv-asm-disclosure[open] > .tv-asm-summary::before { content: "▾ "; }
.tv-asm-code { font-family: monospace; }
.tv-asm-rollup { font-weight: 400; font-size: 0.9em; flex: 1 1 12rem; min-width: min(100%, 14rem);
                 color: #444; }
.tv-asm-body { padding: 0 8px 8px; overflow-x: auto; }
.tv-datasheet-queue { margin-top: 8px; }
.tv-datasheet-queue-help { margin: 0 0 12px; }
.tv-asm-summary .tv-pill { margin-left: auto; font-size: 0.85em; font-weight: 400; }
.tv-asm-toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 8px 0; }
.tv-asm-card > .tv-asm-hero { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
                               gap: 12px 16px; padding: 10px 12px; margin: 0 8px 8px;
                               border: 1px solid var(--hairline-color, #ddd); border-radius: 6px;
                               background: var(--darkened-bg, #f8f8f8); }
.tv-asm-hero-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; flex: 1 1 16rem; }
.tv-asm-hero-label { font-weight: 700; font-size: 0.85em; text-transform: uppercase; color: #555; }
.tv-pickable-check-hero { font-weight: 600; }
.tv-pill-muted { opacity: 0.85; }
.tv-nested-disclosure { margin: 4px 0; border: 1px solid var(--hairline-color, #ddd); border-radius: 4px;
                       background: var(--body-bg, #fff); }
.tv-nested-summary { list-style: none; cursor: pointer; padding: 8px 10px; font-weight: 600;
                     display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
                     gap: 8px 12px; }
.tv-nested-summary-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; flex: 1 1 12rem; }
.tv-pickable-check-summary { font-weight: 600; flex-shrink: 0; }
.tv-nested-summary::-webkit-details-marker { display: none; }
.tv-nested-summary::before { content: "▸ "; font-weight: 400; }
.tv-nested-disclosure[open] > .tv-nested-summary::before { content: "▾ "; }
.tv-nested-body { padding: 0 8px 8px; overflow-x: auto; border-left: 2px solid #d8d0ec; margin-left: 6px; }
.tv-table-nested { margin-top: 4px; }
.tv-subasm-row > td { padding: 6px 4px !important; background: color-mix(in srgb, #7b5ea7 8%, var(--body-bg, #fff)); border-bottom: none; }
.tv-subasm-row + tr > td { border-top: none; }

/* Catalog BOM tree: assemblies vs leaf components */
.tv-bom-subassembly {
  background: color-mix(in srgb, #7b5ea7 6%, var(--body-bg, #fff));
}
.tv-bom-leaf-row > td { background: var(--body-bg, #fff); }
.tv-bom-leaf-row:hover > td { background: var(--darkened-bg, #f8f8f8); }
.tv-bom-kind { font-size: 0.75em; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
               padding: 2px 7px; border-radius: 3px; flex-shrink: 0; }
.tv-bom-kind--assembly {
  color: var(--tv-brand-navy, #1b337d);
  background: color-mix(in srgb, var(--tv-brand-navy, #1b337d) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--tv-brand-navy, #1b337d) 35%, transparent);
}
.tv-search-input { min-width: min(100%, 18rem); }

.tv-workspace-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
                       gap: 20px 24px; align-items: start; }
.tv-workspace-filters { position: sticky; top: 12px; }
.tv-workspace-filters .tv-filter-bar { flex-direction: column; align-items: stretch;
                                       margin: 0 0 12px; }
.tv-workspace-filters .tv-filter-bar:last-child { margin-bottom: 0; }
.tv-workspace-filters .tv-search-input { width: 100%; min-width: 0; }
.tv-workspace-filters .tv-filter-label { margin-top: 6px; }
.tv-workspace-filters .tv-filter-label:first-child { margin-top: 0; }
.tv-workspace-main { min-width: 0; }

@media (max-width: 900px) {
  .tv-workspace-layout { grid-template-columns: 1fr; }
  .tv-workspace-filters { position: static; }
  .tv-workspace-filters .tv-filter-bar { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .tv-workspace-filters .tv-search-input { min-width: min(100%, 18rem); width: auto; }
}
.tv-form-actions { margin-top: 16px; }
.tv-pickable-check { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }

.tv-action-cell { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }

/* Compact Item page — hero panel */
.tv-item-hero {
  --tv-hero-label-w: 10.75rem;
  --tv-hero-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --tv-hero-sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
  gap: 20px 24px;
  padding: 16px 18px;
  margin-bottom: 8px;
  border: 1px solid var(--hairline-color, #ddd);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--body-bg, #fff) 0%, var(--darkened-bg, #f8fafc) 100%);
  font-family: var(--tv-hero-sans);
}
@media (max-width: 860px) {
  .tv-item-hero { grid-template-columns: 1fr; }
}
.tv-hero-photo {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 260px;
  width: 100%;
  flex: 0 0 auto;
}
.tv-hero-photo-upload { margin: 0; }
.tv-hero-photo-drop {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 2px dashed var(--hairline-color, #ccc);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  box-sizing: border-box;
}
.tv-hero-photo-drop--empty {
  min-height: 220px;
  background: var(--darkened-bg, #f4f6f8);
}
.tv-hero-photo-drop:not(.tv-hero-photo-drop--empty) {
  border-style: solid;
  border-color: var(--hairline-color, #ddd);
  background: #eef1f5;
}
.tv-hero-photo-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.tv-hero-photo-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: contain;
  vertical-align: top;
}
.tv-hero-photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 220px;
  padding: 1rem;
  text-align: center;
}
.tv-hero-photo-icon {
  width: 48px;
  height: 48px;
  color: var(--body-quiet-color, #999);
}
.tv-hero-photo-label {
  margin: 0;
  font-weight: 600;
  color: var(--body-fg, #333);
}
.tv-hero-photo-drop.tv-dropzone--active {
  border-color: var(--tv-brand-green, #00ac5c);
  background: rgba(0, 172, 92, 0.04);
}
.tv-hero-photo-hint { margin: 0; font-size: 0.78rem; }
.tv-hero-photo-foot { margin: 0; font-size: 0.75rem; }
.tv-hero-photo-status {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tv-hero-photo-status--pending {
  background: #fef3c7;
  color: #92400e;
}
.tv-hero-photo-status--rejected {
  background: #fee2e2;
  color: #991b1b;
}
.tv-hero-main { min-width: 0; overflow: hidden; }
.tv-hero-desc {
  margin: 0 0 14px;
  padding-left: calc(var(--tv-hero-label-w) + 14px);
  font-family: var(--tv-hero-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--tv-ink, #1c1917);
  max-width: 52rem;
}
@media (max-width: 860px) {
  .tv-hero-desc { padding-left: 0; }
}
.tv-hero-spec {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
}
.tv-hero-spec--cpn {
  margin-top: 2px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline-color, #e2e8f0);
}
.tv-hero-spec-row {
  display: grid;
  grid-template-columns: var(--tv-hero-label-w) minmax(0, 1fr);
  gap: 10px 14px;
  align-items: baseline;
  margin: 0;
}
.tv-hero-spec-label {
  margin: 0;
  padding-top: 0.12em;
  font-family: var(--tv-hero-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--tv-ink-muted, #475569);
}
label.tv-hero-spec-label { cursor: text; }
.tv-hero-spec-value {
  margin: 0;
  min-width: 0;
  font-family: var(--tv-hero-mono);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  color: var(--tv-ink, #0f172a);
  word-break: break-all;
}
.tv-hero-spec-value--code {
  font-size: 1rem;
  letter-spacing: 0.02em;
}
.tv-hero-spec-value--locked {
  padding: 2px 0;
}
.tv-hero-spec-value--unassigned {
  color: var(--tv-ink-muted, #475569);
  font-style: italic;
  font-weight: 500;
}
.tv-asm-code-link {
  text-decoration: none;
  color: inherit;
}
.tv-asm-code-link:hover .tv-asm-code {
  color: var(--tv-brand-navy, #1b337d);
}

/* Item breadcrumbs — History as a quiet trailing link. */
.tv-breadcrumbs--item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
}
.tv-breadcrumbs-meta {
  font-size: 0.875rem;
  font-weight: 400;
  white-space: nowrap;
}

/* Part type pills — inline beside hero part # (tv-home-ops-chip--*). */
.tv-hero-spec-row--part-code .tv-hero-spec-value--code {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.tv-hero-part-code-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tv-hero-part-tags.tv-home-ops-status-chips {
  margin-bottom: 0;
  gap: 4px;
}
.tv-hero-part-tags .tv-home-ops-chip {
  font-family: var(--tv-hero-sans);
  font-size: var(--tv-text-xs);
  font-weight: var(--tv-weight-semibold);
  letter-spacing: 0.01em;
  font-variant-numeric: normal;
  line-height: 1.3;
}

/* Copy part number — icon button beside hero part code. */
.tv-copy-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
  margin: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--body-quiet-color, #666);
  cursor: copy;
  vertical-align: middle;
}
.tv-copy-icon:hover,
.tv-copy-icon:focus-visible {
  color: var(--tv-brand-navy, #1b337d);
  background: var(--darkened-bg, #f3f4f6);
  outline: none;
}
.tv-item-hero-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 10px;
  padding: 8px 12px;
  border: 1px solid var(--hairline-color, #ddd);
  border-radius: 6px;
  background: var(--darkened-bg, #f8f9fa);
}
.tv-item-hero-nav__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--hairline-color, #ccc);
  border-radius: 4px;
  background: var(--body-bg, #fff);
  text-decoration: none;
  color: var(--body-fg, #222);
  font-size: 0.85rem;
  max-width: 42%;
}
.tv-item-hero-nav__btn:hover { border-color: var(--tv-brand-navy, #1b337d); }
.tv-item-hero-nav__btn--disabled {
  opacity: 0.35;
  border-style: dashed;
}
.tv-item-hero-nav__code {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tv-item-hero-nav__pos {
  font-size: 0.8rem;
  color: var(--body-quiet-color, #666);
  font-variant-numeric: tabular-nums;
}
.tv-item-thumb-link { display: inline-block; line-height: 0; }
.tv-item-thumb {
  width: 96px;
  height: 96px;
  object-fit: contain;
  background: #f0f0f0;
  border-radius: 6px;
  border: 1px solid var(--hairline-color, #ddd);
}
.tv-cpn-readonly {
  display: inline-block;
  max-width: 8.5rem;
  font-family: ui-monospace, monospace;
  font-size: 0.78rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
.tv-cpn-readonly--empty {
  color: var(--body-quiet-color, #999);
}
.tv-cpn-readonly--locked {
  color: var(--body-fg, #1e293b);
  font-weight: 600;
}
.tv-hero-cpn-note {
  margin: 0 0 4px;
  padding-left: calc(var(--tv-hero-label-w) + 14px);
  font-size: 0.72rem;
  font-style: italic;
}
@media (max-width: 860px) {
  .tv-hero-cpn-note { padding-left: 0; }
}
.tv-cpn-sticky-save {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 0;
  padding: 12px 20px;
  border-top: 2px solid var(--primary, #417690);
  background: var(--body-bg, #fff);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
}
.tv-cpn-sticky-save[hidden] {
  display: none;
}
.tv-cpn-sticky-save__text {
  margin: 0;
  font-size: 0.9rem;
}
.tv-customer-pn-changelist-save {
  margin-top: 12px;
}

/* Label-PN changelist: photo column prominent; PN columns compact read-only */
.tv-items-label-pn-mode.change-list #result_list .field-thumb {
  width: 6.5rem;
}
.tv-items-label-pn-mode.change-list #result_list .field-mfg_part_no_column,
.tv-items-label-pn-mode.change-list #result_list .field-used_in_link {
  font-size: 0.85rem;
}
.tv-items-label-pn-mode.change-list #result_list .field-steris_part_no,
.tv-items-label-pn-mode.change-list #result_list .field-logiquip_part_no,
.tv-items-label-pn-mode.change-list #result_list .field-vantage_part_no {
  max-width: 9rem;
  font-size: 0.8rem;
}

.tv-item-section { padding: 12px 14px; margin-bottom: 14px;
                   border: 1px solid var(--hairline-color, #ddd); border-radius: 6px;
                   background: var(--body-bg, #fff); }
.tv-item-section h2 { margin-top: 0; font-size: 1.1em; }
.tv-item-section--service { border-left: 3px solid var(--tv-badge-service-border, #bbb); }

details.edit-fields { margin-top: 20px; }
details.edit-fields > summary { cursor: pointer; padding: 8px 12px; background: var(--darkened-bg, #f5f5f5);
                                border-radius: 4px; font-weight: 600; }

.tv-table { width: 100%; border-collapse: collapse; }
.tv-table th, .tv-table td { padding: 6px 10px; text-align: left; vertical-align: middle;
                              border-bottom: 1px solid var(--hairline-color, #ddd); }
.tv-table th { background: var(--darkened-bg, #f5f5f5); }
.tv-table .tv-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tv-table .tv-line-cell { white-space: nowrap; }

.tv-where-used-header h1 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}
.tv-where-used-lede {
  margin: 0 0 12px;
}
.tv-where-used-table tr.tv-where-used-sheet-start td {
  border-top: 2px solid var(--hairline-color, #bbb);
}
.tv-where-used-table tbody tr:first-child td {
  border-top: none;
}
.tv-used-in-link {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Two-tile action launcher on the admin index */
.tv-launcher {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  max-width: 1080px;
  margin: 24px 0;
}

.tv-launcher-tile {
  padding: 24px;
  border: 1px solid var(--hairline-color, #ddd);
  border-left: 4px solid var(--tv-brand-green, #00ac5c);
  border-radius: 6px;
  background: var(--body-bg, #fff);
}

.tv-launcher-tile--urgent { border-left-color: #c08000; }

.tv-launcher-number {
  font-family: monospace;
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.tv-launcher-label {
  font-size: 0.9rem;
  color: var(--body-quiet-color, #666);
}

.tv-launcher-sub {
  font-size: 0.85rem;
  color: var(--body-quiet-color, #666);
  margin-top: 8px;
}

.tv-launcher-action { margin-top: 20px; }

@media (max-width: 600px) {
  .tv-launcher { grid-template-columns: 1fr; }
}

/* Command center home (/admin/) */
.tv-command-center-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.tv-command-center-card {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  border: 1px solid var(--tv-border, #d0d7de);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

.tv-command-center-card:hover {
  border-color: var(--primary, #417690);
}

.tv-command-center-card--urgent {
  border-color: var(--tv-urgent, #cf222e);
}

.tv-command-center-count {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.tv-command-center-label {
  font-size: 0.9rem;
  color: var(--body-quiet-color, #666);
  margin-top: 0.35rem;
}

.tv-command-center-cta {
  font-size: 0.85rem;
  margin-top: 0.75rem;
  color: var(--primary, #417690);
}

.tv-command-center-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

.tv-command-center-search input[type="search"] {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 24rem;
}

.tv-command-center-browse {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Item change — breadcrumbs + catalog assets */
/* Breadcrumbs: design-system.css */

.tv-asset-thumb img { max-height: 100px; display: block; border-radius: 2px; }

/* Item change — unified catalog assets (photos + datasheet) */
.tv-catalog-assets { margin: 1.25rem 0; }
.tv-catalog-assets > h2 { font-size: 1.1rem; margin-bottom: 0.75rem; }
.tv-asset-subsection { margin-bottom: 1rem; padding: 0.75rem 1rem;
                       border: 1px solid var(--hairline-color, #ddd); border-radius: 4px; }
.tv-asset-subsection-title { margin: 0 0 0.5rem; font-size: 0.9rem; text-transform: uppercase;
                             letter-spacing: 0.05em; color: var(--body-quiet-color, #666); }
.tv-asset-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.tv-asset-card { border: 1px solid var(--hairline-color, #ccc); border-radius: 4px;
                 padding: 0.5rem; max-width: 160px; }
.tv-asset-card img { max-height: 100px; display: block; border-radius: 2px; }
.tv-asset-card-label { margin: 0.35rem 0 0; font-size: 0.85em; display: flex; flex-wrap: wrap;
                       gap: 0.35rem; align-items: center; }
.tv-asset-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; align-items: center; }
.tv-asset-actions--inline { margin-top: 0; display: inline-flex; }
.tv-asset-actions button, .tv-asset-actions .tv-btn {
  font-size: 0.75rem; padding: 0.2rem 0.45rem; cursor: pointer;
  border: 1px solid var(--hairline-color, #ccc); border-radius: 3px;
  background: var(--body-bg, #fff);
}
.tv-btn-destructive { color: #b91c1c; border-color: #b91c1c; }
.tv-asset-reason { font-size: 0.75rem; padding: 0.15rem 0.35rem; max-width: 8rem; }
.tv-catalog-assets-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem;
                           align-items: center; }
.tv-catalog-assets-search { margin-top: 0.75rem; }
.tv-candidate-row { display: flex; align-items: center; gap: 0.75rem; margin: 0.5rem 0;
                    flex-wrap: wrap; padding: 0.35rem 0; border-bottom: 1px solid var(--hairline-color, #eee); }
.tv-candidate-row:last-of-type { border-bottom: none; }
.tv-candidate-title { flex: 1 1 12rem; min-width: 0; }
.tv-datasheet-approved { margin-bottom: 0.75rem; }
.tv-datasheet-approved-title { margin: 0 0 0.25rem; }
.tv-clear-pending { font-size: 0.85em; display: inline-flex; align-items: center; gap: 0.25rem; }
.tv-stale-candidates { margin-top: 0.5rem; font-size: 0.85em; color: var(--body-quiet-color, #666); }
.tv-catalog-assets--settled .tv-assets-summary { color: var(--tv-accent-green-text, #006b38); margin: 0.5rem 0; }
.tv-catalog-assets--settled .tv-assets-manage {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.35rem;
}
.tv-catalog-assets--settled .tv-asset-subsection--verbose { display: none; }

.tv-upload-results { margin: 1rem 0 1.25rem; padding: 0.75rem 1rem;
                     border: 1px solid var(--hairline-color, #ddd); border-radius: 4px;
                     background: var(--darkened-bg, #f8f8f8); }
.tv-upload-results h2 { margin: 0 0 0.5rem; font-size: 1rem; }
.tv-upload-results ul { margin: 0; padding-left: 1.25rem; }
.tv-upload-result--ok .tv-upload-result-status { color: var(--tv-accent-green-text, #006b38); font-weight: 600; }
.tv-upload-result--skip .tv-upload-result-status { color: #b03030; font-weight: 600; }
.tv-upload-form { margin-top: 1rem; max-width: 36rem; }

/* ── PDF pick-ticket upload ─────────────────────────────────────────────── */

.tv-ptu-form { max-width: 42rem; }

/* Error banner */
.tv-ptu-error {
  padding: 10px 14px; margin: 0 0 1.25rem;
  background: #fef2f2; border: 1px solid #fca5a5; border-radius: 4px;
  color: #b91c1c; font-weight: 500;
}

/* Drop zone shell */
.tv-dropzone {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 238px;
  border: 1.5px dashed var(--tv-border-upload, rgb(var(--tv-brand-navy-rgb) / 0.28));
  border-radius: var(--tv-radius-lg, 8px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.32)),
    var(--tv-surface-upload, rgb(var(--tv-brand-mint-rgb) / 0.18));
  cursor: pointer;
  text-align: center;
  padding: 2rem;
  user-select: none;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.tv-dropzone:focus-visible {
  box-shadow: 0 0 0 3px rgba(0, 172, 92, 0.25);
}

/* Corner brackets — drawn via pseudo-elements */
.tv-dropzone::before,
.tv-dropzone::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--hairline-color, #bbb);
  border-style: solid;
  transition: width 0.22s ease, height 0.22s ease, border-color 0.18s ease;
}
.tv-dropzone::before { top: 7px; left: 7px; border-width: 2px 0 0 2px; border-radius: 2px 0 0 0; }
.tv-dropzone::after  { bottom: 7px; right: 7px; border-width: 0 2px 2px 0; border-radius: 0 0 2px 0; }

/* Drag-over state */
.tv-dropzone--active {
  border-color: var(--tv-brand-green, #00ac5c);
  border-style: solid;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.42)),
    rgba(0, 172, 92, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.78),
    0 8px 22px rgba(0, 172, 92, 0.12);
  transform: translateY(-1px);
}
.tv-dropzone--active::before,
.tv-dropzone--active::after {
  border-color: var(--tv-brand-green, #00ac5c);
  width: 26px;
  height: 26px;
}

/* File selected state */
.tv-dropzone--has-file {
  border-style: solid;
  border-color: var(--tv-brand-green, #00ac5c);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.46)),
    rgba(0, 172, 92, 0.08);
}
.tv-dropzone--has-file::before,
.tv-dropzone--has-file::after {
  border-color: var(--tv-brand-green, #00ac5c);
  width: 26px;
  height: 26px;
}

/* Error state */
.tv-dropzone--error {
  border-color: #b03030;
  background: #fff8f8;
}
.tv-dropzone--error::before,
.tv-dropzone--error::after { border-color: #b03030; }

/* Hidden native input */
.tv-dropzone-input {
  position: absolute;
  width: 1px; height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Inner content areas */
.tv-dropzone-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 35rem;
}

/* Document icon */
.tv-dropzone-icon {
  width: 52px;
  height: 52px;
  color: var(--body-quiet-color, #999);
  margin-bottom: 10px;
  transition: color 0.18s ease, transform 0.22s ease;
}
.tv-dropzone--active .tv-dropzone-icon  { color: var(--tv-brand-green, #00ac5c); transform: scale(1.08); }
.tv-dropzone--has-file .tv-dropzone-icon { color: var(--tv-brand-green, #00ac5c); }
.tv-dropzone-icon--sm { width: 36px; height: 36px; }

/* Labels */
.tv-dropzone-label {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 2px;
  color: var(--tv-brand-navy, #1b337d);
}
.tv-dropzone-filename {
  font-family: monospace;
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 2px;
  color: var(--tv-brand-green, #00ac5c);
  word-break: break-all;
  max-width: 32rem;
}
.tv-ptu-clear { margin-top: 10px; font-size: 0.85em; cursor: pointer; }

/* Command-center inline upload — same dropzone language, shorter shell */
.tv-dropzone--compact {
  min-height: 0;
  justify-content: flex-start;
  padding: 14px 16px;
  text-align: left;
  border-radius: var(--tv-radius-md, 6px);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.38)),
    var(--tv-surface-upload, rgb(var(--tv-brand-mint-rgb) / 0.18));
}
.tv-dropzone--compact .tv-dropzone-body {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  text-align: left;
  max-width: none;
}
.tv-dropzone--compact::before,
.tv-dropzone--compact::after {
  display: none;
}

/* Form actions row */
.tv-ptu-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 1rem;
}
.tv-ptu-note { margin-top: 1rem; max-width: 38rem; }

/* Processing overlay */
.tv-ptu-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tv-ptu-overlay[hidden] { display: none; }

.tv-ptu-overlay-card {
  text-align: center;
  max-width: 22rem;
  padding: 2rem;
  border: 1px solid var(--hairline-color, #ddd);
  border-radius: 8px;
  background: var(--body-bg, #fff);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.10);
}

.tv-ptu-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--hairline-color, #ddd);
  border-top-color: var(--tv-brand-green, #00ac5c);
  border-radius: 50%;
  animation: tv-ptu-spin 0.75s linear infinite;
  margin: 0 auto 1.25rem;
}
@keyframes tv-ptu-spin { to { transform: rotate(360deg); } }

.tv-ptu-overlay-heading {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0 0 6px;
}

.tv-nav-badge {
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  font-size: 0.75rem;
  border-radius: 999px;
  background: var(--tv-urgent, #cf222e);
  color: #fff;
}

/* ── Catalog browser page chrome ─────────────────────────────────────── */
.tv-catalog-page { display: flex; flex-direction: column; gap: 0; }


.tv-catalog-hint {
  margin: 0 0 14px;
  font-size: 0.88em;
  color: var(--body-quiet-color, #666);
}

.tv-catalog-active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.tv-catalog-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px 8px;
  padding: 5px 10px 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--hairline-color, #d0d5e0);
  background: var(--body-bg, #fff);
  font-size: 0.88em;
}

.tv-catalog-filter-chip-label {
  font-weight: 600;
  color: var(--body-quiet-color, #666);
}

.tv-catalog-filter-chip code {
  font-size: 0.95em;
}

.tv-catalog-filter-chip-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-left: 2px;
  border-radius: 50%;
  color: var(--body-quiet-color, #666);
  text-decoration: none;
  font-size: 1.1em;
  line-height: 1;
}

.tv-catalog-filter-chip-clear:hover {
  background: var(--darkened-bg, #eee);
  color: var(--body-fg, #333);
}

.tv-catalog-layout {
  margin-top: 2px;
}

.tv-catalog-families {
  padding: 12px 10px;
  border: 1px solid var(--hairline-color, #d8dce6);
  border-radius: 8px;
  background: var(--body-bg, #fff);
}

.tv-catalog-families .tv-fsb-heading {
  margin-bottom: 4px;
}

.tv-catalog-families .tv-fsb-brand-label {
  margin-top: 10px;
}

.tv-catalog-families .tv-fsb-brand-label:first-of-type {
  margin-top: 0;
}

.tv-catalog-assemblies {
  min-width: 0;
}

@media (max-width: 900px) {
  .tv-command-center-search input[type="search"] { max-width: none; }
}

/* ── Family sidebar nav ───────────────────────────────────────────────── */
.tv-family-sidebar { font-size: 0.9em; }
.tv-fsb-heading {
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--body-quiet-color, #666);
  padding: 0 8px 10px;
}
.tv-fsb-brand-label {
  display: block;
  padding: 6px 8px;
  font-weight: 700;
  color: var(--body-fg, #333);
  text-decoration: none;
  border-radius: 4px;
  margin-bottom: 2px;
}
.tv-fsb-brand-label:hover,
.tv-fsb-sub:hover,
.tv-fsb-item:hover { background: var(--darkened-bg, #f5f5f5); }
.tv-fsb-sub {
  display: block;
  padding: 5px 8px 5px 18px;
  color: var(--body-quiet-color, #666);
  text-decoration: none;
  border-radius: 4px;
  margin-bottom: 2px;
  font-size: 0.95em;
  line-height: 1.35;
}
.tv-fsb-sub.tv-fsb-active,
.tv-fsb-brand-label.tv-fsb-active {
  background: #e8f0fe;
  color: #1a73e8;
  font-weight: 600;
}
.tv-fsb-divider { border: none; border-top: 1px solid var(--hairline-color, #ddd); margin: 12px 0 10px; }
.tv-fsb-item {
  display: block;
  padding: 6px 8px;
  color: var(--body-quiet-color, #666);
  text-decoration: none;
  border-radius: 4px;
  margin-bottom: 1px;
}
.tv-fsb-item.tv-fsb-active {
  background: rgb(var(--tv-brand-mint-rgb) / 0.45);
  color: var(--tv-brand-navy, #1b337d);
  font-weight: 600;
}
.tv-fsb-item--obsolete { opacity: 0.65; font-style: italic; }

/* ── Obsolete assembly rows ───────────────────────────────────────────── */
.tv-asm-obsolete { opacity: 0.55; }
.tv-asm-obsolete .tv-asm-summary { font-style: italic; }
.tv-badge-obsolete {
  display: inline-block;
  font-size: 0.8em;
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid var(--hairline-color, #ddd);
  background: var(--darkened-bg, #f5f5f5);
  color: var(--body-quiet-color, #888);
  font-weight: 400;
  font-style: normal;
}
.tv-badge-service, .tv-service-label {
  display: inline-block;
  font-size: 0.8em;
  padding: 1px 7px;
  border-radius: 10px;
  border: 1px solid var(--hairline-color, #ddd);
  background: var(--darkened-bg, #f5f5f5);
  color: var(--body-quiet-color, #888);
  font-weight: 400;
  font-style: normal;
}

/* ── Admin home operations panel ─────────────────────────────────────── */
.tv-home-ops { max-width: var(--tv-workspace-max); margin: 0 auto; }


.tv-home-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--tv-space-4);
  align-items: start;
}

@media (max-width: 900px) {
  .tv-home-lanes {
    grid-template-columns: 1fr;
  }
}

.tv-hub-lane-list {
  max-height: min(55vh, 560px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--tv-border) transparent;
}

.tv-hub-lane-list::-webkit-scrollbar {
  width: 4px;
}

.tv-hub-lane-list::-webkit-scrollbar-track {
  background: transparent;
}

.tv-hub-lane-list::-webkit-scrollbar-thumb {
  background: var(--tv-border);
  border-radius: 2px;
}

.tv-home-lane-cards {
  display: grid;
  gap: var(--tv-space-3);
}

.tv-home-lane-empty {
  margin: 0;
  padding: 10px 8px;
  border: 1px dashed var(--hairline-color, #ddd);
  border-radius: 6px;
  color: var(--body-quiet-color, #666);
  font-size: 0.88em;
}

.tv-home-ops-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.tv-home-ops-card-link:hover .tv-home-ops-po {
  text-decoration: underline;
}

.tv-home-ops-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.tv-home-ops-card-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.tv-home-ops-customer {
  margin: 0;
  font-size: var(--tv-text-sm);
  color: var(--tv-ink-muted);
}

.tv-home-ops-status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.tv-home-ops-chip--pending { color: #7c2d12; background: #ffedd5; border-color: #fdba74; }
.tv-home-ops-chip--ready { color: #166534; background: #dcfce7; border-color: #86efac; }
.tv-home-ops-chip--open { color: #1d4ed8; background: #dbeafe; border-color: #93c5fd; }
.tv-home-ops-chip--complete { color: #166534; background: #dcfce7; border-color: #86efac; }
.tv-home-ops-chip--held { color: #9a3412; background: #ffedd5; border-color: #fdba74; }

.tv-home-ops-progress,
.tv-home-ops-meta {
  margin: 0.25rem 0 0;
  font-size: var(--tv-text-sm);
  color: var(--tv-ink-muted);
}

.tv-home-ops-edits {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.tv-home-ops-edit-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8em;
  text-decoration: none;
  color: var(--body-quiet-color, #444);
}

.tv-home-ops-edit-link:hover {
  color: var(--tv-brand-navy, #1b337d);
}

.tv-home-board {
  border: 1px solid var(--hairline-color, #ddd);
  border-radius: 8px;
  background: var(--body-bg, #fff);
  padding: 16px 18px;
}

.tv-home-board-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.tv-home-board-title { margin: 0; font-size: 1.1rem; }

.tv-home-board-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tv-home-pending-badge {
  font-weight: 600;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--hairline-color, #ccc);
  background: var(--darkened-bg, #f5f5f5);
}

.tv-home-live {
  color: var(--tv-brand-green, #00ac5c);
  font-size: 1.1em;
  line-height: 1;
  animation: tv-home-live-pulse 2s ease-in-out infinite;
}

@keyframes tv-home-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.tv-home-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.tv-home-board-card {
  border: 1px solid var(--hairline-color, #ddd);
  border-radius: 6px;
  padding: 0;
  background: var(--body-bg, #fff);
}

.tv-home-board-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: inherit;
  padding: 16px;
}

.tv-home-board-card-link:hover,
.tv-home-board-card-link:focus-visible {
  outline: 2px solid var(--tv-accent, #2563eb);
  outline-offset: 2px;
}

.tv-home-board-card--released {
  border-color: #a8dab5;
  background: #f8fcf9;
}

.tv-home-board-card-head {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  min-width: 0;
}

.tv-home-board-po {
  position: relative;
  z-index: 1;
  font-family: ui-monospace, monospace;
  font-weight: 700;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.tv-home-badge {
  font-size: 0.75em;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.tv-home-badge--progress {
  color: #1a5fb4;
  background: #e8f0fe;
  border: 1px solid #c2d7f7;
}

.tv-home-badge--released {
  color: #0d652d;
  background: #e6f4ea;
  border: 1px solid #a8dab5;
}

.tv-home-badge--hold {
  color: var(--tv-warn, #b45309);
  background: #fff8e1;
  border: 1px solid #fcd34d;
}

.tv-home-badge--done {
  color: #0d652d;
  background: #e6f4ea;
  border: 1px solid #a8dab5;
}

.tv-home-board-line {
  margin: 0 0 8px;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tv-home-progress {
  height: 8px;
  border-radius: 3px;
  background: var(--darkened-bg, #eee);
  overflow: hidden;
  margin-bottom: 6px;
}

.tv-home-progress--empty {
  background: transparent;
  border: 1px dashed var(--hairline-color, #ddd);
}

.tv-home-progress-bar {
  height: 100%;
  background: var(--tv-brand-green, #00ac5c);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.tv-home-board-sub { margin: 0; font-size: 0.82em; }

.tv-home-board-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 12px;
  text-align: center;
  color: var(--body-quiet-color, #888);
}

.tv-home-board-empty p { margin: 0; }

.tv-home-board-empty-icon {
  width: 40px;
  height: 40px;
  opacity: 0.45;
  margin-bottom: 4px;
}

.tv-home-board-footer { margin-top: 14px; }

.tv-home-review {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
}

.tv-home-review-title { margin: 0 0 4px; font-size: 1.05rem; }

.tv-home-review-field { margin-bottom: 8px; }

.tv-home-review-label {
  display: block;
  font-weight: 600;
  font-size: 0.85em;
  margin-bottom: 4px;
}

.tv-home-review-value { margin: 0; }

.tv-home-review-hint {
  margin: 0 0 4px;
  font-size: 0.82em;
  color: var(--body-quiet-color, #666);
}

.tv-home-review-field--ok .tv-home-review-value {
  color: #0d652d;
  font-weight: 600;
}

.tv-home-review-field--ok .tv-home-review-label::after {
  content: " ✓";
  color: #0d652d;
  font-weight: 700;
}

.tv-home-review-field--missing .tv-home-review-hint { color: #b03030; }
.tv-home-review-field--low .tv-home-review-hint { color: #c45c00; }

.tv-home-review-field--missing .tv-home-review-label::after {
  content: " ✗";
  color: #b03030;
  font-weight: 700;
}

.tv-home-review-field--low .tv-home-review-label::after {
  content: " ⚠";
  color: #c45c00;
  font-weight: 700;
}

.tv-home-review-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.tv-home-review-input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid var(--hairline-color, #ccc);
  border-radius: 4px;
}

.tv-home-review-actions { margin-top: 8px; }

.tv-home-review-discard { margin-top: 4px; }

.tv-home-review-discard-btn {
  font-size: 0.88em;
  color: var(--body-quiet-color, #666);
}

.tv-home-review-blockers {
  margin: 0.75rem 0;
  padding-left: 1.25rem;
  color: var(--tv-warn, #b45309);
}

.tv-home-review-blockers li {
  margin: 0.25rem 0;
}

/* ── Board card urgency / state modifiers ────────────────────────────── */
.tv-home-board-card--urgent {
  border-left: 4px solid var(--tv-urgent);
}

.tv-home-board-card--in-progress {
  border-left: 4px solid var(--tv-in-progress);
}

.tv-home-board-ship-date {
  margin-left: auto;
  font-size: 0.78rem;
  white-space: nowrap;
}

.tv-home-board-ship-date--urgent {
  color: var(--tv-urgent);
  font-weight: 600;
}

/* ── Completed tickets section ───────────────────────────────────────── */
.tv-home-completed-section {
  margin-top: 24px;
  padding-top: 8px;
  border-top: 1px solid var(--hairline-color, #eee);
}

.tv-home-completed-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tv-home-completed-row {
  display: flex;
  gap: 12px;
  padding: 6px 2px;
  border-bottom: 1px solid var(--hairline-color, #eee);
  font-size: 0.88em;
  color: var(--body-quiet-color, #666);
}

.tv-home-completed-po {
  font-weight: 600;
  color: var(--body-fg, #333);
}

/* ── All tickets retrieval ─────────────────────────────────────── */
.tv-all-tickets { max-width: var(--tv-workspace-max); }

.tv-all-tickets-search-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.tv-all-tickets-search-bar .tv-search-input { min-width: min(100%, 22rem); }

.tv-all-tickets-summary {
  margin: 0 0 10px;
  color: var(--body-quiet-color, #666);
  font-size: 0.92em;
}

.tv-all-tickets-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hairline-color, #e5e5e5);
  border-radius: 8px;
}

.tv-all-tickets-table td { vertical-align: top; }

.tv-all-tickets-table .tv-table-sort {
  color: inherit;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tv-all-tickets-table .tv-table-sort:hover {
  color: var(--tv-brand-navy, #1b337d);
}
.tv-all-tickets-table .tv-table-sort::after {
  content: "↕";
  font-size: 0.72em;
  font-weight: 400;
  opacity: 0.35;
}
.tv-all-tickets-table .tv-table-sort--active::after {
  opacity: 1;
}
.tv-all-tickets-table .tv-table-sort--asc::after { content: "↑"; }
.tv-all-tickets-table .tv-table-sort--desc::after { content: "↓"; }

.tv-all-tickets-ship-date {
  display: block;
  margin-top: 4px;
  font-size: 0.82em;
  color: var(--body-quiet-color, #666);
}

.tv-all-tickets-empty {
  margin: 0;
  padding: 24px 12px;
  text-align: center;
  color: var(--body-quiet-color, #666);
}

.tv-all-tickets-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  font-size: 0.92em;
}

.tv-all-tickets-page-label { color: var(--body-quiet-color, #666); }

.tv-all-tickets-customer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.tv-all-tickets-customer-name { min-width: 0; }

/* Ticket proof view (P2-2) */
.tv-ticket-proof { max-width: var(--tv-workspace-max); }

.tv-proof-section {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--hairline-color, #e5e5e5);
}

.tv-proof-section:last-child { border-bottom: 0; }

.tv-proof-section-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 600;
}

.tv-proof-meta,
.tv-proof-empty {
  margin: 0 0 10px;
  color: var(--body-quiet-color, #666);
}

.tv-proof-scan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.tv-proof-scan-card {
  border: 1px solid var(--hairline-color, #e5e5e5);
  border-radius: 8px;
  padding: 10px;
  background: var(--body-bg, #fff);
}

.tv-proof-scan-image {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  margin-bottom: 8px;
}

.tv-proof-line-photo {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
}

.tv-proof-scan-meta {
  margin: 0;
  font-size: 0.88em;
}

.tv-proof-scan-meta div {
  display: grid;
  grid-template-columns: 7rem 1fr;
  gap: 6px;
  margin-bottom: 4px;
}

.tv-proof-scan-meta dt {
  margin: 0;
  color: var(--body-quiet-color, #666);
  font-weight: 500;
}

.tv-proof-scan-meta dd { margin: 0; }

.tv-proof-scan-ocr pre {
  margin: 8px 0 0;
  padding: 8px;
  font-size: 0.78em;
  overflow-x: auto;
  background: var(--darkened-bg, #f6f6f6);
  border-radius: 4px;
}

.tv-proof-header-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px 18px;
  margin: 0 0 12px;
}

.tv-proof-header-grid div {
  display: grid;
  gap: 2px;
}

.tv-proof-header-grid dt {
  margin: 0;
  font-size: 0.82em;
  color: var(--body-quiet-color, #666);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tv-proof-header-grid dd { margin: 0; font-weight: 500; }

.tv-proof-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hairline-color, #e5e5e5);
  border-radius: 8px;
}

.tv-proof-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

.tv-proof-table th,
.tv-proof-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--hairline-color, #e5e5e5);
  vertical-align: top;
}

.tv-proof-table thead th {
  background: var(--darkened-bg, #f6f6f6);
  font-weight: 600;
}

.tv-proof-table tbody tr:last-child td { border-bottom: 0; }

.tv-home-ops-review {
  margin: 8px 0 0;
  font-size: 0.88em;
}

.tv-home-ops-review a { font-weight: 600; }

.tv-home-ops-proof {
  margin: 8px 0 0;
  font-size: 0.88em;
}

.tv-home-ops-proof a { font-weight: 600; }

/* ── Home-tile dropzone: suppress the corner-bracket pseudo-elements ────── */
/* The standalone .tv-dropzone draws corner brackets via ::before/::after.   */
/* Inside the home tile the dashed card border already frames the area.      */
.tv-home-dropzone::before,
.tv-home-dropzone::after {
  display: none;
}

/* ── Urgency left-border on Intake / Ready cards ──────────────────────────── */
/* Mirror the same classes the live-floor JS applies, now driven by the       */
/* shipping_badge template variable on Django-rendered ops cards.             */
.tv-home-ops-card.tv-home-board-card--urgent {
  border-left: 4px solid var(--tv-urgent, #dc2626);
}

.tv-home-ops-card.tv-home-board-card--in-progress {
  border-left: 4px solid var(--tv-in-progress, #d97706);
}

/* ── Command center upload strip (uses .tv-dropzone--compact) ─────────── */
.tv-home-upload-strip {
  margin-bottom: var(--tv-space-5, 20px);
}

.tv-home-upload-strip .tv-dropzone {
  min-height: 74px;
  border-style: solid;
}

.tv-home-upload-strip .tv-dropzone-icon {
  color: var(--tv-brand-navy, #1b337d);
  margin-bottom: 0;
}

.tv-home-upload-strip .tv-dropzone-label {
  display: block;
  margin: 0;
}

.tv-upload-idle-hint {
  display: block;
  margin-top: 3px;
}
.tv-upload-queue {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tv-space-2, 6px);
  margin-top: var(--tv-space-2, 8px);
  min-height: 0;
}
.tv-upload-queue-item {
  background: var(--tv-surface-raised, #fff);
  border: 1px solid var(--tv-upcoming-border);
  border-radius: var(--tv-radius-md, 6px);
  padding: 4px 10px;
  font-size: 0.75em;
  color: var(--tv-brand-navy, #1b337d);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tv-upload-queue-item--done {
  color: var(--tv-success);
  border-color: var(--tv-success-border);
}
.tv-upload-queue-item--error {
  color: var(--tv-urgent);
  border-color: var(--tv-urgent-border);
}
.tv-upload-spinner {
  width: 10px;
  height: 10px;
  border: 2px solid var(--tv-upcoming-border);
  border-top-color: var(--tv-brand-green, #00ac5c);
  border-radius: 50%;
  display: inline-block;
  animation: tv-spin 0.8s linear infinite;
}
@keyframes tv-spin { to { transform: rotate(360deg); } }

.tv-home-lane--pending { border-top: 3px solid var(--tv-brand-navy, #1b337d); }
.tv-home-lane--processing { border-top: 3px solid var(--tv-in-progress); }
.tv-home-lane--done {
  border-top: 3px solid var(--tv-brand-green, #00ac5c);
}
.tv-home-lane--done .tv-home-lane-title {
  color: var(--tv-success);
}
.tv-home-ops-card--done {
  opacity: 0.8;
}

/* ── Pending card — blocked state ─────────────────────────────────────── */
.tv-home-ops-card--blocked {
  opacity: 0.6;
}
.tv-home-ops-meta--blocked {
  color: var(--tv-urgent);
  font-size: 0.78em;
}
.tv-home-ops-fix-link {
  color: var(--tv-urgent);
  font-weight: 600;
  font-size: 0.78em;
  text-decoration: none;
}
.tv-home-ops-fix-link:hover {
  text-decoration: underline;
}
.tv-home-ops-review-link {
  color: var(--tv-brand-navy, #1b337d);
  font-weight: 600;
  font-size: 0.78em;
  text-decoration: none;
}
.tv-home-ops-review-link:hover {
  text-decoration: underline;
}

/* ── Review page ──────────────────────────────────────────────────────── */
.tv-review-page {
  max-width: var(--tv-workspace-narrow);
}
.tv-review-breadcrumb {
  font-size: 0.78em;
  color: var(--tv-ink-muted, #475569);
  margin-bottom: var(--tv-space-4, 16px);
}
.tv-review-breadcrumb a {
  color: var(--tv-brand-navy, #1b337d);
  font-weight: 600;
  text-decoration: none;
}
.tv-review-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 18px;
  align-items: start;
}
@media (max-width: 680px) {
  .tv-review-grid {
    grid-template-columns: 1fr;
  }
}
/* Review panels use .tv-panel from design-system */
.tv-review-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}
.tv-review-field-label {
  font-size: 0.72em;
  font-weight: 700;
  color: var(--tv-ink-muted, #475569);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.tv-review-field-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--tv-ink, #1c1917);
}
.tv-review-field-value--empty {
  color: var(--tv-ink-faint, #5c6570);
}
.tv-review-conf {
  font-size: 0.7em;
  font-weight: 600;
}
.tv-review-conf--ok   { color: var(--tv-success); }
.tv-review-conf--low  { color: var(--tv-in-progress); }
.tv-review-conf--missing { color: var(--tv-urgent); }
.tv-review-edit-link {
  font-size: 0.75em;
  color: var(--tv-brand-navy, #1b337d);
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  margin-top: 8px;
}
.tv-review-blockers {
  background: var(--tv-urgent-bg);
  border: 1px solid var(--tv-urgent-border);
  border-radius: var(--tv-radius-md, 6px);
  padding: 8px 10px;
  margin: 10px 0;
}
.tv-review-blockers-title {
  font-size: 0.75em;
  color: var(--tv-urgent);
  margin: 0 0 4px;
  font-weight: 600;
}
.tv-review-blockers ul {
  margin: 0;
  padding-left: 16px;
}
.tv-review-blockers li {
  font-size: 0.73em;
  color: var(--tv-urgent);
}
.tv-review-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}
.tv-review-btn-release {
  width: 100%;
  text-align: center;
}
.tv-review-btn-release[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}
.tv-review-btn-discard {
  width: 100%;
  text-align: center;
  background: var(--tv-urgent-bg);
  color: var(--tv-urgent);
  border: 1px solid var(--tv-urgent-border);
  border-radius: var(--tv-radius-md, 7px);
  padding: 9px 14px;
  font-size: 0.82em;
  font-weight: 700;
  cursor: pointer;
}
.tv-review-lines-count {
  font-weight: 400;
  color: var(--tv-ink-muted, #475569);
}
.tv-review-lines-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 6px;
}
.tv-review-lines-table th {
  font-size: 0.72em;
  font-weight: 700;
  color: var(--tv-ink-muted, #475569);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 8px;
  text-align: left;
  border-bottom: 2px solid var(--hairline-color, #e2e8f0);
}
.tv-review-lines-table td {
  font-size: 0.82em;
  padding: 8px;
  border-bottom: 1px solid var(--hairline-color, #f1f5f9);
  color: var(--tv-ink, #1c1917);
  vertical-align: middle;
}
.tv-review-lines-table tr:last-child td {
  border-bottom: none;
}
.tv-review-line-held td {
  background: var(--tv-in-progress-bg);
}
.tv-review-part-code {
  font-family: monospace;
  font-size: 0.9em;
  font-weight: 700;
}
.tv-review-line-desc {
  color: var(--tv-ink-muted, #475569);
  font-size: 0.95em;
}
.tv-review-line-warn {
  color: var(--tv-in-progress);
  font-size: 0.95em;
}
.tv-review-line-status {
  display: inline-block;
  font-size: 0.7em;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}
.tv-review-line-status--processing { background: #fef3c7; color: #92400e; }
.tv-review-line-status--printed    { background: #dbeafe; color: #1d4ed8; }
.tv-review-line-status--packed     { background: #dcfce7; color: #166534; }
.tv-review-line-status--held_for_catalog { background: #ffedd5; color: #9a3412; }
.tv-review-lines-empty {
  color: #64748b;
  font-size: 0.85em;
  margin-top: 8px;
}

.tv-upload-toast {
  background: var(--tv-success-bg);
  border: 1px solid var(--tv-success-border);
  border-radius: var(--tv-radius-md);
  padding: 5px 8px;
}

.tv-upload-toast a {
  color: var(--tv-success);
  font-weight: var(--tv-weight-bold);
  text-decoration: none;
}

/* ── Unified ticket workspace (tv-ws-*) ───────────────────────────────── */
.tv-ws {
  max-width: var(--tv-workspace-max);
}

.tv-ws-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
}

.tv-ws-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82em;
  font-weight: 600;
  color: var(--tv-ink-muted, #475569);
}

.tv-ws-step-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hairline-color, #cbd5e1);
  flex-shrink: 0;
}

.tv-ws-step--passed { color: var(--tv-success, #166534); }
.tv-ws-step--passed .tv-ws-step-dot { background: var(--tv-success, #166534); }
.tv-ws-step--active { color: var(--tv-brand-navy, #1b337d); }
.tv-ws-step--active .tv-ws-step-dot { background: var(--tv-brand-navy, #1b337d); }

/* Split Layout Grid */
.tv-ws-grid {
  display: block;
}

@media (min-width: 1024px) {
  .tv-ws-grid {
    display: grid;
    grid-template-columns: 4fr 6fr;
    gap: var(--tv-space-6, 24px);
    align-items: start;
  }
  .tv-ws-grid--no-pdf {
    grid-template-columns: 1fr;
  }
}

/* Left Column - Sticky PDF Viewer */
.tv-ws-col-pdf {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 8px;
}

/* Subtle Webkit scrollbar for sticky panel */
.tv-ws-col-pdf::-webkit-scrollbar {
  width: 6px;
}
.tv-ws-col-pdf::-webkit-scrollbar-track {
  background: var(--darkened-bg, #f7f9fc);
}
.tv-ws-col-pdf::-webkit-scrollbar-thumb {
  background: var(--hairline-color, #cbd5e1);
  border-radius: 3px;
}

/* Redefined PDF Capture display rules */
.tv-ws-source {
  margin-bottom: 0;
}

.tv-ws-source-label {
  display: block;
  font-size: 0.72em;
  font-weight: 700;
  color: var(--tv-ink-muted, #475569);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.tv-ws-source-link {
  display: block;
  margin-bottom: 16px;
}

.tv-ws-source-link:last-child {
  margin-bottom: 0;
}

.tv-ws-source-link img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  border: 1px solid var(--hairline-color, #cbd5e1);
  border-radius: var(--tv-radius-md, 6px);
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.tv-ws-banner {
  padding: 10px 14px;
  border-radius: var(--tv-radius-md, 6px);
  font-size: 0.88em;
  margin-bottom: 16px;
}

.tv-ws-banner--open {
  background: var(--tv-in-progress-bg, #eff6ff);
  border: 1px solid var(--tv-in-progress-border, #bfdbfe);
  color: var(--tv-brand-navy, #1b337d);
}

.tv-ws-banner--done {
  background: var(--tv-success-bg, #dcfce7);
  border: 1px solid var(--tv-success-border, #86efac);
  color: var(--tv-success, #166534);
}

.tv-ws-card {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--hairline-color, #e5e5e5);
}

.tv-ws-card:last-child { border-bottom: 0; }

.tv-ws-card-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 600;
}

.tv-ws-meta,
.tv-ws-empty {
  margin: 0 0 10px;
  color: var(--body-quiet-color, #666);
}

.tv-ws-header-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px 18px;
  margin: 0 0 12px;
}

.tv-ws-header-grid div {
  display: grid;
  gap: 2px;
}

.tv-ws-header-grid dt {
  margin: 0;
  font-size: 0.82em;
  color: var(--body-quiet-color, #666);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tv-ws-header-grid dd { margin: 0; font-weight: 500; }

.tv-ws-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--hairline-color, #e5e5e5);
  border-radius: 8px;
}

.tv-ws-table,
.tv-ws-lines-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

.tv-ws-table th,
.tv-ws-table td,
.tv-ws-lines-table th,
.tv-ws-lines-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--hairline-color, #e5e5e5);
  vertical-align: middle;
}

.tv-ws-table thead th,
.tv-ws-lines-table thead th {
  background: var(--darkened-bg, #f6f6f6);
  font-weight: 600;
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tv-ink-muted, #475569);
}

.tv-ws-table tbody tr:last-child td,
.tv-ws-lines-table tbody tr:last-child td { border-bottom: 0; }

.tv-ws-line-photo {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
}

.tv-ws-line-held td {
  background: var(--tv-in-progress-bg, #fff7ed);
}

.tv-ws-warn {
  color: var(--tv-in-progress, #92400e);
  font-size: 0.95em;
}

.tv-ws-status {
  display: inline-block;
  font-size: 0.7em;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 700;
}

.tv-ws-status--processing { background: #fef3c7; color: #92400e; }
.tv-ws-status--printed    { background: #dbeafe; color: #1d4ed8; }
.tv-ws-status--packed     { background: #dcfce7; color: #166534; }
.tv-ws-status--held_for_catalog { background: #ffedd5; color: #9a3412; }

.tv-ws-blockers {
  background: var(--tv-urgent-bg);
  border: 1px solid var(--tv-urgent-border);
  border-radius: var(--tv-radius-md, 6px);
  padding: 8px 10px;
  margin: 10px 0;
}

.tv-ws-blockers-title {
  font-size: 0.75em;
  color: var(--tv-urgent);
  margin: 0 0 4px;
  font-weight: 600;
}

.tv-ws-blockers ul {
  margin: 0;
  padding-left: 16px;
}

.tv-ws-blockers li {
  font-size: 0.73em;
  color: var(--tv-urgent);
}

.tv-ws-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tv-ws-error {
  color: var(--tv-urgent);
  font-size: 0.78em;
  margin-top: 4px;
}

@media (max-width: 767px) {
  .tv-catalog-families.tv-family-sidebar {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: var(--body-bg, #fff);
    margin-bottom: 12px;
    border: 1px solid var(--hairline-color, #d8dce6);
  }
  .tv-catalog-families.tv-family-sidebar .tv-fsb-heading,
  .tv-catalog-families.tv-family-sidebar .tv-fsb-divider {
    display: none !important;
  }
  .tv-catalog-families.tv-family-sidebar .tv-fsb-brand-label,
  .tv-catalog-families.tv-family-sidebar .tv-fsb-sub,
  .tv-catalog-families.tv-family-sidebar .tv-fsb-item {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    margin: 0;
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
    border: 1px solid var(--hairline-color, #d8dce6);
    border-radius: var(--tv-radius-pill, 999px);
    background: var(--body-bg, #fff);
  }
  .tv-catalog-families.tv-family-sidebar .tv-fsb-brand-label.tv-fsb-active,
  .tv-catalog-families.tv-family-sidebar .tv-fsb-sub.tv-fsb-active,
  .tv-catalog-families.tv-family-sidebar .tv-fsb-item.tv-fsb-active {
    background: #e8f0fe;
    color: #1a73e8;
    border-color: #1a73e8;
  }

  .tv-hero-spec-row {
    grid-template-columns: 1fr !important;
    gap: 4px !important;
    margin-bottom: 8px;
  }
  .tv-hero-photo {
    max-width: 100% !important;
  }
}

@media (max-width: 1023px) {
  .tv-ws-col-pdf {
    position: static !important;
    max-height: none !important;
    overflow-y: visible !important;
    padding-right: 0 !important;
    margin-bottom: 24px;
  }
}

/* ── Dispatched! Copilot chat (shared hub + standalone) ─────────────────── */
.tv-copilot-announcer {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tv-copilot-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--tv-space-3, 12px);
  margin-bottom: var(--tv-space-3, 12px);
}

.tv-copilot-page-header .tv-card__title {
  margin-bottom: 0;
}

.tv-copilot-clear-btn--standalone {
  background: var(--tv-surface-raised, #fff);
  border: 1px solid var(--tv-border, #d8dce6);
  color: var(--tv-brand-navy);
  font-size: 0.82rem;
  font-weight: var(--tv-weight-semibold, 600);
  padding: 6px 12px;
  border-radius: var(--tv-radius-sm, 4px);
  cursor: pointer;
}

.tv-copilot-clear-btn--standalone:hover {
  background: var(--tv-surface-muted, #f4f8f7);
  border-color: var(--tv-brand-navy);
}

.tv-chat-container {
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid var(--tv-border, #d8dce6);
  border-radius: var(--tv-radius-lg, 8px);
  background: var(--tv-surface-raised, #fff);
  height: 600px;
  max-height: 70vh;
  overflow: hidden;
}

.tv-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: var(--tv-space-4, 16px);
  display: flex;
  flex-direction: column;
  gap: var(--tv-space-3, 12px);
  background: var(--tv-surface-panel, #f7f9fc);
}

.tv-chat-container .tv-chat-bubble {
  max-width: 75%;
}

.tv-chat-bubble {
  max-width: 85%;
  padding: var(--tv-space-2, 8px) var(--tv-space-3, 12px);
  border-radius: var(--tv-radius-md, 6px);
  line-height: var(--tv-leading-normal, 1.5);
  font-size: var(--tv-text-base, 1rem);
}

.tv-chat-bubble--user {
  align-self: flex-end;
  background: var(--tv-brand-navy);
  color: var(--tv-on-primary, #fff);
}

.tv-chat-bubble--assistant {
  align-self: flex-start;
  background: var(--tv-surface-raised, #fff);
  color: var(--tv-ink);
  border: 1px solid var(--tv-border, #d8dce6);
}

.tv-chat-form {
  display: flex;
  padding: var(--tv-space-3, 12px);
  gap: var(--tv-space-2, 8px);
  background: var(--tv-surface-raised, #fff);
  border-top: 1px solid var(--tv-border, #d8dce6);
  align-items: flex-end;
}

.tv-chat-input {
  flex: 1;
  min-height: 2.25rem;
  padding: var(--tv-space-2, 8px) var(--tv-space-3, 12px);
  border: 1px solid var(--tv-border, #d8dce6);
  border-radius: var(--tv-radius-sm, 4px);
  font-family: inherit;
  font-size: inherit;
  line-height: var(--tv-leading-normal, 1.5);
  resize: none;
  outline: none;
  transition: border-color 0.2s;
}

.tv-chat-input:focus {
  border-color: var(--tv-focus-ring-color, var(--tv-brand-navy));
  box-shadow: 0 0 0 2px rgb(var(--tv-brand-navy-rgb, 27 51 125) / 0.2);
}

.tv-chat-form button {
  flex-shrink: 0;
}

.tv-chat-container .tv-chat-form button {
  padding: var(--tv-space-2, 8px) var(--tv-space-4, 16px);
  border: 1px solid var(--tv-border, #d8dce6);
  border-radius: var(--tv-radius-sm, 4px);
  cursor: pointer;
  font-weight: var(--tv-weight-semibold, 600);
}

.tv-chat-form button:focus-visible {
  outline: none;
  border-color: var(--tv-focus-ring-color, var(--tv-brand-navy));
  box-shadow: 0 0 0 2px rgb(var(--tv-brand-navy-rgb, 27 51 125) / 0.2);
}

.tv-chat-bubble--error {
  background: var(--tv-surface-warning, #fff8e6);
  border-color: var(--tv-warning-border, #e6c200);
  color: var(--tv-ink);
}

.tv-copilot-retry-btn {
  margin-top: var(--tv-space-2, 8px);
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: var(--tv-weight-semibold, 600);
  font-family: inherit;
  color: var(--tv-brand-navy);
  background: var(--tv-surface-raised, #fff);
  border: 1px solid var(--tv-border, #d8dce6);
  border-radius: var(--tv-radius-sm, 4px);
  cursor: pointer;
}

.tv-copilot-retry-btn:hover {
  background: var(--tv-surface-muted, #f4f8f7);
  border-color: var(--tv-brand-navy);
}

.tv-copilot-retry-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgb(var(--tv-brand-navy-rgb, 27 51 125) / 0.2);
}

.tv-copilot-status {
  margin: var(--tv-space-1, 4px) 0 var(--tv-space-2, 8px);
  padding: 0 var(--tv-space-1, 4px);
  font-size: 0.75rem;
  font-weight: var(--tv-weight-semibold, 600);
  color: var(--tv-ink-muted, #5c6478);
  letter-spacing: 0.02em;
}

.tv-copilot-tools {
  margin-top: var(--tv-space-2, 8px);
  padding-top: var(--tv-space-2, 8px);
  border-top: 1px solid var(--tv-border-subtle, #e8ebf0);
  font-size: 0.72rem;
  font-weight: var(--tv-weight-semibold, 600);
  color: var(--tv-ink-muted, #5c6478);
  line-height: 1.4;
}

.tv-chat-bubble--assistant a {
  color: var(--tv-brand-navy, #1b337d);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tv-chat-bubble--assistant a:hover {
  color: var(--tv-brand-navy-dark, #152a66);
}

.tv-chat-bubble--assistant a:focus-visible {
  outline: none;
  border-radius: 2px;
  box-shadow: 0 0 0 2px rgb(var(--tv-brand-navy-rgb, 27 51 125) / 0.35);
}

.tv-chat-bubble--assistant .tv-copilot-md-table-wrap {
  margin: var(--tv-space-2, 8px) 0;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tv-chat-bubble--assistant table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.tv-chat-bubble--assistant th,
.tv-chat-bubble--assistant td {
  padding: 4px 8px;
  border: 1px solid var(--tv-border, #d8dce6);
  text-align: left;
  vertical-align: top;
}

.tv-chat-bubble--assistant th {
  font-weight: var(--tv-weight-semibold, 600);
  background: var(--tv-surface-muted, #f4f8f7);
}

.tv-chat-bubble--assistant pre {
  margin: var(--tv-space-2, 8px) 0;
  padding: var(--tv-space-2, 8px);
  overflow-x: auto;
  font-size: 0.78rem;
  background: var(--tv-surface-muted, #f4f8f7);
  border: 1px solid var(--tv-border-subtle, #e8ebf0);
  border-radius: var(--tv-radius-sm, 4px);
}

.tv-chat-bubble--assistant code {
  font-size: 0.85em;
  font-family: ui-monospace, monospace;
}

.tv-copilot-cards {
  display: flex;
  flex-direction: column;
  gap: var(--tv-space-2, 8px);
  margin-top: var(--tv-space-2, 8px);
}

.tv-copilot-card {
  padding: var(--tv-space-2, 8px) var(--tv-space-3, 12px);
  border: 1px solid var(--tv-border-subtle, #e8ebf0);
  border-radius: var(--tv-radius-sm, 4px);
  background: var(--tv-surface-muted, #f4f8f7);
  font-size: 0.8125rem;
}

.tv-copilot-card__title {
  font-weight: var(--tv-weight-semibold, 600);
  color: var(--tv-brand-navy, #1b337d);
  margin-bottom: 4px;
}

.tv-copilot-card__field {
  line-height: 1.35;
  color: var(--tv-ink-muted, #5c6478);
}

.tv-copilot-card__label {
  font-weight: var(--tv-weight-semibold, 600);
  color: var(--tv-ink, #1a1f2e);
}

.tv-copilot-card__link {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.75rem;
  font-weight: var(--tv-weight-semibold, 600);
  color: var(--tv-brand-navy, #1b337d);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.tv-copilot-card__link:hover {
  color: var(--tv-brand-navy-dark, #152a66);
}

.tv-copilot-bubble-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: var(--tv-space-2, 8px);
  padding-top: var(--tv-space-2, 8px);
  border-top: 1px solid var(--tv-border-subtle, #e8ebf0);
}

.tv-copilot-copy-btn {
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: var(--tv-weight-semibold, 600);
  font-family: inherit;
  color: var(--tv-ink-muted, #5c6478);
  background: var(--tv-surface-raised, #fff);
  border: 1px solid var(--tv-border-subtle, #e8ebf0);
  border-radius: var(--tv-radius-sm, 4px);
  cursor: pointer;
}

.tv-copilot-copy-btn:hover {
  color: var(--tv-brand-navy, #1b337d);
  border-color: var(--tv-brand-navy, #1b337d);
}

.tv-copilot-copy-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgb(var(--tv-brand-navy-rgb, 27 51 125) / 0.2);
}

.tv-copilot-action-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 0.72rem;
  font-weight: var(--tv-weight-semibold, 600);
  color: var(--tv-brand-navy, #1b337d);
  background: var(--tv-surface-raised, #fff);
  border: 1px solid var(--tv-brand-navy, #1b337d);
  border-radius: 999px;
  text-decoration: none;
}

.tv-copilot-action-chip:hover {
  background: var(--tv-surface-muted, #f4f8f7);
}

.tv-copilot-action-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: var(--tv-space-2, 8px);
}

.tv-copilot-sources {
  margin-top: var(--tv-space-2, 8px);
  font-size: 0.72rem;
  color: var(--tv-ink-muted, #5c6478);
}

.tv-copilot-sources summary {
  cursor: pointer;
  font-weight: var(--tv-weight-semibold, 600);
  color: var(--tv-ink-muted, #5c6478);
  user-select: none;
}

.tv-copilot-sources summary:hover {
  color: var(--tv-brand-navy, #1b337d);
}

.tv-copilot-sources__body {
  margin-top: 4px;
  padding-top: 4px;
  line-height: 1.4;
}

.tv-copilot-sources__tools {
  font-weight: var(--tv-weight-semibold, 600);
}

.tv-copilot-sources__time {
  margin-top: 2px;
  font-size: 0.68rem;
  color: var(--tv-ink-muted, #5c6478);
}

.tv-copilot-bubble-actions--user {
  justify-content: flex-end;
}

/* ── Depth-coloured left borders (C1) ──────────────────────────── */
/* Root assembly disclosure */
.tv-asm-disclosure {
  border-left: 3px solid #417690;
}
/* Depth-0 BOM rows (direct children of root assembly) */
.tv-bom-leaf-row[data-depth="0"] > td:first-child,
.tv-subasm-row[data-depth="0"] {
  border-left: 3px solid #417690;
}
/* Depth-1 sub-assembly disclosure and its rows */
.tv-nested-disclosure {
  border-left: 3px solid #7b5ea7;
}
.tv-bom-leaf-row[data-depth="1"] > td:first-child,
.tv-subasm-row[data-depth="1"] {
  border-left: 3px solid #7b5ea7;
}
/* Depth-2+ progressively lighter */
.tv-nested-body .tv-nested-disclosure {
  border-left: 3px solid #c9a8e0;
}
.tv-bom-leaf-row[data-depth="2"] > td:first-child,
.tv-subasm-row[data-depth="2"] {
  border-left: 3px solid #c9a8e0;
}
.tv-bom-leaf-row[data-depth="3"] > td:first-child,
.tv-subasm-row[data-depth="3"] {
  border-left: 3px solid #ddd0f0;
}

/* ── Ancestry header strip (C2) ──────────────────────────────────── */
.tv-ancestry-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 4px;
  padding: 3px 10px 3px 14px;
  background: #f7f3fb;
  border-top: 1px solid #e0d8ee;
  border-left: 3px solid #c9a8e0;
  font-size: 11px;
  color: #888;
  line-height: 1.4;
}
.tv-ancestry-strip .tv-anc-label {
  opacity: 0.6;
  margin-right: 2px;
}
.tv-ancestry-strip .tv-anc-sep {
  opacity: 0.4;
  margin: 0 1px;
}
.tv-ancestry-strip .tv-anc-code {
  font-family: monospace;
  font-weight: 600;
  color: #7b5ea7;
  text-decoration: none;
}
.tv-ancestry-strip .tv-anc-code:hover {
  text-decoration: underline;
}
.tv-ancestry-strip .tv-anc-code--root {
  color: #417690;
}

/* Search match highlight */
.tv-bom-matched > td {
  background: #fffbe6;
}
.tv-bom-matched:hover > td {
  background: #fff8d6;
}

/* Search match-count info/warn chips */
.tv-catalog-filter-chip--info {
  background: #eef5fb;
  color: #417690;
  border-color: #c8dcea;
}
.tv-catalog-filter-chip--warn {
  background: #fff3cd;
  color: #856404;
  border-color: #ffc107;
}
.tv-catalog-exact-match-link {
  color: #417690;
  font-weight: 600;
}

/* ── Catalog section / sub-section headers (grouping) ──────────── */
.tv-catalog-section {
  margin-bottom: 18px;
}
.tv-catalog-section-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 8px 4px;
  border-left: 4px solid #417690;
  border-bottom: 1px solid #d0dce6;
  font-weight: 700;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1b337d;
  margin-bottom: 6px;
  background: color-mix(in srgb, #417690 4%, var(--body-bg, #fff));
}
.tv-catalog-section-count {
  font-weight: 400;
  font-size: 0.9em;
  color: #888;
  text-transform: none;
  letter-spacing: 0;
}
.tv-catalog-subsection-header {
  padding: 3px 8px 2px 14px;
  border-left: 3px solid #7b5ea7;
  font-weight: 600;
  font-size: 0.8em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #7b5ea7;
  margin: 6px 0 4px 2px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}

/* ── BOM tree type icons (leaf vs sub-assembly) ──────────────── */
.tv-type-icon {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 5px;
  position: relative;
  top: -1px;
}
.tv-type-icon--asm {
  background: color-mix(in srgb, #7b5ea7 18%, transparent);
  border: 1px solid color-mix(in srgb, #7b5ea7 50%, transparent);
}
.tv-type-icon--leaf {
  background: color-mix(in srgb, #417690 15%, transparent);
  border: 1px solid color-mix(in srgb, #417690 40%, transparent);
  border-radius: 50%;
}
.tv-expand-hint {
  margin-left: auto;
  font-size: 0.7em;
  font-weight: 400;
  color: #c9a8e0;
  padding-left: 8px;
  flex-shrink: 0;
}
.tv-nested-disclosure[open] .tv-expand-hint {
  display: none;
}

/* ── Assembly rows ────────────────────────────── */
.tv-asm-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 8px 17px;
  border-bottom: 1px solid rgba(221, 225, 236, 0.45);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
}
.tv-asm-row:last-child { border-bottom: none; }
.tv-asm-row:hover { background: var(--body-bg, #f4f6fb); }
.tv-asm-row:hover .tv-asm-explore { opacity: 1; }
.tv-asm-row--shell { opacity: 0.75; }

.tv-asm-code-link { text-decoration: none; flex-shrink: 0; min-width: 168px; }
.tv-asm-code {
  font-family: var(--mono, monospace);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--tv-brand-navy, #1b337d);
  background: rgba(27, 51, 125, 0.06);
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
}
.tv-asm-desc { color: var(--ink-muted, #5c6478); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tv-asm-explore { opacity: 0.22; font-size: 10.5px; font-weight: 600; color: var(--purple, #7b5ea7); background: rgba(123, 94, 167, 0.08); border: 1px solid rgba(123, 94, 167, 0.2); padding: 1px 7px; border-radius: 999px; flex-shrink: 0; transition: opacity 0.15s; white-space: nowrap; }
.tv-asm-row:hover .tv-asm-explore { opacity: 1; }

.tv-asm-open {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  min-width: 0;
  flex: 1;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.tv-asm-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.tv-asm-open:focus-visible,
.tv-scope-card:focus-visible,
.tv-bom-explore:focus-visible,
.crumb:focus-visible,
.tv-bom-back:focus-visible {
  outline: 2px solid var(--tv-focus-ring-color, #1b337d);
  outline-offset: 2px;
}

/* Shell tag */
.tv-tag-shell {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 1px 5px; border-radius: 3px; flex-shrink: 0;
  background: rgba(65, 118, 144, 0.1);
  color: var(--steel, #417690);
  border: 1px solid rgba(65, 118, 144, 0.25);
}

/* ── Scope section headers ────────────────────── */
.tv-scope-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 5px;
  border-bottom: 1px solid var(--hairline-color, #dde1ec);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  position: sticky; top: 0; z-index: 2;
}
.tv-scope-count { font-weight: 400; font-size: 10px; opacity: 0.7; text-transform: none; letter-spacing: 0; }
.tv-scope-sub-label {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 14px 3px 20px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-faint, #9099b0);
  border-bottom: 1px solid rgba(221, 225, 236, 0.3);
}
.tv-scope-sub-label span { font-weight: 400; opacity: 0.7; }

/* Scope color palette — applied per-section via data-scope */
.tv-scope-header[data-scope="3"],
.tv-scope-header[data-scope="5"] {
  border-left: 3px solid #417690;
  background: color-mix(in srgb, #417690 5%, var(--body-bg, #f4f6fb));
  color: #417690;
}
.tv-scope-header[data-scope="6"] {
  border-left: 3px solid #3e7e60;
  background: color-mix(in srgb, #3e7e60 5%, var(--body-bg, #f4f6fb));
  color: #3e7e60;
}
.tv-scope-header[data-scope="10"] {
  border-left: 3px solid #5c6ea0;
  background: color-mix(in srgb, #5c6ea0 5%, var(--body-bg, #f4f6fb));
  color: #5c6ea0;
}
.tv-scope-header[data-scope="16"] {
  border-left: 3px solid #7b5ea7;
  background: color-mix(in srgb, #7b5ea7 5%, var(--body-bg, #f4f6fb));
  color: #7b5ea7;
}
.tv-scope-header[data-scope="20"] {
  border-left: 3px solid #1b337d;
  background: color-mix(in srgb, #1b337d 5%, var(--body-bg, #f4f6fb));
  color: #1b337d;
}
.tv-scope-header[data-scope="null"] {
  border-left: 3px solid #9099b0;
  background: color-mix(in srgb, #9099b0 4%, var(--body-bg, #f4f6fb));
  color: #9099b0;
}

/* ── Catalog card hierarchy ──────────────────────── */
.tv-card-grid {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}
.tv-brand-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 240px)); }
/* Center the fixed-width card group instead of left-packing it. justify-content
   only has slack to center when tracks don't consume all free space — so the
   scope grid uses a capped max (140px) rather than 1fr, and drops the 760px cap
   (justify-content now handles the spread). */
.tv-sub-grid   { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 200px)); justify-content: center; }
.tv-scope-grid { grid-template-columns: repeat(auto-fit, minmax(120px, 140px)); justify-content: center; }

.tv-card-back-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12px;
  color: #5c6478;
}
.tv-card-back-link {
  color: #417690;
  text-decoration: none;
  font-weight: 600;
  font-size: 11.5px;
}
.tv-card-back-link:hover { color: #1b337d; text-decoration: underline; }
.tv-card-back-sep { color: #9099b0; }
.tv-card-back-current {
  color: #1a1f2e;
  font-weight: 600;
  font-size: 11.5px;
}

/* Brand cards */
.tv-brand-card {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  border: 1px solid #dde1ec;
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.1s;
  cursor: pointer;
}
.tv-brand-card:hover { box-shadow: 0 4px 16px rgba(27,51,125,0.12); transform: translateY(-1px); }
.tv-brand-card__hd {
  padding: 20px 18px 18px;
  display: flex;
  flex-direction: column;
}
.tv-brand-card[data-brand="torvan"] .tv-brand-card__hd { background: linear-gradient(135deg, #1b337d, #263fa8); }
.tv-brand-card[data-brand="lq"]     .tv-brand-card__hd { background: linear-gradient(135deg, #417690, #4e91b0); }
.tv-brand-card[data-brand="steris"] .tv-brand-card__hd { background: linear-gradient(135deg, #7b5ea7, #9570c8); }
.tv-brand-card--service             .tv-brand-card__hd { background: linear-gradient(135deg, #2e7d5e, #3a9e78); }
.tv-brand-card__name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.tv-brand-card__bd {
  padding: 12px 18px 14px;
  background: #fff;
}
.tv-brand-card__families {
  font-size: 12px;
  color: #5c6478;
  line-height: 1.6;
  letter-spacing: 0.01em;
}

/* Sub-family cards */
.tv-sub-card {
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  border: 1px solid #dde1ec;
  background: #fff;
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow 0.15s, transform 0.1s;
}
.tv-sub-card:hover { box-shadow: 0 4px 16px rgba(27,51,125,0.1); transform: translateY(-1px); }
.tv-sub-card[data-brand="torvan"] { border-top: 3px solid #1b337d; }
.tv-sub-card[data-brand="lq"]     { border-top: 3px solid #417690; }
.tv-sub-card[data-brand="steris"] { border-top: 3px solid #7b5ea7; }
.tv-sub-card__bd { padding: 16px 16px 14px; flex: 1; }
.tv-sub-card__label {
  font-size: 15px;
  font-weight: 700;
  color: #1b337d;
  line-height: 1.3;
}
.tv-sub-card__ft {
  padding: 9px 16px;
  border-top: 1px solid #edf0f8;
  background: rgba(240, 242, 248, 0.55);
}
.tv-sub-card__scope-label {
  font-size: 11.5px;
  font-weight: 500;
  color: #7c8499;
}

/* Scope cards */
.tv-scope-card {
  appearance: none;
  color: inherit;
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  border-radius: 8px;
  border: 1px solid #dde1ec;
  background: #fff;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s, border-color 0.1s;
  text-align: center;
  min-height: 92px;
  user-select: none;
}
.tv-scope-card:hover { box-shadow: 0 4px 14px rgba(27,51,125,0.1); transform: translateY(-1px); border-color: #c0c9e0; }
.tv-scope-card[data-scope="3"]  { border-top: 3px solid #5b6eae; }
.tv-scope-card[data-scope="5"]  { border-top: 3px solid #4a7bba; } /* T-probe 3–5 scope */
.tv-scope-card[data-scope="6"]  { border-top: 3px solid #3a8a62; }
.tv-scope-card[data-scope="10"] { border-top: 3px solid #b07a25; }
.tv-scope-card[data-scope="16"] { border-top: 3px solid #7b5ea7; }
.tv-scope-card[data-scope="20"] { border-top: 3px solid #1b7b8a; }
.tv-scope-card[data-scope="null"] { border-top: 3px solid #9099b0; }
.tv-scope-card__num {
  font-family: "IBM Plex Mono", monospace;
  font-size: 20px;
  font-weight: 600;
  color: #1b337d;
  line-height: 1;
}
.tv-scope-card__unit {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #9099b0;
  margin-top: 3px;
}
.tv-scope-card__label {
  font-size: 12px;
  font-weight: 600;
  color: #1a1f2e;
  margin-top: 7px;
  line-height: 1.35;
}

/* ── BOM Focus Popup ──────────────────────────── */
.tv-bom-dialog {
  /* Center the modal both axes. A native <dialog> gets inset:0 from the UA
     sheet, so width:auto would stretch it full-width and strand the inner
     .tv-bom-modal card at the left edge. fit-content + margin:auto hugs the
     content and centers it. */
  inset: 0;
  width: fit-content;
  height: fit-content;
  max-width: 100vw;
  max-height: 100vh;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.tv-bom-dialog::backdrop {
  background: rgba(27, 51, 125, 0.45);
  backdrop-filter: blur(2px);
}

.tv-bom-dialog:not([open]) {
  display: none;
}

.tv-bom-modal {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(27, 51, 125, 0.22), 0 2px 8px rgba(0, 0, 0, 0.1);
  width: min(700px, 94vw);
  max-height: 82vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.tv-bom-hd {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 16px 12px;
  background: linear-gradient(135deg, #1b337d, #2a4a99);
  flex-shrink: 0;
}
.tv-bom-bc { flex: 1; display: flex; flex-wrap: wrap; gap: 2px; align-items: center; }
.crumb {
  appearance: none;
  border: 0;
  background: transparent;
  min-height: 24px;
  font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.65); cursor: pointer; padding: 2px 4px; border-radius: 3px; transition: color 0.1s; font-family: var(--mono, monospace);
}
.crumb:hover { color: #fff; }
.crumb--active { color: #fff; cursor: default; }
.crumb-sep { font-size: 11px; color: rgba(255,255,255,0.35); margin: 0 1px; }
.tv-bom-asm-info { font-size: 11px; color: rgba(255,255,255,0.75); padding: 2px 4px; }
.tv-bom-close {
  background: none; border: none; color: rgba(255,255,255,0.65);
  font-size: 16px; cursor: pointer; padding: 2px 6px; border-radius: 3px;
  line-height: 1; flex-shrink: 0; transition: color 0.1s;
  min-width: 32px;
  min-height: 32px;
}
.tv-bom-close:hover { color: #fff; }
.tv-bom-close:focus-visible {
  outline: 2px solid var(--tv-brand-mint, #a8dcd8);
  outline-offset: 2px;
}

.tv-bom-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px 6px;
  border-bottom: 1px solid var(--hairline-color, #dde1ec);
  flex-shrink: 0;
}
.tv-bom-count { font-size: 11px; color: var(--ink-faint, #9099b0); }
.tv-bom-item-link { font-size: 11px; color: var(--steel, #417690); text-decoration: none; }
.tv-bom-item-link:hover { text-decoration: underline; }

.tv-bom-col-headers {
  display: grid; grid-template-columns: 168px 1fr 60px;
  padding: 5px 16px 4px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-faint, #9099b0);
  border-bottom: 1px solid var(--hairline-color, #dde1ec);
  flex-shrink: 0;
}

.tv-bom-body {
  overflow-y: auto;
  flex: 1;
}
.tv-bom-body::-webkit-scrollbar { width: 5px; }
.tv-bom-body::-webkit-scrollbar-thumb { background: var(--hairline-color, #dde1ec); border-radius: 3px; }

.tv-bom-row {
  display: grid; grid-template-columns: 168px 1fr 60px;
  align-items: center;
  padding: 7px 16px;
  border-bottom: 1px solid rgba(221, 225, 236, 0.45);
  font-size: 12px;
}
.tv-bom-row:last-child { border-bottom: none; }
.tv-bom-row--asm { cursor: pointer; border-left: 3px solid rgba(123, 94, 167, 0.35); padding-left: 13px; }
.tv-bom-row--asm:hover { background: rgba(123, 94, 167, 0.04); }
.tv-bom-row--leaf:hover { background: var(--body-bg, #f4f6fb); }
.tv-bom-explore {
  appearance: none;
  min-height: 24px;
  cursor: pointer;
  font-size: 10.5px; font-weight: 600; color: var(--purple, #7b5ea7); background: rgba(123,94,167,0.08); border: 1px solid rgba(123,94,167,0.2); padding: 1px 7px; border-radius: 999px; white-space: nowrap; justify-self: end;
}
.tv-bom-row code { font-family: var(--mono, monospace); font-size: 11px; font-weight: 600; color: var(--tv-brand-navy, #1b337d); }
.tv-bom-row .tv-bom-desc { color: var(--ink-muted, #5c6478); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-bom-row .tv-bom-qty { font-size: 10.5px; color: var(--ink-faint, #9099b0); text-align: right; }

.tv-bom-empty { padding: 20px 16px; font-size: 12px; color: var(--ink-faint, #9099b0); font-style: italic; }

.tv-bom-ft {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 16px;
  border-top: 1px solid var(--hairline-color, #dde1ec);
  flex-shrink: 0;
}
.tv-bom-back {
  background: none; border: 1px solid var(--hairline-color, #dde1ec);
  font-size: 11px; color: var(--ink-muted, #5c6478); padding: 3px 10px; border-radius: 4px;
  cursor: pointer; transition: border-color 0.1s;
  min-height: 24px;
}
.tv-bom-back:hover { border-color: var(--steel, #417690); color: var(--steel, #417690); }
.tv-bom-back[hidden] { display: none; }
.tv-bom-hint { font-size: 10.5px; color: var(--ink-faint, #9099b0); }
.tv-bom-hint kbd { font-family: var(--mono, monospace); font-size: 9.5px; background: var(--hairline-color, #dde1ec); padding: 1px 4px; border-radius: 3px; }

/* Popup slide-in animation */
@keyframes tv-bom-modal-in {
  from { opacity: 0; transform: scale(0.96) translateY(-8px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.tv-bom-modal { animation: tv-bom-modal-in 0.18s ease-out; }

/* ── Operations hub shortcuts (account access) ─────────────────────────── */
.tv-hub-shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--tv-space-3, 12px);
  margin: var(--tv-space-4, 16px) 0;
}

.tv-hub-shortcut-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--tv-space-3, 12px);
  padding: var(--tv-space-3, 12px) var(--tv-space-4, 16px);
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius-lg, 8px);
  background: var(--tv-surface-raised);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--tv-shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.tv-hub-shortcut-card:hover,
.tv-hub-shortcut-card:focus-visible {
  border-color: color-mix(in srgb, var(--tv-brand-navy) 28%, var(--tv-border));
  box-shadow: var(--tv-shadow-md);
  transform: translateY(-1px);
  outline: none;
}

.tv-hub-shortcut-card--account {
  border-left: 3px solid var(--tv-brand-mint, #00ac5c);
}

.tv-hub-shortcut-card--help {
  border-left: 3px solid var(--tv-brand-navy, #1b337d);
}

.tv-hub-shortcut-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--tv-radius-md, 6px);
  background: color-mix(in srgb, var(--tv-brand-navy) 6%, var(--tv-surface-panel, #f4f6fb));
  color: var(--tv-brand-navy);
}

.tv-hub-shortcut-card__icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.tv-hub-shortcut-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tv-hub-shortcut-card__title {
  font-size: var(--tv-text-base);
  font-weight: var(--tv-weight-bold);
  color: var(--tv-brand-navy);
  line-height: var(--tv-leading-tight);
}

.tv-hub-shortcut-card__desc {
  font-size: var(--tv-text-sm);
  color: var(--tv-ink-muted);
  line-height: var(--tv-leading-normal);
}

.tv-hub-shortcut-card__arrow {
  font-size: 1.1rem;
  color: var(--tv-ink-muted);
  transition: transform 0.12s ease, color 0.12s ease;
}

.tv-hub-shortcut-card:hover .tv-hub-shortcut-card__arrow,
.tv-hub-shortcut-card:focus-visible .tv-hub-shortcut-card__arrow {
  color: var(--tv-brand-navy);
  transform: translateX(2px);
}

/* Account access workspace — "Manage" action popover
   A design-system-aligned disclosure: a pill trigger opens a floating,
   grouped action card (password / access profile / API token). */
.tv-manage {
  position: relative;
  display: inline-block;
}

.tv-manage > summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px 5px 11px;
  min-height: 2rem;
  border-radius: var(--tv-radius-pill);
  border: 1px solid var(--tv-border);
  background: var(--tv-surface-raised);
  color: var(--tv-ink);
  font-size: var(--tv-text-sm);
  font-weight: var(--tv-weight-semibold);
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.tv-manage > summary::-webkit-details-marker { display: none; }
.tv-manage > summary:hover {
  color: var(--tv-brand-navy);
  background: var(--tv-surface-panel);
  border-color: var(--tv-border-strong);
}
.tv-manage > summary:focus-visible {
  outline: 2px solid var(--tv-focus-ring-color);
  outline-offset: var(--tv-focus-ring-offset);
}
.tv-manage[open] > summary {
  color: var(--tv-brand-navy);
  background: var(--tv-surface-panel);
  border-color: color-mix(in srgb, var(--tv-brand-navy) 28%, var(--tv-border));
}

.tv-manage-ico { width: 15px; height: 15px; flex: none; }
.tv-manage-caret {
  width: 11px; height: 11px; flex: none; margin-left: 1px;
  opacity: 0.7;
  transition: transform 0.18s ease;
}
.tv-manage[open] .tv-manage-caret { transform: rotate(180deg); opacity: 1; }

/* Floating panel */
.tv-manage-panel {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 40;
  width: 286px;
  background: var(--tv-surface-raised);
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius-lg);
  box-shadow:
    0 14px 34px rgb(var(--tv-brand-navy-rgb) / 0.17),
    0 3px 9px rgb(var(--tv-brand-navy-rgb) / 0.08);
  text-align: left;
  overflow: hidden;
}
.tv-manage[open] .tv-manage-panel {
  animation: tv-manage-in 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes tv-manage-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .tv-manage[open] .tv-manage-panel { animation: none; }
  .tv-manage-caret { transition: none; }
}

/* small caret pointing back at the trigger */
.tv-manage-panel::before {
  content: "";
  position: absolute;
  top: -5px; right: 15px;
  width: 9px; height: 9px;
  background: var(--tv-surface-raised);
  border-left: 1px solid var(--tv-border);
  border-top: 1px solid var(--tv-border);
  transform: rotate(45deg);
}

.tv-manage-section { padding: 11px 13px; position: relative; }
.tv-manage-section + .tv-manage-section { border-top: 1px solid var(--tv-border); }
.tv-manage-section--danger {
  background: color-mix(in srgb, var(--tv-urgent, #cf222e) 4%, var(--tv-surface-raised));
}
.tv-manage-head--danger,
.tv-manage-head--danger svg { color: var(--tv-urgent); }
.tv-manage-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 9px;
  font-size: 0.6875rem;
  font-weight: var(--tv-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--tv-ink-muted);
}
.tv-manage-head svg { width: 13px; height: 13px; color: var(--tv-brand-navy); flex: none; }

.tv-manage-form { display: grid; gap: 8px; margin: 0; }
.tv-manage-field { display: grid; gap: 3px; margin: 0; }
.tv-manage-field > span {
  font-size: var(--tv-text-xs);
  font-weight: var(--tv-weight-medium);
  color: var(--tv-ink-muted);
}
.tv-manage-input {
  width: 100%;
  min-height: 2rem;
  padding: 5px 9px;
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius-md);
  background: var(--tv-surface-raised);
  font-family: var(--tv-font-sans);
  font-size: var(--tv-text-sm);
  color: var(--tv-ink);
  box-sizing: border-box;
}
.tv-manage-input:focus {
  border-color: var(--tv-brand-navy);
  outline: 2px solid color-mix(in srgb, var(--tv-brand-navy) 20%, transparent);
  outline-offset: 1px;
}

.tv-manage-note {
  margin: 0 0 9px;
  font-size: var(--tv-text-xs);
  color: var(--tv-ink-muted);
}
.tv-manage-note strong { color: var(--tv-ink); font-weight: var(--tv-weight-semibold); }

.tv-manage-actions { display: flex; gap: 7px; }
.tv-manage-actions form { display: contents; }

.tv-manage-btn {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 2rem;
  padding: 5px 11px;
  border-radius: var(--tv-radius-md);
  border: 1px solid var(--tv-border);
  background: var(--tv-surface-raised);
  color: var(--tv-ink);
  font-family: var(--tv-font-sans);
  font-size: var(--tv-text-sm);
  font-weight: var(--tv-weight-semibold);
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.tv-manage-btn:hover {
  background: var(--tv-surface-panel);
  border-color: var(--tv-border-strong);
  color: var(--tv-brand-navy);
}
.tv-manage-btn:focus-visible {
  outline: 2px solid var(--tv-focus-ring-color);
  outline-offset: 2px;
}
.tv-manage-btn svg { width: 13px; height: 13px; flex: none; }
.tv-manage-btn--primary {
  background: var(--tv-brand-navy);
  border-color: var(--tv-brand-navy);
  color: var(--tv-on-primary);
}
.tv-manage-btn--primary:hover {
  background: var(--tv-primary-hover);
  border-color: var(--tv-primary-hover);
  color: var(--tv-on-primary);
}
.tv-manage-btn--danger {
  color: var(--tv-urgent);
  border-color: var(--tv-urgent-border);
  background: var(--tv-urgent-bg);
}
.tv-manage-btn--danger:hover {
  background: color-mix(in srgb, var(--tv-urgent, #cf222e) 12%, var(--tv-surface-raised));
  border-color: var(--tv-urgent);
  color: var(--tv-urgent);
}

.tv-inline-search {
  display: flex;
  align-items: center;
  gap: var(--tv-space-2, 8px);
}

.tv-inline-search input[type="search"] {
  min-width: 12rem;
}

/* ── Forgot password (public) ─────────────────────────────────────────── */
.tv-account-help {
  max-width: 52rem;
  margin: 0 auto;
}

.tv-account-help__hero {
  margin-bottom: var(--tv-space-5, 20px);
  padding: var(--tv-space-5, 20px);
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius-lg, 8px);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--tv-brand-navy) 4%, var(--tv-surface-raised)) 0%,
    var(--tv-surface-raised) 55%
  );
  border-top: 3px solid var(--tv-brand-navy, #1b337d);
}

.tv-account-help__eyebrow {
  margin: 0 0 var(--tv-space-2, 8px);
  font-size: var(--tv-text-xs);
  font-weight: var(--tv-weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tv-ink-muted);
}

.tv-account-help__hero h2 {
  margin: 0 0 var(--tv-space-2, 8px);
  font-size: var(--tv-text-2xl);
  font-weight: var(--tv-weight-bold);
  color: var(--tv-brand-navy);
  letter-spacing: -0.02em;
  line-height: var(--tv-leading-tight);
}

.tv-account-help__lede {
  margin: 0 0 var(--tv-space-2, 8px);
  font-size: var(--tv-text-base);
  color: var(--tv-ink);
  max-width: 42rem;
}

.tv-account-help__note {
  margin: 0;
  font-size: var(--tv-text-sm);
  color: var(--tv-ink-muted);
}
