/* =============================================================
   PR426 — Spec Hub styles
   Brand: Orange #FF6B00, Nav #141310, Wordmark Dark #1A1A2E.
   ============================================================= */

#p426-spec-hub {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: calc(100vh - 56px);
  background: #FFFFFF;
  color: #1A1A2E;
  font-family: inherit;
  overflow: hidden;
}

/* ── TRai insight bar ── */
.p426-trai-bar {
  background: #FF6B00;
  color: #FFFFFF;
  padding: 8px 16px;
  font-size: 13px;
  flex: 0 0 auto;
}

.p426-trai-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 3px;
  align-self: flex-start;
  margin: 6px 12px;
}

/* ── Toolbar ── */
.p426-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: #141310;
  color: #FFFFFF;
  flex: 0 0 auto;
}

.p426-toolbar-title {
  font-size: 15px;
  font-weight: 600;
  flex: 1;
}

.p426-links-toggle,
.p426-division-toggle {
  background: transparent;
  color: #FFFFFF;
  border: 1px solid #FF6B00;
  border-radius: 4px;
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
}

.p426-links-toggle:hover,
.p426-division-toggle:hover {
  background: #FF6B00;
}

/* ── Body layout ── */
.p426-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Left rail ── */
.p426-left-rail {
  width: 200px;
  flex: 0 0 200px;
  background: #F7F6F2;
  border-right: 1px solid #D4D1CA;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.p426-rail-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #7A7974;
  padding: 10px 12px 4px;
  font-weight: 600;
}

/* ── Spec set selector ── */
.p426-set-selector {
  border-bottom: 1px solid #D4D1CA;
  padding-bottom: 8px;
}

.p426-upload-btn {
  display: block;
  width: calc(100% - 24px);
  margin: 4px 12px 8px;
  background: #FF6B00;
  color: #FFFFFF;
  border: none;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 13px;
  cursor: pointer;
}

.p426-upload-btn:hover {
  background: #E65F00;
}

.p426-empty-inline {
  padding: 8px 12px;
  font-size: 12px;
  color: #7A7974;
}

.p426-set-item {
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #D4D1CA;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 13px;
}

.p426-set-item.active {
  background: #FF6B00;
  color: #FFFFFF;
}

.p426-set-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p426-version-badge {
  font-size: 10px;
  background: #1A1A2E;
  color: #FFFFFF;
  border-radius: 3px;
  padding: 1px 4px;
  flex: 0 0 auto;
}

/* ── Division tree ── */
.p426-division-tree {
  flex: 1;
  overflow-y: auto;
}

.p426-division-item {
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.p426-division-item:hover {
  background: #D4D1CA;
}

.p426-division-item.active {
  background: #FF6B00;
  color: #FFFFFF;
}

.p426-division-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.p426-division-count {
  font-size: 11px;
  color: #7A7974;
  flex: 0 0 auto;
}

.p426-division-item.active .p426-division-count {
  color: #FFFFFF;
}

/* ── Section viewer ── */
.p426-section-viewer {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  min-width: 0;
}

.p426-section-title {
  font-size: 20px;
  font-weight: 600;
  color: #1A1A2E;
  margin-bottom: 4px;
}

.p426-section-csi {
  font-size: 13px;
  color: #7A7974;
  margin-bottom: 16px;
}

.p426-section-content {
  padding: 24px;
  background: #F7F6F2;
  border: 1px dashed #D4D1CA;
  border-radius: 6px;
  color: #7A7974;
  font-size: 14px;
}

.p426-empty-state {
  text-align: center;
  color: #7A7974;
  padding: 48px 24px;
  font-size: 14px;
}

/* ── Linked items panel ── */
.p426-links-panel {
  width: 240px;
  flex: 0 0 240px;
  background: #F9F8F5;
  border-left: 1px solid #D4D1CA;
  padding: 16px;
  overflow-y: auto;
}

.p426-links-group {
  margin-bottom: 20px;
}

.p426-links-group-title {
  font-size: 13px;
  font-weight: 600;
  color: #1A1A2E;
  margin-bottom: 8px;
}

.p426-links-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.p426-link-add-btn {
  background: transparent;
  border: 1px solid #D4D1CA;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  color: #FF6B00;
  cursor: pointer;
  align-self: flex-start;
}

.p426-link-add-btn:hover {
  border-color: #FF6B00;
}

/* ── Mobile layout ── */
.p426-spec-hub.p426-mobile .p426-body {
  flex-direction: column;
  overflow-y: auto;
}

.p426-spec-hub.p426-mobile .p426-section-viewer {
  width: 100%;
  flex: 0 0 auto;
}

.p426-spec-hub.p426-mobile .p426-links-panel {
  width: 100%;
  flex: 0 0 auto;
  border-left: none;
  border-top: 1px solid #D4D1CA;
  display: none;
}

.p426-spec-hub.p426-mobile .p426-links-panel.p426-links-open {
  display: block;
}

/* Division bottom sheet (mobile) */
.p426-division-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 60vh;
  background: #F7F6F2;
  border-top: 2px solid #FF6B00;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.2);
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.25s ease;
  z-index: 9400;
}

.p426-division-sheet.p426-sheet-open {
  transform: translateY(0);
}

/* Desktop: links panel toggle collapses drawer */
.p426-links-panel.p426-links-open {
  display: none;
}
