/* Operator panel redesign: bot and offer details as side panels over the current page.
 * Loaded after redesign-settings.css; reuses the graphite tokens. */

/* ---------- panel frame ---------- */
/* The dialog covers the viewport as the backdrop; the sheet inside it is the panel. */
dialog.side-panel,
#offer-detail-dialog.side-panel {
  position: fixed;
  inset: 0;
  z-index: 40;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: rgb(0 0 0 / 55%);
  box-shadow: none;
  color: var(--text);
}
dialog.side-panel[open] {
  display: flex;
  justify-content: flex-end;
}
#offer-detail-dialog.side-panel--offer {
  z-index: 45;
}
/* Over the bot panel the list is already dimmed once. */
body:has(#bot-panel[open]) dialog.side-panel--offer {
  background: rgb(0 0 0 / 30%);
}
.side-panel__sheet {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-left: 1px solid #3a3a3a;
  border-radius: 0;
  background: #1d1d1d;
  box-shadow: -24px 0 70px rgb(0 0 0 / 35%);
  animation: side-panel-in 180ms ease-out;
}
#bot-panel .side-panel__sheet {
  width: min(760px, 100vw);
}
@keyframes side-panel-in {
  from {
    transform: translateX(24px);
    opacity: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .side-panel__sheet {
    animation: none;
  }
}
#bot-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 0;
  padding: 0;
}
#bot-content[hidden] {
  display: none;
}

/* ---------- header: title, status and actions, tabs ---------- */
.side-panel__head,
#offer-detail-dialog .side-panel__head {
  display: block;
  flex: 0 0 auto;
  margin: 0;
  padding: 18px 22px 0;
  border: 0;
  background: transparent;
}
.side-panel__title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.side-panel__title > div {
  min-width: 0;
}
.side-panel__title .eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  color: #a4a4a4;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.side-panel__title h2,
#offer-detail-dialog .side-panel__title h2 {
  margin: 0;
  overflow: hidden;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#offer-detail-dialog .side-panel__title h2 {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.side-panel__title p {
  margin: 3px 0 0;
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-panel__title .icon-button {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin: 0;
}
/* The workspace tag names the bot's workspace only when every workspace is listed. */
.side-panel__workspace {
  display: none;
}
body.all-workspaces .side-panel__workspace {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
body.all-workspaces .side-panel__workspace::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8f8f8f;
  content: '';
}
body.all-workspaces .side-panel__workspace::after {
  color: #6f6f6f;
  content: '·';
}
.side-panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
}
.side-panel__buttons {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.side-panel__buttons .button,
#offer-detail-actions .button {
  min-height: 30px;
  padding: 4px 12px;
  font-size: 12.5px;
}
/* More: a small disclosure menu for the rarer bot actions. */
.side-panel__more {
  position: relative;
}
.side-panel__more > summary {
  list-style: none;
  cursor: pointer;
}
.side-panel__more > summary::-webkit-details-marker {
  display: none;
}
.side-panel__more > summary::after {
  margin-left: 6px;
  color: var(--muted);
  font-size: 10px;
  content: '▾';
}
.side-panel__menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  padding: 4px;
  border: 1px solid #3d3d3d;
  border-radius: 8px;
  background: #242424;
  box-shadow: 0 20px 70px rgb(0 0 0 / 35%);
}
.side-panel__menu button {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
.side-panel__menu button:hover,
.side-panel__menu button:focus-visible {
  background: #303030;
}
.side-panel__menu button[hidden] {
  display: none;
}
.side-panel__menu .side-panel__menu-danger {
  color: var(--danger);
}

/* Pill tabs on one scrolling row. */
#bot-panel .tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 0;
  padding: 0 0 12px;
  overflow-x: auto;
  border: 0;
  scrollbar-width: none;
}
#bot-panel .tabs button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #3a3a3a;
  border-radius: 7px;
  background: transparent;
  color: #c9c9c9;
  font-size: 12.5px;
  white-space: nowrap;
}
#bot-panel .tabs button:hover:not([aria-selected='true']) {
  background: #262626;
  color: var(--text);
}
#bot-panel .tabs button[aria-selected='true'] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}
#bot-panel .tabs button::after {
  display: none;
}

/* ---------- body ---------- */
.side-panel__body,
#bot-panel .side-panel__body,
#offer-detail-dialog .side-panel__body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  padding: 2px 22px 32px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid #2f2f2f;
}
#bot-panel .side-panel__body {
  padding-top: 14px;
}
#offer-detail-dialog .side-panel__body {
  padding-top: 16px;
}
#bot-panel .side-panel__body > .form-feedback {
  margin: 0 0 12px;
}
/* Tab sections sit flat in the panel instead of as separate cards. */
#bot-panel [role='tabpanel'] {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
#bot-panel [role='tabpanel'] > .panel__head {
  padding: 0 0 10px;
}
#bot-panel .inventory-filters {
  padding: 0 0 10px;
}
/* Tables scroll sideways inside the panel; item cells wrap onto a second line. */
#bot-panel .table-wrap,
#bot-panel .table-wrap:has(> table.dense),
#offer-detail-dialog .table-wrap {
  max-width: 100%;
  max-height: none;
  overflow-x: auto;
  border: 1px solid #333;
  border-radius: 8px;
}
/* Item names wrap onto a second line so more columns fit before the table scrolls. */
:is(#bot-panel, #offer-detail-dialog) table.dense tbody td.fleet-item {
  min-width: 180px;
  max-width: 240px;
}
:is(#bot-panel, #offer-detail-dialog) table.dense tbody td .item-identity {
  min-width: 180px;
  max-width: 260px;
}
:is(#bot-panel, #offer-detail-dialog) table.dense tbody td.fleet-item,
:is(#bot-panel, #offer-detail-dialog) table.dense tbody td.fleet-item *,
:is(#bot-panel, #offer-detail-dialog) table.dense tbody td .item-identity,
:is(#bot-panel, #offer-detail-dialog) table.dense tbody td .item-identity * {
  white-space: normal;
}
:is(#bot-panel, #offer-detail-dialog) table.dense tbody td.fleet-item .fleet-item-name {
  text-align: left;
}
#bot-panel .pagination {
  padding: 10px 0 0;
}

/* ---------- Overview tab ---------- */
#bot-panel h3.bot-overview__title,
#bot-panel .bot-summary .section-heading h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 20px 0 8px;
  color: #a8a8a8;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#bot-panel #overview-panel > h3.bot-overview__title:first-child {
  margin-top: 0;
}
.health-cells {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.health-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #222;
}
.health-cell:focus-visible {
  outline: 2px solid rgb(159 185 232 / 45%);
  outline-offset: 1px;
}
.health-cell__label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.health-cell__value {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
}
.health-cell__value > span,
.health-cell__detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.health-cell__detail {
  color: var(--muted);
  font-size: 11.5px;
}
.health-cell__dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8a8a8a;
}
.health-cell--success .health-cell__dot {
  background: var(--success);
  box-shadow: 0 0 0 3px rgb(161 210 178 / 15%);
}
.health-cell--success .health-cell__detail {
  color: var(--success);
}
.health-cell--warning {
  border-color: #5f5236;
  background: rgb(221 194 143 / 7%);
}
.health-cell--warning .health-cell__dot {
  background: var(--warning);
  box-shadow: 0 0 0 3px rgb(221 194 143 / 18%);
}
.health-cell--warning .health-cell__detail {
  color: var(--warning);
}
.health-cell--danger {
  border-color: #6a4040;
  background: rgb(237 170 170 / 7%);
}
.health-cell--danger .health-cell__dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px rgb(237 170 170 / 18%);
}
.health-cell--danger .health-cell__detail {
  color: var(--danger);
}
/* A plain figure (Sent today) has no state, so no dot. */
.health-cell--plain .health-cell__dot {
  display: none;
}
.health-cell--info .health-cell__dot {
  background: #b2cbed;
}
.health-cell--active .health-cell__dot {
  background: #b2cbed;
  animation: health-cell-pulse 1.4s ease-in-out infinite;
}
@keyframes health-cell-pulse {
  50% {
    opacity: 0.35;
  }
}
@media (prefers-reduced-motion: reduce) {
  .health-cell--active .health-cell__dot {
    animation: none;
  }
}
/* "This bot": one strip of asset and offer counts that filter the matching tab. */
#bot-panel .bot-summary {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
#bot-panel .bot-summary .section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
#bot-panel .bot-summary .section-heading > span {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 11px;
}
#bot-panel .summary-cards {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  overflow: hidden;
  border: 1px solid #333;
  border-radius: 8px;
  background: #222;
}
#bot-panel .summary-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  min-height: 0;
  padding: 8px 12px;
  border: 0;
  border-left: 1px solid #333;
  border-radius: 0;
  background: transparent;
  text-align: left;
}
#bot-panel .summary-card:first-child {
  border-left: 0;
}
#bot-panel .summary-card:hover {
  background: #2a2a2a;
}
#bot-panel .summary-card span {
  overflow: hidden;
  max-width: 100%;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
#bot-panel .summary-card strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
#bot-panel .bot-notes {
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
}
#bot-panel .bot-notes p {
  margin: 0;
  color: #d2d2d2;
  font-size: 12.5px;
  white-space: pre-wrap;
}
#bot-panel .bot-trade-url {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 12px;
}
#bot-panel .bot-trade-url code {
  min-width: 0;
  overflow-wrap: anywhere;
}
#bot-panel .bot-errors {
  margin: 0;
  font-size: 12.5px;
}
#bot-panel .bot-errors .errors-clear {
  margin: 0;
  color: var(--muted);
}

/* ---------- offer panel ---------- */
#offer-detail-dialog .side-panel__sheet {
  width: min(760px, 100vw);
}
#offer-detail-dialog #offer-detail-actions {
  flex: none;
  justify-content: flex-start;
  margin: 14px 0;
}
#offer-detail-dialog #offer-detail-actions .row-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}
.side-panel__spacer {
  flex: 1 1 auto;
}
/* The reason or deadline of the current state, under the badges (mock notice). */
.side-panel__notice {
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid #60503a;
  border-radius: 8px;
  background: rgb(221 194 143 / 6%);
  color: var(--warning);
  font-size: 12.5px;
}
.side-panel__notice[hidden] {
  display: none;
}
#offer-detail-content .trade-facts {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}
#offer-detail-content .trade-facts > div {
  min-width: 0;
  padding: 7px 12px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #222;
}
#offer-detail-content .trade-facts dt {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#offer-detail-content .trade-facts dd {
  margin: 1px 0 0;
  font-size: 13px;
  font-weight: 550;
  overflow-wrap: anywhere;
}
/* The content is a grid; links keep their own width. */
#offer-detail-content .offer-open-bot {
  justify-self: start;
  margin: 0;
  font-size: 12.5px;
  text-decoration: underline;
  text-decoration-color: #555;
  text-underline-offset: 3px;
}
/* The content grid already spaces sections 12px apart. */
#offer-detail-content .trade-items-section,
#offer-detail-content .trade-acquisitions,
#offer-detail-content .trade-commerce {
  margin-top: 8px;
}
#offer-detail-content .trade-section {
  margin: 0;
  padding: 0;
  border: 0;
}
#offer-detail-content .trade-section > h3 {
  margin: 8px 0 8px;
  color: #a8a8a8;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#offer-detail-content .trade-technical {
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: transparent;
}
#offer-detail-content .trade-technical[open] > summary {
  margin-bottom: 8px;
}
#offer-detail-content .offer-steam-link {
  justify-self: start;
  margin-top: 14px;
}
/* Step timeline: done, current, still to come, or how it ended. */
.offer-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}
.offer-step {
  position: relative;
  display: flex;
  gap: 12px;
  padding-bottom: 12px;
  font-size: 13px;
}
.offer-step::before {
  position: absolute;
  top: 14px;
  bottom: 0;
  left: 4px;
  width: 1px;
  background: #373737;
  content: '';
}
.offer-step:last-child::before {
  display: none;
}
.offer-step__dot {
  flex: none;
  width: 9px;
  height: 9px;
  margin-top: 5px;
  border: 1px solid #515151;
  border-radius: 50%;
  background: #202020;
}
.offer-step--done .offer-step__dot {
  border-color: #a1d2b2;
  background: #a1d2b2;
}
.offer-step--current .offer-step__dot {
  border-color: #ececec;
  background: #303030;
  box-shadow: 0 0 0 3px #2c2c2c;
}
.offer-step--bad .offer-step__dot {
  border-color: #edaaaa;
  background: #edaaaa;
}
.offer-step strong {
  font-weight: 550;
}
.offer-step--todo strong {
  color: #8f8f8f;
  font-weight: 500;
}
.offer-step small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}

/* ---------- narrow screens: the panel takes the whole screen ---------- */
@media (max-width: 760px) {
  #bot-panel .side-panel__sheet,
  #offer-detail-dialog .side-panel__sheet {
    width: 100vw;
    border-left: 0;
  }
  .side-panel__head,
  #offer-detail-dialog .side-panel__head {
    padding: 14px 16px 0;
  }
  .side-panel__body,
  #bot-panel .side-panel__body,
  #offer-detail-dialog .side-panel__body {
    padding-inline: 16px;
  }
  .side-panel__buttons {
    margin-left: 0;
  }
  #bot-panel [role='tabpanel'] > .panel__head {
    align-items: stretch;
  }
  .health-cells,
  #bot-panel .summary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #bot-panel .summary-card {
    border-top: 1px solid #333;
  }
  #bot-panel .summary-card:nth-child(odd) {
    border-left: 0;
  }
  #bot-panel .summary-card:nth-child(-n + 2) {
    border-top: 0;
  }
}

/* ---------- item panel ---------- */
dialog.side-panel--item {
  z-index: 50;
}
body:has(#bot-panel[open], #offer-detail-dialog[open]) dialog.side-panel--item {
  background: rgb(0 0 0 / 30%);
}
#item-panel .side-panel__sheet {
  width: min(760px, 100vw);
}
#item-panel .side-panel__title p {
  white-space: normal;
}
.item-panel__subtitle .text-button {
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
  text-decoration-color: #555;
  text-underline-offset: 3px;
}
#item-panel .side-panel__actions {
  margin: 12px 0 14px;
}
#item-panel .side-panel__buttons {
  margin-left: auto;
}
.item-panel__badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
#item-panel .side-panel__body {
  padding-top: 14px;
}
/* Full-width wear gauge over the facts, like the mock; the facts name the wear and float. */
#item-panel .item-float {
  width: 100%;
  margin: 0 0 12px;
}
#item-panel .item-float-caption {
  display: none;
}
#item-panel h3.item-panel__section,
#item-panel .item-panel__purchase h4,
#item-panel .pricing-item__title,
#item-panel .item-attachments-title {
  margin: 20px 0 8px;
  color: #a8a8a8;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.item-panel__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 0;
}
.item-panel__fact {
  min-width: 0;
  padding: 7px 12px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #222;
}
.item-panel__fact dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.item-panel__fact dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
  margin: 1px 0 0;
  font-size: 13px;
  font-weight: 550;
  overflow-wrap: anywhere;
}
.item-panel__fact dd .button {
  min-height: 24px;
  padding: 0 8px;
}
.item-panel__note {
  margin: 8px 0 0;
  font-size: 12px;
}
.item-panel__link {
  display: inline-block;
  margin-top: 10px;
  color: #d0d0d0;
  font-size: 12.5px;
  text-decoration: underline;
  text-decoration-color: #555;
  text-underline-offset: 3px;
}
.item-panel__link:hover {
  color: #fff;
  text-decoration-color: currentColor;
}
/* The side panel is not a .dialog, so its price fields get the dark field style here. */
#item-panel .pricing-item__inputs {
  align-items: flex-end;
  gap: 8px;
}
#item-panel .pricing-item__inputs label {
  display: flex;
  flex: 0 1 120px;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  color: #a8a8a8;
  font-size: 11.5px;
  font-weight: 550;
}
#item-panel .pricing-item__inputs input {
  width: 100%;
  min-width: 0;
  height: 32px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  background: #1c1c1c;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
#item-panel .pricing-item__inputs input:focus-visible {
  border-color: #9cadd0;
}
#item-panel .pricing-item__inputs input:disabled {
  opacity: 0.55;
}
#item-panel .pricing-item__inputs .button {
  height: 32px;
  min-height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
}
#item-panel .pricing-item {
  margin: 0;
  padding: 0;
  border: 0;
}
.item-panel__rows {
  display: flex;
  flex-direction: column;
}
.item-panel__row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 6px 4px;
  border: 0;
  border-bottom: 1px solid #2c2c2c;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 400;
  text-align: left;
}
.item-panel__row--link {
  cursor: pointer;
}
.item-panel__row--link:hover {
  background: #262626;
}
.item-panel__row-main {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-panel__more {
  margin-top: 10px;
}
#item-panel .item-panel__purchase .diagnostic-grid {
  gap: 8px;
}
@media (max-width: 760px) {
  #item-panel .side-panel__sheet {
    width: 100vw;
    border-left: 0;
  }
  #item-panel .side-panel__head {
    padding: 14px 16px 0;
  }
  #item-panel .side-panel__body {
    padding-inline: 16px;
  }
  #item-panel .side-panel__buttons {
    margin-left: 0;
  }
  .item-panel__row small {
    display: none;
  }
}

/* ---------- bot panel: header badges, trade URL, tab counts, Overview switches ---------- */
#bot-panel .side-panel__title .bot-trade-url {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  white-space: normal;
}
#bot-panel .side-panel__title .bot-trade-url[hidden] {
  display: none;
}
#bot-panel .side-panel__title .bot-trade-url code {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}
#bot-panel .side-panel__title .bot-trade-url .button {
  min-height: 24px;
  padding: 0 8px;
}
#bot-panel .tabs .tab-count {
  margin-left: 2px;
  color: #8f8f8f;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
#bot-panel .tabs [aria-selected='true'] .tab-count {
  color: #555;
}
#bot-panel .bot-quick-settings[hidden] {
  display: none;
}
#bot-panel .bot-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid #2c2c2c;
  font-size: 13px;
}
#bot-panel .bot-setting strong {
  font-weight: 550;
}
#bot-panel .bot-setting small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
}

/* ---------- Edit bot: General / Marketplace pricing / Steam & proxy tabs ---------- */
/* Mock dialog frame: 620 px, tabs under the title, no rules between the parts. */
#edit-bot-dialog {
  width: min(620px, calc(100vw - 32px));
}
#edit-bot-dialog .dialog__head {
  padding: 18px 22px 0;
  border-bottom: 0;
}
#edit-bot-dialog .dialog__head .eyebrow {
  margin: 0 0 4px;
}
#edit-bot-dialog .dialog__head h2 {
  font-size: 19px;
}
#edit-bot-dialog .dialog__body {
  padding: 14px 22px 4px;
}
#edit-bot-dialog .dialog__foot {
  padding: 16px 22px 18px;
  border-top: 0;
}
#edit-bot-dialog .form-section {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}
#edit-bot-dialog .form-section label {
  margin: 0;
}
/* Active bot: one line of notice with the Deactivate button beside it. */
#edit-bot-dialog #edit-bot-active:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  padding: 9px 12px;
  font-size: 12.5px;
}
#edit-bot-dialog #edit-bot-active p {
  flex: 1 1 260px;
  margin: 0;
}
#edit-bot-dialog .edit-bot-tabs {
  margin: 0 0 14px;
}
#edit-bot-dialog [role='tabpanel'][hidden] {
  display: none;
}
#edit-bot-dialog .edit-bot-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid #2c2c2c;
  cursor: pointer;
}
#edit-bot-dialog .edit-bot-switch > span {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
#edit-bot-dialog .edit-bot-switch strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
}
#edit-bot-dialog .edit-bot-switch small {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.45;
}
/* The empty note stands in for the pricing section until the bot is on a marketplace. */
#edit-bot-pricing:not([hidden]) + .edit-bot-pricing-empty {
  display: none;
}
.edit-bot-pricing-empty {
  margin: 4px 0 0;
  font-size: 12.5px;
}
.edit-bot-summary {
  margin: 0 0 12px;
  padding: 0;
  border: 1px solid #333;
  border-radius: 8px;
  list-style: none;
}
.edit-bot-summary[hidden],
#edit-bot-connection-form[hidden] {
  display: none;
}
.edit-bot-summary li {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 12px;
  border-top: 1px solid #2c2c2c;
  font-size: 12.5px;
}
.edit-bot-summary li:first-child {
  border-top: 0;
}
.edit-bot-summary li span {
  color: var(--muted);
}
.edit-bot-summary li strong {
  min-width: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}
@media (max-width: 760px) {
  .edit-bot-summary li {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
}

/* ---------- bot dialogs: Add bot, Transfer, Set pricing rule (mock frame) ---------- */
/* Mock dialog frame: 620 px, eyebrow and title, no rules between the parts. */
#add-bot-dialog,
#bot-transfer-dialog,
#bot-pricing-dialog {
  width: min(620px, calc(100vw - 32px));
  border-color: var(--line);
  border-radius: 12px;
  background: var(--panel);
}
#add-bot-dialog .dialog__head,
#bot-transfer-dialog .dialog__head,
#bot-pricing-dialog .dialog__head {
  padding: 18px 22px 0;
  border-bottom: 0;
  background: transparent;
}
#add-bot-dialog .dialog__head > div,
#bot-transfer-dialog .dialog__head > div,
#bot-pricing-dialog .dialog__head > div {
  flex: 1 1 auto;
}
#add-bot-dialog .dialog__head .eyebrow,
#bot-transfer-dialog .dialog__head .eyebrow,
#bot-pricing-dialog .dialog__head .eyebrow {
  margin: 0 0 4px;
}
#add-bot-dialog .dialog__head h2,
#bot-transfer-dialog .dialog__head h2,
#bot-pricing-dialog .dialog__head h2 {
  font-size: 19px;
}
#add-bot-dialog .dialog__head .icon-button,
#bot-transfer-dialog .dialog__head .icon-button,
#bot-pricing-dialog .dialog__head .icon-button {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}
#bot-transfer-dialog .dialog__description,
#bot-pricing-dialog .dialog__description {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}
#add-bot-dialog .dialog__body,
#bot-transfer-dialog .dialog__body,
#bot-pricing-dialog .dialog__body {
  padding: 4px 22px 4px;
}
#add-bot-dialog .dialog__foot,
#bot-transfer-dialog .dialog__foot,
#bot-pricing-dialog .dialog__foot {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 22px 18px;
  border-top: 0;
  background: transparent;
}
#add-bot-dialog .dialog__foot > p {
  margin-right: auto;
  color: #8a8a8a;
  font-size: 12px;
}
#add-bot-dialog .dialog__foot > div,
#bot-transfer-dialog .dialog__foot,
#bot-pricing-dialog .dialog__foot {
  display: flex;
  gap: 8px;
}
#add-bot-dialog .dialog__foot .button,
#bot-transfer-dialog .dialog__foot .button,
#bot-pricing-dialog .dialog__foot .button {
  min-width: 0;
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
}
/* Mock fields: label over control, 34 px controls, hint and error lines under them. */
#add-bot-dialog .add-bot-field,
#bot-transfer-dialog .add-bot-field,
#bot-pricing-dialog .add-bot-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin-top: 14px;
}
#add-bot-dialog .add-bot-field > label,
#add-bot-dialog .add-bot-label,
#bot-transfer-dialog .add-bot-field > label,
#bot-pricing-dialog .add-bot-field > label {
  display: block;
  margin: 0;
  color: #d0d0d0;
  font-size: 12px;
  font-weight: 550;
  line-height: 1.45;
}
#add-bot-dialog .add-bot-optional {
  color: #8a8a8a;
  font-size: 12px;
  font-weight: 550;
}
#add-bot-dialog input:not([type='checkbox'], [type='radio'], [type='file']),
#add-bot-dialog textarea,
#bot-transfer-dialog textarea,
#bot-pricing-dialog input[type='search'] {
  width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #1a1a1a;
  color: #e3e3e3;
  font-size: 13px;
}
#add-bot-dialog textarea,
#bot-transfer-dialog textarea {
  min-height: 80px;
  padding: 8px 12px;
  line-height: 1.45;
  resize: vertical;
}
#add-bot-dialog [aria-invalid='true'] {
  border-color: #7d4a4d;
}
#add-bot-dialog .inventory-select,
#bot-transfer-dialog .inventory-select,
#bot-pricing-dialog .inventory-select {
  display: block;
  width: 100%;
}
#add-bot-dialog .inventory-select-trigger,
#bot-transfer-dialog .inventory-select-trigger,
#bot-pricing-dialog .inventory-select-trigger {
  width: 100%;
  height: 34px;
  min-height: 34px;
  margin-top: 0;
  border-radius: 8px;
  font-size: 13px;
}
#add-bot-dialog .add-bot-hint,
#bot-transfer-dialog .add-bot-hint,
#bot-pricing-dialog .add-bot-hint {
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}
#add-bot-dialog .add-bot-hint:empty {
  display: none;
}
#add-bot-dialog .add-bot-error {
  margin: 0;
  color: #f0b4b4;
  font-size: 11.5px;
  line-height: 1.45;
}
#add-bot-dialog .add-bot-error[hidden] {
  display: none;
}
#add-bot-dialog .add-bot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
}
#add-bot-dialog .bot-add-fields {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
#add-bot-dialog .bot-add-fields[hidden],
#add-bot-dialog .wizard-step[hidden] {
  display: none;
}
/* Step pills: current outlined bright, done green, later faint. */
#add-bot-dialog .add-bot-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 4px;
  padding: 0;
  list-style: none;
}
#add-bot-dialog .add-bot-steps[hidden] {
  display: none;
}
#add-bot-dialog .add-bot-steps button {
  min-height: 0;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: #8a8a8a;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.45;
}
#add-bot-dialog .add-bot-steps button:disabled {
  cursor: default;
  opacity: 1;
}
#add-bot-dialog .add-bot-steps [data-state='current'] button {
  border-color: #ececec;
  color: var(--text);
}
#add-bot-dialog .add-bot-steps [data-state='done'] button {
  border-color: #4f7a5d;
  color: #a9d6b8;
}
/* maFile: one small button and the chosen file name beside it. */
#add-bot-dialog .add-bot-mafile {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
#add-bot-dialog .add-bot-mafile__pick {
  flex: none;
  min-height: 28px;
  margin: 0;
  padding: 0 10px;
  color: #dfdfdf;
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
}
#add-bot-dialog .add-bot-mafile__pick:has(input:focus-visible) {
  outline: 2px solid #9cadd0;
  outline-offset: 2px;
}
#add-bot-dialog .add-bot-mafile [data-mafile-feedback] {
  display: block;
  min-width: 0;
  color: #8a8a8a;
}
#add-bot-dialog .add-bot-mafile [data-mafile-feedback]:empty::before {
  content: 'No file chosen';
}
#add-bot-dialog .add-bot-mafile [data-mafile-feedback].error-text {
  color: #f0b4b4;
}
#add-bot-dialog .add-bot-inventory {
  margin-top: 12px;
}
#add-bot-dialog .add-bot-inventory summary {
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
/* Review: one bordered list, label column and value with an Edit link. */
#add-bot-dialog .add-bot-review {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  margin: 10px 0 0;
  border: 1px solid #333;
  border-radius: 8px;
  font-size: 12.5px;
}
#add-bot-dialog .add-bot-review dt,
#add-bot-dialog .add-bot-review dd {
  margin: 0;
  padding: 8px 12px;
  border-top: 1px solid #2c2c2c;
}
#add-bot-dialog .add-bot-review dt {
  padding-right: 0;
  color: var(--muted);
}
#add-bot-dialog .add-bot-review dd {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  font-weight: 500;
}
#add-bot-dialog .add-bot-review dd > span {
  min-width: 0;
  overflow-wrap: anywhere;
}
#add-bot-dialog .add-bot-review dt:first-of-type,
#add-bot-dialog .add-bot-review dt:first-of-type + dd {
  border-top: 0;
}
#add-bot-dialog .add-bot-link {
  flex: none;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  text-decoration: underline;
  text-decoration-color: #666;
  text-underline-offset: 4px;
  cursor: pointer;
}
#add-bot-dialog .add-bot-link:hover {
  text-decoration-color: #aaa;
}
#add-bot-dialog .add-bot-review__note {
  margin-top: 10px;
  color: #8a8a8a;
}
/* Bulk import: line counts, example link, the activation choice and the preview. */
#add-bot-dialog .add-bot-count {
  margin-left: 4px;
  padding: 0 7px;
  border: 1px solid #474747;
  border-radius: 999px;
  color: #bdbdbd;
  font-size: 11px;
  font-weight: 500;
}
#add-bot-dialog .add-bot-example {
  margin: 6px 0 0;
}
#add-bot-dialog .add-bot-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 0;
  padding: 7px 12px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #1e1e1e;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 400;
  cursor: pointer;
}
#add-bot-dialog .bot-import-preview {
  margin: 0;
  padding: 0;
  list-style: none;
}
#add-bot-dialog .bot-import-preview li {
  padding: 8px 4px;
  border-bottom: 1px solid #2c2c2c;
  font-size: 11.5px;
  overflow-wrap: anywhere;
}
#add-bot-dialog [data-bot-import-result]:empty,
#bot-transfer-dialog .bot-import-result:empty {
  display: none;
}
#add-bot-dialog [data-bot-import-result] ul,
#bot-transfer-dialog .bot-import-result ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
#add-bot-dialog [data-bot-import-result] li,
#bot-transfer-dialog .bot-import-result li {
  padding: 8px 4px;
  border-bottom: 1px solid #2c2c2c;
  font-size: 12.5px;
  overflow-wrap: anywhere;
}
/* Mock notices: ok, bad and info boxes for results and validation. */
.bot-dialog-notice {
  margin: 12px 0 0;
  padding: 9px 12px;
  border: 1px solid #7a6440;
  border-radius: 8px;
  background: rgb(221 194 143 / 6%);
  color: #e2c99d;
  font-size: 12.5px;
  line-height: 1.45;
}
.bot-dialog-notice[hidden] {
  display: none;
}
.bot-dialog-notice--ok {
  border-color: #4f7a5d;
  background: rgb(161 210 178 / 6%);
  color: #a9d6b8;
}
.bot-dialog-notice--bad {
  border-color: #7d4a4d;
  background: rgb(240 180 180 / 6%);
  color: #f0b4b4;
}
.bot-dialog-notice--info {
  border-color: #425570;
  background: rgb(178 203 237 / 6%);
  color: #b2cbed;
}
@media (max-width: 760px) {
  #add-bot-dialog .add-bot-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  #add-bot-dialog .add-bot-review {
    grid-template-columns: minmax(0, 1fr);
  }
  #add-bot-dialog .add-bot-review dt {
    padding-bottom: 0;
  }
  #add-bot-dialog .add-bot-review dt + dd {
    padding-top: 2px;
    border-top: 0;
  }
}
.bot-dialog-notice__line {
  margin: 0;
}
/* Mock dialogs open near the top of the screen, not centred. */
#add-bot-dialog,
#bot-transfer-dialog,
#bot-pricing-dialog,
#edit-bot-dialog,
#confirm-dialog {
  margin: 48px auto auto;
  max-height: calc(100dvh - 96px);
}
#add-bot-dialog .dialog__form,
#bot-transfer-dialog .dialog__form,
#bot-pricing-dialog .dialog__form,
#edit-bot-dialog .dialog__form,
#confirm-dialog .dialog__form {
  max-height: calc(100dvh - 98px);
}
/* Confirm ("Review this change"): the mock's small alert, Go back and the action only. */
#confirm-dialog {
  width: min(460px, calc(100vw - 32px));
  border-color: var(--line);
  border-radius: 12px;
  background: var(--panel);
}
#confirm-dialog .dialog__head {
  padding: 18px 22px 0;
  border-bottom: 0;
  background: transparent;
}
#confirm-dialog .dialog__head .eyebrow {
  margin: 0 0 4px;
}
#confirm-dialog .dialog__head h2 {
  font-size: 19px;
}
#confirm-dialog .dialog__head .icon-button {
  display: none;
}
#confirm-dialog .dialog__body {
  padding: 0 22px;
}
#confirm-dialog .confirmation-message {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
}
#confirm-dialog .dialog__foot {
  padding: 16px 22px 18px;
  border-top: 0;
  background: transparent;
}
#confirm-dialog .dialog__foot > div {
  display: flex;
  gap: 8px;
}
#confirm-dialog .dialog__foot .button {
  min-width: 0;
  min-height: 34px;
  padding: 0 14px;
  font-size: 12px;
}
#add-bot-dialog .wizard-step {
  display: block;
  margin: 0;
  padding: 0;
}
#add-bot-dialog .add-bot-mafile__pick {
  display: inline-flex;
  align-items: center;
}

/* ---------- bot status words: Healthy / Degraded / Offline / Disabled pills like the mock ---------- */
#bots-table .home-bot-status .badge,
#bot-status .badge {
  padding: 1px 7px;
  border: 1px solid #474747;
  border-radius: 999px;
  background: transparent;
  color: #bdbdbd;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
}
#bots-table .home-bot-status .badge--success,
#bot-status .badge--success {
  border-color: #4f7a5d;
  background: rgb(161 210 178 / 6%);
  color: #a9d6b8;
}
#bots-table .home-bot-status .badge--warning,
#bot-status .badge--warning {
  border-color: #7a6440;
  background: rgb(221 194 143 / 6%);
  color: #e2c99d;
}
#bots-table .home-bot-status .badge--danger,
#bot-status .badge--danger {
  border-color: #7d4a4d;
  background: rgb(240 180 180 / 6%);
  color: #f0b4b4;
}
#bots-table .home-bot-status .badge--muted,
#bot-status .badge--muted {
  color: #9c9c9c;
}

/* ---------- bot panel Inventory tab: compact table like the mock ---------- */
/* Item, float, status, hold, BUFF and History fit the 760 px panel on one line per item; the
   asset ID is in the item's hint. The workspace Inventory page keeps every column. */
#bot-inventory-table .bot-inventory-optional,
#bot-inventory-table [data-market]:not([data-market='buff163']),
#bot-inventory-table th[data-market-insert],
#bot-inventory-table td.item-pricing,
#bot-price-columns {
  display: none;
}
#bot-inventory-table [data-market='buff163'][hidden] {
  display: table-cell;
}
#bot-inventory-table .dense-float__bar {
  display: none;
}
#bot-panel #bot-inventory-table tbody td.fleet-item,
#bot-panel #bot-inventory-table tbody td.fleet-item * {
  white-space: nowrap;
}
#bot-panel #bot-inventory-table tbody td.fleet-item {
  min-width: 200px;
  max-width: 300px;
  overflow: hidden;
}
#bot-panel #bot-inventory-table .fleet-item-name {
  display: inline-block;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
#bot-panel
  #bot-inventory-table
  td.fleet-item:has(.item-purchase, .bot-item-amount)
  .fleet-item-name {
  max-width: 170px;
}
#bot-inventory-table .fleet-item .bot-item-amount {
  margin-left: 6px;
  vertical-align: middle;
}
#bot-inventory-table .badge,
#bot-offers-table .badge {
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
}
#items-body .item-history {
  border-color: transparent;
  background: transparent;
}
#items-body .item-history:hover {
  background: #262626;
}

/* ---------- bot panel Offers tab: compact rows like the mock ---------- */
#bot-offers-table thead,
#bot-offers-table-prices {
  display: none;
}
#bot-offers-table {
  width: 100%;
}
#bot-offers-table td {
  padding: 6px 4px;
  border-bottom: 1px solid #2c2c2c;
  font-size: 12.5px;
  vertical-align: middle;
}
#bot-offers-table .offer-row {
  cursor: pointer;
}
#bot-offers-table .offer-row:hover {
  background: #262626;
}
#bot-offers-table .offer-row__id {
  width: 1%;
  white-space: nowrap;
}
#bot-offers-table .offer-row__summary {
  width: 100%;
}
#bot-offers-table .offer-row__summary small {
  margin-left: 8px;
  font-size: 11px;
}
#bot-offers-table .offer-status,
#bot-offers-table .offer-row__actions {
  width: 1%;
  white-space: nowrap;
}
/* One line: the countdown or reason sits left of the state badge. */
#bot-offers-table .offer-status__badges {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
#bot-offers-table .offer-status__badges .subline {
  order: -1;
  margin: 0;
  color: #8a8a8a;
  font-size: 11.5px;
}
#bot-offers-table .row-actions > .muted {
  display: none;
}
#bot-offers-table .row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
/* Narrow panel: the state and actions move under the summary instead of off-screen. */
@media (max-width: 760px) {
  #bot-offers-table,
  #bot-offers-table tbody {
    display: block;
  }
  #bot-offers-table .offer-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 4px 8px;
    padding: 6px 4px;
    border-bottom: 1px solid #2c2c2c;
  }
  #bot-offers-table .offer-row > td {
    width: auto;
    padding: 0;
    border: 0;
  }
  #bot-offers-table .offer-status {
    grid-column: 1 / 2;
  }
  #bot-offers-table .offer-status__badges {
    justify-content: flex-start;
  }
  #bot-offers-table .offer-row__actions {
    justify-self: end;
  }
}

/* ---------- bot panel Requests and Webhooks tabs: one-line rows like the mock ---------- */
:is(#activity-panel, #webhooks-panel) .activity-entry {
  border-bottom: 1px solid #2c2c2c;
}
:is(#activity-panel, #webhooks-panel) .activity-entry__summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 4px;
  font-size: 12.5px;
}
:is(#activity-panel, #webhooks-panel) .activity-entry__summary:hover,
:is(#activity-panel, #webhooks-panel) .activity-entry[open] > summary {
  background: #262626;
}
:is(#activity-panel, #webhooks-panel) .activity-entry__time {
  display: block;
  flex: none;
  color: #8a8a8a;
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 12px;
}
:is(#activity-panel, #webhooks-panel) .activity-entry__main {
  display: flex;
  flex: 1 1 auto;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
:is(#activity-panel, #webhooks-panel) .activity-entry__title {
  flex: none;
  font-size: 12.5px;
}
:is(#activity-panel, #webhooks-panel) .activity-entry__title strong {
  font-weight: 550;
}
:is(#activity-panel, #webhooks-panel) .activity-entry__context {
  display: block;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:is(#activity-panel, #webhooks-panel) .activity-entry__context > span + span::before {
  content: ' · ';
}
#activity-panel .activity-bot {
  display: none;
}
#activity-panel .activity-entry__context > .activity-bot + span::before {
  content: '';
}
:is(#activity-panel, #webhooks-panel) .activity-entry__summary > .badge {
  flex: none;
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
}
:is(#activity-panel, #webhooks-panel) .activity-entry__expand {
  display: none;
}
:is(#activity-panel, #webhooks-panel) .activity-entry__body {
  padding: 10px 4px 14px;
  background: transparent;
}
/* The mock's small fact cards: label in caps over the value. */
.activity-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 0;
}
.activity-facts > div {
  min-width: 0;
  padding: 7px 12px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #1e1e1e;
}
.activity-facts dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.activity-facts dd {
  margin: 1px 0 0;
  overflow: hidden;
  font-size: 13px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}
:is(#activity-panel, #webhooks-panel) .activity-entry__message {
  margin: 10px 0 0;
  padding: 9px 12px;
  border: 1px solid #7a6440;
  border-radius: 8px;
  background: rgb(221 194 143 / 6%);
  color: #e2c99d;
  font-size: 12.5px;
}
:is(#activity-panel, #webhooks-panel) .activity-entry--danger .activity-entry__message {
  border-color: #7d4a4d;
  background: rgb(240 180 180 / 6%);
  color: #f0b4b4;
}
:is(#activity-panel, #webhooks-panel) .activity-entry--success .activity-entry__message,
:is(#activity-panel, #webhooks-panel) .activity-entry--outline .activity-entry__message {
  border-color: #333;
  background: transparent;
  color: var(--muted);
}
#activity-panel .activity-entry__actions {
  gap: 8px;
  margin-top: 10px;
}
#activity-panel .activity-more {
  margin-top: 12px;
}
#activity-panel .activity-more > summary {
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
#activity-panel .request-failure {
  margin-top: 10px;
}
:is(#activity-panel, #webhooks-panel) .activity-details {
  padding-top: 10px;
  border-top: 0;
}
#webhooks-panel .webhook-attempt-title {
  margin: 14px 0 6px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Edit bot Marketplace pricing tab and Set pricing rule: mock rows and cards ---------- */
#edit-bot-pricing.pricing-bot-section {
  margin: 0;
  padding: 0;
  border: 0;
}
#edit-bot-pricing .pricing-bot + .pricing-bot {
  margin-top: 14px;
}
.pricing-setting {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, auto);
  align-items: center;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid #2c2c2c;
  font-size: 13px;
}
.pricing-setting__copy strong {
  display: block;
  font-weight: 550;
}
.pricing-setting__copy small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}
.pricing-setting__control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.pricing-setting__control .inventory-select {
  width: 170px;
}
.pricing-setting__control .inventory-select-trigger {
  width: 100%;
  height: 30px;
  min-height: 30px;
  margin: 0;
  font-size: 12px;
}
.pricing-bot__result:empty {
  display: none;
}
/* The rule a bot is on: a pill with the rule's colour, like the mock's badge. */
:is(#edit-bot-dialog, #bot-pricing-dialog) .pricing-rule-badge {
  padding: 1px 7px;
  border: 1px solid #474747;
  border-radius: 999px;
  color: #bdbdbd;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
}
:is(#edit-bot-dialog, #bot-pricing-dialog) .pricing-rule-badge--success {
  border-color: #4f7a5d;
  background: rgb(161 210 178 / 6%);
  color: #a9d6b8;
}
:is(#edit-bot-dialog, #bot-pricing-dialog) .pricing-rule-badge--warning {
  border-color: #7a6440;
  background: rgb(221 194 143 / 6%);
  color: #e2c99d;
}
:is(#edit-bot-dialog, #bot-pricing-dialog) .pricing-rule-badge small {
  color: inherit;
  font-size: 11px;
}
:is(#edit-bot-dialog, #bot-pricing-dialog) .pricing-rule-badge small::before {
  content: '· ';
}
:is(#edit-bot-dialog, #bot-pricing-dialog) .pricing-swatch {
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 50%;
}
#bot-pricing-dialog .pricing-pick-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  margin-top: 8px;
  overflow: auto;
}
#bot-pricing-dialog .pricing-pick {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 7px 12px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #1e1e1e;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 400;
  cursor: pointer;
}
#bot-pricing-dialog .pricing-pick--apply {
  margin-top: 10px;
}
#bot-pricing-dialog .pricing-pick__name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#bot-pricing-dialog .pricing-pick__name strong {
  font-weight: 550;
}
#bot-pricing-dialog .pricing-pick__name small {
  margin-left: 8px;
  color: var(--muted);
  font-size: 11px;
}
#bot-pricing-dialog [data-bulk-note] {
  margin-top: 6px;
  color: #8a8a8a;
}
@media (max-width: 760px) {
  .pricing-setting {
    grid-template-columns: minmax(0, 1fr);
  }
  .pricing-setting__control {
    justify-content: flex-start;
  }
}
#edit-bot-dialog {
  border-color: var(--line);
  border-radius: 12px;
  background: var(--panel);
}
#edit-bot-dialog .dialog__head,
#edit-bot-dialog .dialog__foot {
  background: transparent;
}
:is(#edit-bot-dialog, #bot-pricing-dialog) .pricing-rule-badge small {
  margin-left: -2px;
}

/* ---------- bot panel Overview: errors and warnings as mock rows; the state notice ---------- */
#bot-errors .bot-error-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 4px;
  border-bottom: 1px solid #2c2c2c;
  font-size: 12.5px;
}
#bot-errors .bot-error-row__copy {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#bot-errors .bot-error-row__copy strong {
  font-weight: 550;
}
#bot-errors .bot-error-row__copy span {
  margin-left: 8px;
  color: var(--muted);
  font-size: 11px;
}
#bot-errors .bot-error-row .button {
  flex: none;
}
#bot-notice {
  margin: 0 0 12px;
}
#bot-notice.side-panel__notice--bad {
  border-color: #7d4a4d;
  background: rgb(240 180 180 / 6%);
  color: #f0b4b4;
}

/* ---------- bot panel Diagnostics: the mock's fact cards and section titles ---------- */
#bot-panel #bot-diagnostics.diagnostics-content {
  padding: 0;
}
#bot-diagnostics .diagnostic-status {
  margin: 0 0 8px;
  color: #8a8a8a;
  font-size: 12px;
}
#bot-diagnostics .diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}
#bot-diagnostics .diagnostic-grid:empty {
  display: none;
}
#bot-diagnostics .diagnostic-metric {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: 7px 12px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #1e1e1e;
}
#bot-diagnostics .diagnostic-metric > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#bot-diagnostics .diagnostic-metric > strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#bot-diagnostics .diagnostic-section {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
#bot-diagnostics .diagnostic-warning {
  margin: 12px 0 0;
  padding: 9px 12px;
  border: 1px solid #7a6440;
  border-radius: 8px;
  background: rgb(221 194 143 / 6%);
  color: #e2c99d;
  font-size: 12.5px;
}
#bot-diagnostics .diagnostic-footnote {
  margin: 12px 0 0;
  color: #8a8a8a;
  font-size: 12px;
}

/* Tracked items in the offer panel: one card per item with its history as a timeline. */
#offer-detail-content .acquisition-cards {
  display: grid;
  gap: 10px;
}
#offer-detail-content .acquisition-card {
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid #333;
  border-radius: 8px;
  background: #222;
}
.acquisition-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.acquisition-card__title {
  display: flex;
  align-items: center;
  min-width: 0;
}
.acquisition-card__name {
  min-width: 0;
  font-size: 13px;
  font-weight: 550;
  overflow-wrap: anywhere;
}
#offer-detail-content .acquisition-card__line {
  margin: 0 0 2px;
  color: #a3a3a3;
  font-size: 12px;
  overflow-wrap: anywhere;
}
#offer-detail-content .acquisition-card .acquisition-history {
  max-width: none;
  margin-top: 8px;
}
#offer-detail-content .acquisition-card .acquisition-history > summary {
  margin-bottom: 8px;
}
/* The old history list rules must not reshape the timeline steps. */
#offer-detail-content .acquisition-card .acquisition-history ol {
  display: block;
  margin: 0;
}
#offer-detail-content .acquisition-card .acquisition-history li {
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 12px;
  font-size: 13px;
}
