/* cw-tools POS composition observation panel */

#emit-pos-toggle {
  padding: 0.2rem 0.55rem;
  border: 1px solid #999;
  border-radius: 0.35rem;
  background: #fff;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

#emit-pos-toggle:hover,
#emit-pos-toggle[aria-pressed="true"] {
  background: #f2f2f2;
}

#emit-button-row {
  grid-template-columns: repeat(5, 1fr);
}

#emit-pos-panel {
  position: absolute;
  top: 0.75rem;
  left: calc(2.25rem + min(24rem, calc(100vw - 1.5rem)) + min(24rem, calc(100vw - 1.5rem)));
  z-index: 10;
  box-sizing: border-box;
  width: min(22rem, calc(100vw - 1.5rem));
  max-height: calc(100vh - 1.5rem);
  overflow: auto;
  padding: 0.75rem 0.85rem 0.8rem;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(3px);
}

#emit-pos-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

#emit-pos-header strong {
  font-size: 1.05rem;
}

#emit-pos-value {
  color: #555;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#emit-pos-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

#emit-pos-table th,
#emit-pos-table td {
  padding: 0.18rem 0.25rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.09);
}

#emit-pos-table thead th {
  color: #555;
  font-weight: 600;
  text-align: right;
}

#emit-pos-table thead th:first-child,
#emit-pos-table tbody th {
  text-align: left;
}

#emit-pos-table tbody th {
  font-weight: 500;
}

#emit-pos-table tbody td {
  text-align: right;
}

.emit-pos-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  box-sizing: border-box;
  min-width: 100%;
  padding: 0.16rem 0.38rem;
  border: 1px solid transparent;
  border-radius: 0.35rem;
  white-space: nowrap;
}

.emit-pos-code {
  min-width: 2.2em;
  font-weight: 700;
  text-align: center;
}

.emit-pos-label {
  color: #333;
  font-weight: 500;
}

@media (max-width: 70rem) {
  #emit-pos-panel {
    top: auto;
    right: 0.4rem;
    bottom: 0.4rem;
    left: auto;
    width: min(22rem, calc(100vw - 0.8rem));
    max-height: 45vh;
  }
}

@media (max-width: 46rem) {
  #emit-button-row {
    grid-template-columns: repeat(2, 1fr);
  }

  #emit-pos-panel {
    right: 0.4rem;
    bottom: 0.4rem;
    width: calc(100vw - 0.8rem);
  }
}
