.history-panel {
  container: history / inline-size;
  margin-top: clamp(18px,1.65vw,30px);
  --history-pad: clamp(17px,1.8vw,30px);
  --history-cols: minmax(0,1.18fr) minmax(0,1fr) minmax(0,.88fr);
}
.history-header .icon-button, .history-pager .icon-button { width: 44px; height: 44px; }
.history-refresh[aria-busy="true"] .icon { animation: spin .8s linear infinite; }
.history-columns, .history-row {
  display: grid;
  grid-template-columns: var(--history-cols);
  align-items: center;
  column-gap: clamp(12px,2.5vw,32px);
}
.history-columns {
  padding: 10px var(--history-pad);
  color: #565961;
  background: #e8e9ed55;
  border-bottom: 1px solid #47495213;
  font-size: .77rem;
  font-weight: 570;
}
.history-viewport {
  max-height: clamp(15rem,44vh,25rem);
  max-height: clamp(15rem,44svh,25rem);
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior-x: contain;
  touch-action: pan-y pinch-zoom;
  scrollbar-width: thin;
  scrollbar-color: #adafb6 transparent;
}
.history-viewport:focus-visible { outline: 2px solid #597391; outline-offset: -3px; border-radius: 4px; }
.history-list { margin: 0; padding: 0 var(--history-pad); list-style: none; }
.history-row { min-height: 69px; padding: 12px 0; line-height: 1.45; }
.history-row + .history-row { border-top: 1px solid #36383e16; }
.history-ident, .history-operator, .history-assigned { min-width: 0; overflow-wrap: anywhere; }
.history-phone {
  color: #25262b;
  font-family: ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;
  font-size: .956rem;
  font-weight: 570;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.045em;
}
.history-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; margin-top: 3px; font-size: .775rem; color: #5c5f67; }
.history-current {
  padding: 1px 7px;
  border: 1px solid #4f545d26;
  border-radius: 999px;
  background: linear-gradient(155deg,#ffffffd4,#dedfe495);
  box-shadow: inset 0 1px 0 #ffffffcf;
  color: #3e424a;
  font-size: .727rem;
  font-weight: 590;
}
.history-operator { color: #393b43; font-size: .91rem; }
.history-assigned { color: #595c65; font-size: .835rem; font-variant-numeric: tabular-nums; }
.history-field-label { display: none; }
.history-empty {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 22px 18px;
  text-align: center;
}
.history-empty > .panel-glyph { margin-bottom: 3px; width: 40px; height: 40px; border-radius: 13px; }
.history-empty strong { font-size: .94rem; font-weight: 610; letter-spacing: -.02em; }
.history-empty p, .history-feedback { margin: 0; color: #565961; font-size: .85rem; line-height: 1.55; overflow-wrap: anywhere; }
.history-feedback { padding: 10px var(--history-pad); color: #80501e; background: #faf4eeb0; }
.history-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; padding: 7px var(--history-pad); border-top: 1px solid #36383e1c; }
.history-pager { display: flex; align-items: center; gap: 4px; }
.history-range, .history-page { color: #545761; font-variant-numeric: tabular-nums; font-size: .805rem; }
.history-page { min-width: 52px; text-align: center; }
.history-prev .icon { rotate: 180deg; }
.history-pager button:disabled { opacity: .42; }
@container history (max-width: 550px) {
  .history-columns { display: none; }
  .history-row { grid-template-columns: minmax(0,1fr); align-items: start; row-gap: 4px; }
  .history-phone { font-size: 1rem; }
  .history-ident { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; }
  .history-meta { margin: 0; }
  .history-field-label { display: inline; color: #5c5f68; margin-right: 5px; font-weight: 500; }
  .history-operator, .history-assigned { font-size: .84rem; }
  .history-footer { padding-inline: 13px; }
}
@supports not (container-type: inline-size) {
  @media (max-width: 600px) {
    .history-columns { display: none; }
    .history-row { grid-template-columns: minmax(0,1fr); row-gap: 4px; }
    .history-field-label { display: inline; margin-right: 5px; }
  }
}
@media (prefers-reduced-motion: reduce) {
  .history-refresh[aria-busy="true"] .icon { animation: none; }
}

.allocation-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 7px;
  margin-top: 6px;
  letter-spacing: 0;
}
.allocation-window, .allocation-received {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 23px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: .755rem;
  font-weight: 590;
  line-height: 1.25;
  white-space: nowrap;
}
.allocation-waiting { color: #265a3b; border-color: #8ab79b8c; background: #e4f3e9; }
.allocation-expired { color: #933839; border-color: #cf96988c; background: #fbecec; }
.allocation-unavailable, .allocation-received { color: #4d515b; border-color: #a7aab46b; background: #f4f4f7; }
.allocation-received::before { content: "✓"; color: #39734c; font-weight: 700; }
.allocation-time { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
