/* Full-width pages and spreadsheet-style tables for Inventory, Trades, Bots and Sales. */

/* Every page uses the whole main area instead of a centered column. */
.catalog-view,
.fleet-inventory-view,
.page-view,
.fleet-page,
#bot-content {
  max-width: none;
}
.catalog-view,
.fleet-inventory-view,
.page-view,
.fleet-page {
  padding: 20px 24px;
}

/* Compact header: title on the left, small stat tiles across the rest of the row. */
.dense-view {
  padding: 14px 20px 18px;
}
.dense-view > .page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 10px;
}
.dense-view > .page-header > div:first-child {
  flex: 0 0 auto;
}
.dense-view > .page-header h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}
.dense-view > .page-header .eyebrow,
.dense-view > .page-header > div:first-child > .muted {
  display: none;
}
.dense-view > .page-header > .button {
  margin-left: auto;
}
.dense-view .stat-grid {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.dense-view > .stat-grid {
  margin: 0 0 10px;
}
.dense-view .stat-card {
  flex: 1 1 150px;
  max-width: 260px;
  padding: 6px 12px;
  border-radius: 8px;
}
.dense-view .stat-card__label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dense-view .stat-card__value {
  margin: 1px 0 0;
  font-size: 15px;
  line-height: 1.3;
}
.dense-view .stat-card__detail {
  overflow: hidden;
  max-width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dense-view .filter-card {
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px;
  border-radius: 8px;
}
.dense-view .filter-card input,
.dense-view .filter-card select,
.dense-view .filter-card .inventory-select-trigger,
.dense-view .filter-card .button {
  height: 30px;
  min-height: 30px;
  font-size: 12px;
}
.dense-view .fleet-filter-bar.filter-card input {
  height: 30px;
}
.dense-view .fleet-filter-bar.filter-card > label {
  flex-basis: 170px;
}
.dense-view .fleet-filter-bar.filter-card > label > * {
  font-size: 12px;
}
/* The top toolbar search already covers it; the duplicate table search only takes height. */
.dense-view .inventory-table-heading {
  display: none;
}
.dense-view .table-card {
  border-radius: 8px;
}
.dense-view .table-card__head {
  padding: 8px 12px;
}
.dense-view .table-card__head small {
  display: inline;
  margin: 0 0 0 8px;
}
.dense-view .table-card__head strong {
  display: inline;
  font-size: 13px;
}

/* Spreadsheet table: ~28px single-line rows, 12px text, thin borders, sticky header. */
.dense-view .table-wrap:has(> table.dense) {
  max-height: calc(100vh - 210px);
  overflow: auto;
}
table.dense {
  min-width: 100%;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
table.dense thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 6px 6px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  font-size: 10.5px;
  white-space: nowrap;
}
table.dense thead tr.column-filters th {
  top: 28px;
  padding: 3px 4px 5px;
  font-size: 11px;
}
table.dense .column-filters input {
  width: 100%;
  min-width: 40px;
  height: 22px;
  min-height: 22px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
}
table.dense .column-filters th.numeric input {
  text-align: right;
}
table.dense .table-sort {
  font-size: inherit;
  white-space: nowrap;
}
table.dense tbody td,
table.dense tbody td * {
  white-space: nowrap;
}
table.dense tbody td {
  height: 28px;
  padding: 3px 6px;
  border-bottom: 1px solid #2c2c2c;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  vertical-align: middle;
}
table.dense tbody tr:hover {
  background: #262626;
}
table.dense td .mono,
table.dense td.mono {
  font-size: 11.5px;
}
table.dense .badge {
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  line-height: 1.5;
}
table.dense .bot-link {
  min-height: 0;
  padding: 1px 6px;
  font-size: 11.5px;
}
/* Stacked secondary lines sit beside the primary value instead of below it. */
table.dense td > strong + small,
table.dense td > strong + .subline,
table.dense td > .badge + small {
  display: inline;
  margin: 0 0 0 6px;
}
table.dense td > strong {
  font-weight: 600;
}

/* Inventory item cell: tiny icon + rarity-colored name that opens details. */
#fleet-inventory-items td {
  padding-block: 3px;
}
table.dense td.fleet-item {
  max-width: 320px;
  overflow: hidden;
  padding-left: 6px;
  border-left: 3px solid var(--rarity, transparent);
  text-overflow: ellipsis;
}
table.dense .fleet-item-icon {
  width: 24px;
  height: 18px;
  margin: 0 6px 0 0;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  vertical-align: middle;
}
table.dense .fleet-item-name {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: color-mix(in srgb, var(--rarity, var(--text)) 45%, var(--text));
  font: inherit;
  font-weight: 500;
  text-align: left;
  vertical-align: middle;
  cursor: pointer;
}
table.dense .fleet-item-name:hover {
  text-decoration: underline;
}
table.dense .fleet-item .item-phase,
table.dense .fleet-item .item-purchase {
  margin-left: 6px;
  vertical-align: middle;
}

table.dense .dense-float {
  min-width: 112px;
}
table.dense .dense-float__bar {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 3px;
  margin: 0 6px 2px 0;
  border-radius: 2px;
  background: linear-gradient(
    to right,
    #69b67c 0 7%,
    #a8be68 7% 15%,
    #d1b563 15% 38%,
    #ce8b57 38% 45%,
    #bb6565 45%
  );
  opacity: 0.8;
  vertical-align: middle;
}
table.dense .dense-float__bar::after {
  position: absolute;
  top: -3px;
  left: var(--wear);
  width: 2px;
  height: 9px;
  border-radius: 1px;
  background: var(--text);
  content: '';
}
table.dense .dense-stickers img {
  margin-right: 2px;
  vertical-align: middle;
  object-fit: contain;
}
table.dense .dense-count {
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
}
table.dense .dense-flag {
  text-align: center;
  font-weight: 700;
}
table.dense .dense-flag--yes {
  color: var(--success);
}
table.dense .dense-flag--no {
  color: var(--danger);
}

/* Trades: bot/offer, origin, items and state on one line. */
table.dense .offer-items-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 28px;
}
table.dense .offer-side {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}
/* An empty side ("Send Nothing") adds width without information; the other side says it all. */
table.dense .offer-side:has(> .offer-side__thumbs > .muted:only-child) {
  display: none;
}
table.dense .offer-side__label {
  color: var(--muted);
  font-size: 10.5px;
}
table.dense .offer-side__thumbs {
  display: inline-flex;
  gap: 2px;
}
table.dense .offer-side__thumbs img {
  width: 24px;
  height: 18px;
  padding: 0;
  object-fit: contain;
  border-radius: 3px;
}
table.dense .offer-side__value {
  min-width: 0;
  font-size: 12px;
}
table.dense .offer-net {
  margin: 0;
  padding: 0 5px;
  font-size: 10.5px;
}
table.dense .offer-status__badges,
table.dense .trade-origin {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
}
table.dense td.trade-origin,
table.dense td.offer-status {
  display: table-cell;
  min-width: 0;
  max-width: none;
}
table.dense .trade-origin > * {
  display: inline-block;
  margin: 0 4px 0 0;
  vertical-align: middle;
}
table.dense .offer-status__badges .offer-countdown {
  display: inline-block;
  margin-left: 4px;
  white-space: nowrap;
}
table.dense .offer-status__badges .subline {
  margin: 0;
  font-size: 11px;
}

/* Bots: name, status and health on one line. */
.bot-identity {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  vertical-align: middle;
  white-space: nowrap;
}
.bot-identity__login {
  font-size: 11px;
  font-weight: 400;
}
.trade-bot__offer {
  margin-left: 8px;
  font-size: 11px;
}
table.dense td.home-bot-name {
  display: table-cell;
}
table.dense td.home-bot-name .signal {
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
}
table.dense td.home-bot-name .subline {
  display: inline;
  margin-left: 6px;
}
/* Bots: one line per bot, like Trades; details stay in the hints. */
table.dense .home-bot-name__proxy {
  margin-left: 8px;
  font-size: 11px;
}
table.dense td.home-bot-status {
  white-space: nowrap;
}
.home-bot-health {
  margin-left: 8px;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.home-bot-health--success {
  color: #a1d2b2;
}
.home-bot-health--warning {
  color: #ddc28f;
}
.home-bot-health--danger {
  color: #edaaaa;
}
.home-bot-health--muted {
  color: var(--muted);
}
.home-sync-time--warning {
  color: #ddc28f;
}
table.dense td.home-bot-value small {
  margin-left: 8px;
  font-size: 11px;
}
table.dense .bot-health {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 120px;
}
table.dense .bot-health__summary {
  display: flex;
  gap: 4px;
  font-size: 11.5px;
}
table.dense .bot-health__bar {
  width: 60px;
  margin: 0;
}
table.dense .share-bar,
table.dense .value-share {
  margin: 0;
}

/* Sales: item details and profit percentages beside their values. */
table.dense td.catalog-item-name {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#sales-view .sales-connector {
  gap: 8px 12px;
  padding: 6px 10px;
  margin: 0 0 8px;
  border-radius: 8px;
  font-size: 12px;
}
#sales-connections {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
}
#sales-view .sales-connection {
  gap: 6px;
  font-size: 12px;
  min-width: 0;
}
#sales-view .sales-connection small {
  flex-basis: auto;
  max-width: 460px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}
#sales-view .sales-connector > .button {
  min-height: 26px;
  padding: 3px 10px;
  font-size: 12px;
}
#sales-table th,
#sales-table td {
  text-align: left;
}
#sales-table .numeric,
#sales-table th:nth-child(n + 7):nth-child(-n + 10) {
  text-align: right;
}
#sales-table .sales-item {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}
#sales-table .sales-item a {
  font-weight: 600;
}
#sales-table .sales-bot > * + *,
#sales-table .sales-provider-cell > * + * {
  display: inline;
  margin: 0 0 0 6px;
  font-size: 11px;
}
#sales-table a {
  color: inherit;
  text-decoration: none;
}
#sales-table a:hover,
#sales-table a:focus-visible {
  color: var(--text);
  text-decoration: underline;
}
#sales-table .sales-bot a,
#sales-table .sales-receipt {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
#sales-view .table-wrap {
  max-height: calc(100vh - 295px);
}
@media (max-width: 980px) {
  #sales-view .table-wrap {
    max-height: none;
  }
}

/* Pager under dense tables. */
.dense-view .inventory-pagination,
.dense-view .pagination {
  gap: 8px;
  padding: 6px 12px;
  font-size: 12px;
}
.dense-view .inventory-pagination .button,
.dense-view .pagination .button {
  min-height: 26px;
  padding: 3px 10px;
  font-size: 12px;
}

@media (max-width: 980px) {
  .dense-view > .page-header {
    flex-wrap: wrap;
  }
  .dense-view .stat-grid {
    flex-basis: 100%;
    order: 3;
  }
  .dense-view .table-wrap:has(> table.dense) {
    max-height: none;
  }
}

/* Shared listing columns and compact bot / trade detail views. */
.price-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
}
.market-picker {
  position: relative;
  font-size: 12px;
  flex: 0 0 auto;
}
.market-picker > summary {
  cursor: pointer;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  background: var(--panel);
}
.market-picker__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 5px);
  z-index: 30;
  display: grid;
  gap: 7px;
  width: 245px;
  padding: 14px;
  background: #222;
  border: 1px solid #444;
  border-radius: 8px;
  box-shadow: 0 12px 30px #0008;
}
.market-picker__menu label {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}
.market-picker__menu input {
  width: 14px;
  height: 14px;
  min-height: 0;
  margin: 0;
}
.market-picker__menu small {
  font-size: 11px;
  line-height: 1.4;
  margin-bottom: 4px;
}
.market-column {
  min-width: 76px;
}
.market-column--warning {
  color: var(--warning, #ddc28f);
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.market-side-total {
  display: block;
  font-size: 11px;
}
/* Hidden cells must stay out of layout even when component styles set display. */
table.dense [hidden] {
  display: none !important;
}
table.dense .offer-reason {
  display: none;
}
table.dense .offer-request-id {
  display: none;
}
table.dense .price-directions {
  display: flex;
  gap: 10px;
  min-width: 0;
}
table.dense .price-direction {
  display: flex;
  gap: 4px;
  align-items: center;
}
table.dense .price-direction-label {
  min-width: 0;
  font-size: 10px;
}
table.dense .price-value {
  font-size: 12px;
}
table.dense .price-confidence,
table.dense .price-risk-score {
  display: none;
}
table.dense .price-summary {
  gap: 4px;
}
table.dense .button {
  min-height: 22px;
  padding: 2px 6px;
  font-size: 11px;
}
table.dense .empty-inline,
table.dense .empty-table {
  padding: 24px;
  text-align: center;
}
table.dense .fleet-item-name.item-inspect-trigger {
  margin: 0;
  font-size: 12px;
  text-decoration: none;
}
table.dense .fleet-item-name.item-inspect-trigger:hover {
  text-decoration: underline;
}
.bot-detail-view .back-link {
  margin-bottom: 8px;
  font-size: 12px;
}
.bot-detail-view .bot-heading {
  margin-bottom: 10px;
  align-items: center;
}
.bot-detail-view .bot-heading h2 {
  font-size: 22px;
}
.bot-detail-view .bot-heading .eyebrow {
  display: none;
}
.bot-detail-view .bot-heading p {
  margin: 4px 0 0;
  font-size: 11px;
}
.bot-detail-view .bot-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border-radius: 8px;
}
.bot-detail-view .bot-summary .section-heading {
  display: none;
}
.bot-detail-view .freshness {
  margin: 0;
  padding: 0;
  font-size: 12px;
}
.bot-detail-view .freshness strong {
  font-size: 13px;
}
.bot-detail-view .bot-errors {
  flex: 1 1 240px;
  margin: 0;
  font-size: 12px;
}
.bot-detail-view .bot-errors p {
  margin: 0;
}
.bot-detail-view .summary-cards {
  display: flex;
  flex-wrap: wrap;
  flex: 1 0 100%;
  gap: 6px;
}
.bot-detail-view .summary-card {
  flex: 1 1 150px;
  padding: 6px 10px;
  border-radius: 5px;
  align-items: center;
}
.bot-detail-view .summary-card span {
  font-size: 11px;
}
.bot-detail-view .summary-card strong {
  font-size: 16px;
}
.bot-detail-view #bot-content > .tabs {
  margin: 0 0 10px;
  gap: 4px;
}
.bot-detail-view .tabs button {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
}
.bot-detail-view .panel {
  border-radius: 8px;
}
.bot-detail-view .panel__head {
  padding: 10px 12px;
  gap: 12px;
}
.bot-detail-view .panel__head h3 {
  font-size: 14px;
}
.bot-detail-view .panel__head p {
  margin: 3px 0 0;
  font-size: 11px;
}
.bot-detail-view .button {
  min-height: 28px;
  padding: 4px 10px;
  font-size: 12px;
}
.bot-detail-view .inventory-filters {
  padding: 7px 10px;
  gap: 8px;
}
.bot-detail-view .inventory-filters input,
.bot-detail-view .inventory-filters select,
.bot-detail-view .inventory-select-trigger {
  min-height: 30px;
  height: 30px;
  font-size: 12px;
}
.bot-detail-view .table-wrap:has(> table.dense) {
  max-height: calc(100vh - 365px);
}
.bot-detail-view .bot-notes {
  margin-top: 6px;
  max-width: 720px;
}
.bot-detail-view .bot-notes p {
  white-space: pre-wrap;
}

#page-view:has(> .trade-dialog) {
  padding: 14px 20px 18px;
}
#page-view > .trade-dialog .dialog__head {
  padding-bottom: 12px;
}
#page-view > .trade-dialog .dialog__head h2 {
  font-size: 22px;
  margin: 3px 0;
}
#page-view > .trade-dialog .dialog__body {
  padding: 0;
  border: 0;
  background: transparent;
}
#page-view > .trade-dialog .dialog__foot {
  margin-top: 10px;
}
#offer-detail-content {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.trade-overview--compact,
.trade-items-section,
.trade-detail-grid > .trade-section,
.trade-commerce,
.trade-acquisitions,
.trade-technical {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  min-width: 0;
}
.trade-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.trade-status-line > .button {
  margin-left: auto;
}
.trade-source-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.trade-status-line .offer-status__badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.trade-status-line .offer-countdown {
  margin: 0;
  font-size: 12px;
}
.trade-status-line .offer-reason {
  flex-basis: 100%;
}
#offer-detail-content .trade-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 20px;
  margin: 0;
}
#offer-detail-content .trade-facts dt {
  font-size: 11px;
  margin-bottom: 4px;
}
#offer-detail-content .trade-facts dd {
  font-size: 12px;
  margin: 0;
  overflow-wrap: anywhere;
}
.trade-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 10px;
}
#offer-detail-content h3 {
  margin: 0 0 7px;
  font-size: 13px;
}
#offer-detail-content p,
.trade-section-heading small {
  font-size: 12px;
  line-height: 1.5;
}
#offer-detail-content p {
  margin: 0 0 10px;
}
.trade-items-section {
  padding: 0;
}
.trade-items-section .trade-section-heading {
  padding: 12px;
  margin: 0;
}
.trade-items-table td {
  height: 34px !important;
}
.trade-items-table .fleet-item {
  max-width: 440px;
}
.trade-item-side {
  color: var(--muted);
  font-size: 11px !important;
}
.trade-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-width: 0;
}
.trade-technical > summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
}
.trade-technical[open] > summary {
  margin-bottom: 14px;
}
.trade-commerce-table .sales-trade-links {
  display: table-cell;
}
.trade-commerce-table .sales-trade-links a {
  display: block;
}
#offer-detail-actions:has(.offer-actions > .muted:only-child) .offer-actions {
  display: none;
}
@media (max-width: 980px) {
  .trade-detail-grid {
    grid-template-columns: 1fr;
  }
  .bot-detail-view .table-wrap:has(> table.dense) {
    max-height: 65vh;
  }
  .trade-section-heading {
    flex-wrap: wrap;
  }
  .bot-detail-view .bot-heading {
    flex-wrap: wrap;
  }
}
table.dense .price-trigger {
  min-height: 0;
  padding: 0;
  gap: 4px;
}
table.dense .price-trigger strong {
  font-size: 12px;
}
table.dense .price-trigger > .badge {
  display: none;
}
#items-body > tr > td,
#offers-body > tr > td {
  padding-block: 3px;
}
#bot-inventory-table .price-trigger,
.trade-items-table .price-trigger {
  display: inline-flex;
  width: auto;
  min-width: 0;
}
.bot-detail-view .inventory-filters select {
  padding-block: 3px;
}
.bot-detail-view .inventory-filters {
  align-items: center;
}
#inventory-panel .market-picker__menu label > span,
#inventory-panel .market-picker__menu > strong,
#offers-panel .market-picker__menu label > span {
  display: inline;
}
#inventory-panel .market-picker__menu label,
#offers-panel .market-picker__menu label {
  font-size: 12px;
}
#items-body .price-directions,
#catalog-items .price-directions {
  display: flex;
  width: max-content;
  gap: 12px;
}
#items-body .price-trigger,
#catalog-items .price-trigger {
  display: inline-flex;
  gap: 4px;
  padding: 0;
}
#items-body .price-trigger strong,
#catalog-items .price-trigger strong {
  white-space: nowrap;
}
.market-picker__menu {
  max-height: min(420px, 65vh);
  overflow-y: auto;
}

/* The catalog and overview share the density of the fleet tables. */
#price-catalog-view > .catalog-sync {
  gap: 8px;
  margin-bottom: 0;
}
#price-catalog-view .catalog-feed {
  min-width: 0;
  padding: 8px 12px;
  border-radius: 8px;
}
#price-catalog-view .catalog-feed-heading {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: 12px;
}
#price-catalog-view .catalog-feed-age {
  margin-left: auto;
  font-size: 11px;
}
#price-catalog-view .catalog-feed-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  margin-top: 4px;
}
#price-catalog-view .catalog-feed small,
#price-catalog-view .catalog-feed-details {
  font-size: 11px;
}
#price-catalog-view .catalog-feed-details summary {
  color: var(--muted);
  cursor: pointer;
}
#price-catalog-view .catalog-feed-details[open] {
  flex-basis: 100%;
}
#price-catalog-view .catalog-feed-details__body {
  margin-top: 4px;
  line-height: 1.5;
}
#price-catalog-view .catalog-risk-coverage {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 11px;
}
#price-catalog-view #catalog-schedule {
  margin: 5px 0 10px;
  font-size: 10.5px;
}
#price-catalog-view .filter-card > label:not(.search) {
  flex: 0 1 170px;
}
#price-catalog-view .table-wrap {
  max-height: calc(100vh - 300px);
}
#price-catalog-view .catalog-date {
  font-size: 11px;
}

.home-view.dense-view {
  gap: 10px;
}
.home-view.dense-view .home-header {
  align-items: center;
  gap: 12px;
}
.home-view.dense-view .home-header h1 {
  font-size: 20px;
}
.home-view.dense-view .home-header p {
  margin: 3px 0 0;
  font-size: 11px;
}
.home-view.dense-view .home-header__actions {
  gap: 8px;
}
.home-view.dense-view .home-refresh {
  width: 28px;
  height: 28px;
}
.home-view.dense-view .segmented button {
  min-height: 24px;
  height: 24px;
  padding: 2px 8px;
  font-size: 11px;
}
.home-view.dense-view .kpi-row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}
.home-view.dense-view .kpi-card {
  padding-top: 8px;
  border-radius: 8px;
}
.home-view.dense-view .kpi-card__label {
  padding: 0 10px;
  font-size: 10px;
}
.home-view.dense-view .kpi-card__value {
  margin: 4px 0 0;
  padding: 0 10px;
  font-size: 18px;
}
.home-view.dense-view .kpi-card__detail {
  margin: 2px 0 0;
  padding: 0 10px;
  font-size: 10.5px;
}
.home-view.dense-view .kpi-card__spark {
  margin-top: 4px;
  height: 30px;
}
.home-charts {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 10px;
}
.home-view.dense-view .chart-card,
.home-view.dense-view .home-card {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
}
.home-view.dense-view .chart-card__head,
.home-view.dense-view .home-card > header {
  margin-bottom: 8px;
  gap: 8px;
}
.home-view.dense-view h3 {
  font-size: 13px;
}
.home-view.dense-view .chart-card__head p {
  margin: 3px 0 0;
  font-size: 11px;
}
.home-view.dense-view .chart-legend {
  gap: 12px;
  margin-bottom: 6px;
  font-size: 11px;
}
.home-view.dense-view .stat-grid {
  gap: 6px;
  margin: 0 0 8px;
}
.home-view.dense-view #home-availability-now {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.home-view.dense-view #home-availability-now .stat-card {
  padding: 5px 6px;
  border-radius: 5px;
}
.home-view.dense-view #home-availability-now .stat-card__label {
  font-size: 9px;
  white-space: normal;
}
.home-view.dense-view #home-availability-now .stat-card__detail {
  display: none;
}
.home-inventory__body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}
.home-view.dense-view #home-value-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}
.home-view.dense-view #home-value-cards .value-card {
  padding: 8px 10px;
  border-radius: 6px;
}
.home-view.dense-view #home-value-cards .value-card__label {
  font-size: 11px;
}
.home-view.dense-view #home-value-cards .value-card__value {
  font-size: 17px;
  margin: 4px 0 0;
}
.home-view.dense-view #home-value-cards .value-card__detail {
  font-size: 10.5px;
  margin: 3px 0 0;
}
.home-view.dense-view .unlock-schedule {
  padding: 0;
  margin: 0;
}
.home-view.dense-view .unlock-schedule header {
  gap: 4px 10px;
  margin-bottom: 8px;
}
.home-view.dense-view #unlock-summary {
  font-size: 10.5px;
}
.unlock-unit {
  margin: 3px 0 0;
  font-size: 10.5px;
}
.unlock-chart {
  min-width: 0;
}
.bar-chart {
  display: block;
  max-width: 100%;
  overflow: visible;
}
.bar-chart__hit {
  fill: transparent;
}
.bar-chart__bar {
  fill: #b09b75;
  fill-opacity: 0.8;
}
.bar-chart__value {
  fill: #c6c6c6;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.bar-chart__day[role='button'] {
  cursor: pointer;
  outline: none;
}
.bar-chart__day:hover .bar-chart__hit,
.bar-chart__day:focus-visible .bar-chart__hit {
  fill: #ffffff05;
}
.bar-chart__day:hover .bar-chart__bar,
.bar-chart__day:focus-visible .bar-chart__bar {
  fill-opacity: 1;
}
.bar-chart__day:focus-visible .bar-chart__hit {
  stroke: #b09b75;
}
.home-view.dense-view .home-offers {
  border-radius: 8px;
}
.home-view.dense-view .home-offers .table-card__head p {
  margin: 3px 0 0;
  font-size: 11px;
}
.home-view.dense-view .home-offers .table-wrap {
  max-height: 310px;
}
.home-view.dense-view .home-row {
  gap: 10px;
}
.home-view.dense-view .home-list__row {
  gap: 8px;
  padding: 5px 2px;
  border-radius: 4px;
}
.home-view.dense-view .home-list__copy strong,
.home-view.dense-view .home-list__value {
  font-size: 12px;
}
.home-view.dense-view .home-list__copy small {
  font-size: 10.5px;
}
.home-view.dense-view .home-thumb {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}
.home-view.dense-view .home-attention > summary {
  padding: 8px 12px;
  font-size: 12px;
}
.home-view.dense-view .home-attention .panel-note {
  margin: 0;
  padding: 0 12px 8px;
  font-size: 11px;
}
@media (max-width: 1200px) {
  .home-view.dense-view .kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .home-charts,
  .home-inventory__body {
    grid-template-columns: minmax(0, 1fr);
  }
  .home-view.dense-view #home-value-cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (max-width: 700px) {
  .home-view.dense-view .home-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .home-view.dense-view .kpi-row,
  .home-view.dense-view #home-value-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #price-catalog-view .catalog-sync {
    grid-template-columns: minmax(0, 1fr);
  }
  #price-catalog-view .table-wrap {
    max-height: none;
  }
}

.home-view.dense-view .home-thumb img {
  width: 24px;
  height: 24px;
}
#price-catalog-view .catalog-feed .badge {
  font-size: 10.5px;
  padding: 1px 6px;
}

#catalog-items td {
  padding: 3px 6px;
}
#catalog-items .catalog-date {
  min-width: 88px;
}

.unlock-empty {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 136px;
  padding: 12px 0;
}
.unlock-empty p {
  margin: 0;
  font-size: 12px;
}
.unlock-note {
  margin: 8px 0 0;
  font-size: 10.5px;
  line-height: 1.5;
}

/* Price column pickers sit in their table header instead of an empty band above the columns. */
.table-card__head:has(> .price-toolbar) {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.table-card__head > div:first-child {
  min-width: 0;
}
.table-card__head > .price-toolbar {
  flex: none;
  padding: 0;
  border: 0;
}

/* Wide tables scroll inside their card with a visible scrollbar (macOS overlay scrollbars hide
 * the standard one entirely), and the inventory keeps its item column in view. */
.table-card .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-color: auto;
  scrollbar-width: auto;
}
.table-card .table-wrap::-webkit-scrollbar {
  height: 10px;
}
.table-card .table-wrap::-webkit-scrollbar-track {
  background: #191919;
}
.table-card .table-wrap::-webkit-scrollbar-thumb {
  background-color: #4a4a4a;
}
.table-scroll-note {
  margin: 0;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.fleet-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}
.fleet-table-scroll {
  display: flex;
  gap: 4px;
  margin: 0 8px 4px;
}
#trades-table :is(thead tr > :first-child, .trade-bot) {
  position: sticky;
  inset-inline-start: 0;
  background: var(--panel);
  box-shadow: 1px 0 0 var(--line);
}
#trades-table thead tr > :first-child {
  z-index: 3;
}
#trades-table .trade-bot {
  z-index: 1;
}
#trades-table tbody tr:hover .trade-bot {
  background: var(--panel-raised);
}

:is(#trades-view, #fleet-inventory-view) .table-wrap:has(> table.dense) {
  max-height: min(58vh, 36rem);
}

.table-wrap[tabindex='0']:focus-visible {
  outline: 1px solid var(--focus, #b6c3e0);
  outline-offset: -1px;
}

#fleet-inventory-table {
  --fleet-select-width: 42px;
}

#fleet-inventory-table :is(th, td):nth-child(-n + 2) {
  position: sticky;
  z-index: 1;
  background: #202020;
  box-shadow: 1px 0 0 var(--line);
}
#fleet-inventory-table :is(th, td):first-child {
  inset-inline-start: 0;
  box-sizing: border-box;
  width: var(--fleet-select-width);
  min-width: var(--fleet-select-width);
  max-width: var(--fleet-select-width);
}
#fleet-inventory-table :is(th, td):nth-child(2) {
  inset-inline-start: var(--fleet-select-width);
}
#fleet-inventory-table thead th:nth-child(-n + 2) {
  z-index: 3;
}
#fleet-inventory-table tbody tr:hover td:nth-child(-n + 2) {
  background: #262626;
}
#fleet-inventory-table td.fleet-item {
  max-width: 300px;
}
#fleet-inventory-table .fleet-item-name {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}
/* Room for the purchase chip on the same line. */
#fleet-inventory-table td.fleet-item:has(.item-purchase) .fleet-item-name {
  max-width: 180px;
}

/* Toolbars and stat rows never force the page wider than the viewport. */
.filter-card > *,
.stat-grid > *,
.kpi-row > *,
.catalog-view,
.table-card {
  min-width: 0;
}
.fleet-filter-bar.filter-card {
  flex-wrap: wrap;
}
.dense-view .fleet-filter-bar.filter-card > label:not(:first-child) {
  flex: 1 1 150px;
  max-width: 200px;
}
.stat-card__detail {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Edge shadows show when a table can scroll further left or right. */
.table-card .table-wrap {
  background:
    linear-gradient(to right, #202020 40%, rgb(32 32 32 / 0%)) left / 36px 100% no-repeat local,
    linear-gradient(to left, #202020 40%, rgb(32 32 32 / 0%)) right / 36px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgb(0 0 0 / 90%), transparent) left / 18px 100%
      no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgb(0 0 0 / 90%), transparent) right / 18px 100%
      no-repeat scroll;
}

/* Disclosure rows use the same chevron as settings sections instead of the raw triangle. */
:is(.market-picker, .footnote) > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}
:is(.market-picker, .footnote) > summary::-webkit-details-marker {
  display: none;
}
:is(.market-picker, .footnote) > summary::after {
  flex: none;
  width: 10px;
  height: 10px;
  background: var(--chevron) center / 10px no-repeat;
  content: '';
  transition: transform 0.15s var(--ease, ease);
}
:is(.market-picker, .footnote)[open] > summary::after {
  transform: rotate(180deg);
}
/* In a filter toolbar the picker is just the last control on the row. */
.inventory-filters > .price-toolbar {
  flex: none;
  margin-left: auto;
  padding: 0;
  border: 0;
}
@media (max-width: 640px) {
  #fleet-inventory-table td.fleet-item {
    max-width: 132px;
  }
  #fleet-inventory-table td.fleet-item .fleet-item-name {
    max-width: 118px;
  }
  #fleet-inventory-table .fleet-item > :not(.fleet-item-name) {
    display: none;
  }
  #trades-table .trade-bot {
    min-width: 94px;
    max-width: 100px;
  }
  #trades-table .bot-identity {
    max-width: 100%;
  }
  #trades-table .bot-identity > strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #trades-table .trade-bot__offer {
    display: block;
    margin-inline-start: 0;
  }
  #trades-table .offer-status__badges {
    flex-wrap: wrap;
    width: 88px;
  }
  #trades-table .offer-items-cell {
    display: table-cell;
    min-width: 144px;
    max-width: 168px;
  }
  #trades-table .offer-side {
    align-items: baseline;
  }
  #trades-table .offer-side__thumbs {
    display: none;
  }
  #trades-table .offer-side__value {
    white-space: normal;
  }
}

.acquisition-history {
  max-width: 420px;
}
.acquisition-history > summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.acquisition-history ol {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}
.acquisition-history li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.trade-acquisitions-table td:last-child {
  min-width: 260px;
  white-space: normal;
}
table.dense tbody td .acquisition-history li,
table.dense tbody td .acquisition-history .acquisition-history__detail {
  white-space: normal;
}
.acquisition-history__detail {
  overflow-wrap: anywhere;
}

/* Caller metadata is free text: wrap it instead of widening the table. */
table.dense tbody td.acquisition-metadata,
table.dense tbody td .item-metadata {
  max-width: 320px;
  white-space: normal;
  overflow-wrap: anywhere;
}
