/* Polish layer on top of graphite.css: depth, motion and consistent controls.
   Same graphite palette; motion is disabled for reduced-motion users. */
:root {
  --focus: #9fb9e8;
  --highlight: inset 0 1px 0 rgb(255 255 255 / 4%);
  --lift: 0 1px 2px rgb(0 0 0 / 30%), 0 10px 28px -14px rgb(0 0 0 / 60%);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a3a3a3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Scrollbars */
* {
  scrollbar-color: #3f3f3f transparent;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #3a3a3a padding-box;
  border: 3px solid transparent;
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background-color: #4b4b4b;
}

.workspace {
  background:
    radial-gradient(1100px 420px at 50% -12%, rgb(255 255 255 / 2.5%), transparent 70%), var(--bg);
}

/* Top bar */
.topbar {
  background: linear-gradient(180deg, #1f1f1f, #1b1b1b);
  box-shadow: 0 1px 0 rgb(0 0 0 / 35%);
}
.workspace-nav {
  gap: 2px;
  padding: 3px;
  border: 1px solid #333;
  border-radius: 11px;
  background: #1c1c1c;
}
.workspace-nav button {
  min-height: 30px;
  border-radius: 8px;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease;
}
.workspace-nav button:hover:not([aria-current='page']) {
  background: #292929;
  border-color: transparent;
}
.workspace-nav button[aria-current='page'] {
  color: #f3f3f3;
  background: #333;
  border-color: #474747;
  box-shadow:
    var(--highlight),
    0 1px 2px rgb(0 0 0 / 40%);
}

/* Sidebar */
.fleet-summary {
  gap: 6px;
  overflow: visible;
}
.fleet-summary div,
.fleet-summary div + div {
  padding: 8px 10px;
  border: 1px solid #383838;
  border-radius: 9px;
  background: #212121;
  box-shadow: var(--highlight);
}
.fleet-summary strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.bot-row {
  position: relative;
}
.bot-row--selected {
  background: #313131;
  border-color: #474747;
  box-shadow: var(--highlight);
}
.bot-row--selected::before {
  content: '';
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: -8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #e7e7e7;
}
@media (max-width: 980px) {
  .bot-row--selected::before {
    display: none;
  }
}
.signal--success {
  box-shadow: 0 0 0 3px rgb(161 210 178 / 14%);
}
.signal--warning {
  box-shadow: 0 0 0 3px rgb(221 194 143 / 14%);
}
.signal--danger {
  box-shadow: 0 0 0 3px rgb(237 170 170 / 14%);
}
.bot-row__count {
  font-variant-numeric: tabular-nums;
}

/* Bot heading */
.bot-heading h2 {
  font-size: 30px;
  letter-spacing: -0.035em;
}
.bot-heading .bot-buy-value:not(:empty) {
  padding: 3px 9px;
  border: 1px solid #404040;
  border-radius: 999px;
  background: #242424;
  color: #d6d6d6;
  font-size: 12px;
}

/* Surfaces */
.panel,
.metric,
.dialog {
  box-shadow: var(--highlight);
}
.panel__head {
  background: linear-gradient(180deg, rgb(255 255 255 / 1.5%), transparent);
}
.metric {
  background: linear-gradient(180deg, #252525, #202020);
  transition: border-color 150ms ease;
}
.metric:hover {
  border-color: #4a4a4a;
}
.metric span {
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.metric strong {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.summary-cards {
  gap: 8px;
}
.summary-card {
  min-height: 50px;
  padding: 10px 12px;
  border-color: #383838;
  border-radius: 9px;
  background: #212121;
  box-shadow: var(--highlight);
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    transform 150ms var(--ease);
}
.summary-card:hover {
  background: #292929;
  border-color: #585858;
  transform: translateY(-1px);
}
.summary-card strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Needs attention */
.attention-panel > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
}
.attention-panel > summary::-webkit-details-marker {
  display: none;
}
.attention-panel > summary::before {
  content: '';
  width: 6px;
  height: 6px;
  margin: 0 2px;
  border-right: 1.5px solid #a3a3a3;
  border-bottom: 1.5px solid #a3a3a3;
  transform: rotate(-45deg);
  transition: transform 180ms var(--ease);
}
.attention-panel[open] > summary::before {
  transform: rotate(45deg);
}
.attention-panel[data-has-issues='true'] {
  border-color: #5a4d38;
  background: linear-gradient(90deg, rgb(221 194 143 / 6%), transparent 45%), #202020;
}
.attention-panel[data-has-issues='true'] #attention-count {
  color: #e2c99d;
  background: #383023;
  border-color: #60503a;
}

/* Tabs */
.tabs {
  background: #1c1c1c;
  border-color: #353535;
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 30%);
}
.tabs button[aria-selected='true'] {
  background: #353535;
  box-shadow:
    var(--highlight),
    0 1px 3px rgb(0 0 0 / 35%);
}

/* Buttons */
.button {
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease,
    transform 80ms ease;
}
.button:active:not(:disabled) {
  transform: translateY(1px);
}
.button--quiet,
.button--outline {
  box-shadow: var(--highlight);
}
.button--primary {
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 60%),
    0 6px 18px -8px rgb(236 236 236 / 45%);
}

/* Fields */
input:not([type='checkbox'], [type='radio'], [type='range']),
textarea,
select {
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}
input:not([type='checkbox'], [type='radio'], [type='range']):hover:not(:focus, :disabled),
textarea:hover:not(:focus, :disabled),
select:hover:not(:focus, :disabled) {
  border-color: #5a5a5a;
}
input:not([type='checkbox'], [type='radio'], [type='range']):focus-visible,
textarea:focus-visible,
select:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgb(159 185 232 / 18%);
  outline-offset: 1px;
}
select:not([multiple], [size]) {
  padding-right: 32px;
  color: #e3e3e3;
  background-color: #1f1f1f;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 12px;
  border: 1px solid #444;
  border-radius: 8px;
  appearance: none;
  cursor: pointer;
}
#inventory-item-type {
  min-height: 34px;
  padding-left: 10px;
}

/* Tables */
tbody tr {
  transition: background-color 120ms ease;
}
tbody tr:has(> td input[type='checkbox']:checked) {
  background: rgb(159 185 232 / 6%);
}
tbody tr:has(> td input[type='checkbox']:checked) > td:first-child {
  box-shadow: inset 2px 0 0 var(--focus);
}

/* CS2 item art: lit tile so dark skins stay visible, with a rarity edge */
.item-icon {
  background: radial-gradient(circle at 50% 38%, #4a4a4a, #2a2a2a 72%);
  border-color: #474747;
  box-shadow: inset 0 -2px 0 var(--rarity, transparent);
}
.item-identity[data-rarity='consumer'],
.item-identity[data-rarity='base'] {
  --rarity: #b0c3d9;
}
.item-identity[data-rarity='industrial'] {
  --rarity: #5e98d9;
}
.item-identity[data-rarity='mil-spec'],
.item-identity[data-rarity='high'] {
  --rarity: #4b69ff;
}
.item-identity[data-rarity='restricted'],
.item-identity[data-rarity='remarkable'] {
  --rarity: #8847ff;
}
.item-identity[data-rarity='classified'],
.item-identity[data-rarity='exotic'] {
  --rarity: #d32ce6;
}
.item-identity[data-rarity='covert'],
.item-identity[data-rarity='extraordinary'] {
  --rarity: #eb4b4b;
}
.item-identity[data-rarity='contraband'] {
  --rarity: #e4ae39;
}

/* Motion */
@media (prefers-reduced-motion: no-preference) {
  .dialog[open] {
    animation: polish-dialog-in 200ms var(--ease);
  }
  .dialog[open]::backdrop {
    animation: polish-fade-in 200ms ease;
  }
  .toast:not([hidden]) {
    animation: polish-toast-in 240ms var(--ease);
  }
  .attention-panel[open] > :not(summary) {
    animation: polish-fade-in 180ms ease;
  }
}
@keyframes polish-dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
}
@keyframes polish-fade-in {
  from {
    opacity: 0;
  }
}
@keyframes polish-toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Home: workspace value cards, unlock schedule, attention and bots */
.home-view {
  display: grid;
  gap: 16px;
}
.home-view > .inventory-view-heading {
  margin-bottom: 0;
}
.value-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.value-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 16px 18px;
  overflow: hidden;
  color: inherit;
  font: inherit;
  text-align: left;
  border: 1px solid #3a3a3a;
  border-radius: 12px;
  background: linear-gradient(180deg, #252525, #202020);
  box-shadow: var(--highlight);
}
.value-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 2px;
  background: var(--card-accent, transparent);
  opacity: 0.8;
}
button.value-card {
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background-color 150ms ease,
    transform 150ms var(--ease);
}
button.value-card:hover {
  border-color: #585858;
  transform: translateY(-1px);
}
.value-card--success {
  --card-accent: #a1d2b2;
}
.value-card--warning {
  --card-accent: #ddc28f;
}
.value-card--info {
  --card-accent: #9fb9e8;
}
.value-card__label {
  color: #ababab;
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.value-card__value {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.value-card__detail {
  overflow: hidden;
  color: #a3a3a3;
  font-size: 11.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-grid,
.home-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 16px;
}
.home-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}
.home-stack {
  display: grid;
  gap: 16px;
  align-content: start;
}
/* The attention panel takes the height of the left column and scrolls inside it,
   so a long list never stretches the row. The panel itself scrolls (flex layout on
   <details> is not supported everywhere) with the title and pager pinned. */
.home-side {
  position: relative;
  min-height: 280px;
}
.home-attention {
  position: absolute;
  inset: 0;
  margin: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.home-attention:not([open]) {
  bottom: auto;
}
.panel.home-attention > summary,
.panel.home-attention > .pagination {
  position: sticky;
  z-index: 1;
  background: #202020;
}
.panel.home-attention[data-has-issues='true'] > summary,
.panel.home-attention[data-has-issues='true'] > .pagination {
  background: linear-gradient(90deg, rgb(221 194 143 / 6%), transparent 45%), #202020;
}
.home-attention > summary {
  top: 0;
}
.home-attention > .pagination {
  bottom: 0;
  border-top: 1px solid var(--line);
}
.unlock-schedule {
  min-width: 0;
  margin: 0;
  padding: 16px 18px;
  border: 1px solid #383838;
  border-radius: 12px;
  background: #202020;
  box-shadow: var(--highlight);
}
.unlock-schedule header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 12px;
}
.unlock-schedule h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.unlock-schedule header .muted {
  font-size: 11.5px;
}
@media (max-width: 1180px) {
  .value-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-grid,
  .home-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .home-side {
    min-height: 0;
  }
  .home-attention {
    position: static;
    max-height: 480px;
  }
}
@media (max-width: 480px) {
  .value-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Compact inventory rows */
.item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
}
.item-wear {
  padding: 0 5px;
  color: #d6d6d6;
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #484848;
  border-radius: 4px;
  cursor: help;
}
.item-quantity {
  margin-left: 6px;
  padding: 1px 6px;
  color: #d6d6d6;
  font-size: 10.5px;
  font-variant-numeric: tabular-nums;
  border-radius: 999px;
  background: #333;
}
.item-held {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  cursor: help;
}
.th-sort {
  padding: 0;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}
.th-sort::after {
  content: '↕';
  margin-left: 6px;
  opacity: 0.45;
}
.th-sort:hover {
  color: #e7e7e7;
}
.th-sort[data-sort='price_desc']::after {
  content: '↓';
  opacity: 1;
}
.th-sort[data-sort='price_asc']::after {
  content: '↑';
  opacity: 1;
}

/* Selection bar pinned to the bottom of the scrolling workspace */
.selection-bar {
  position: sticky;
  bottom: 12px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin: 12px;
  padding: 10px 12px 10px 16px;
  border: 1px solid #555;
  border-radius: 12px;
  background: rgb(40 40 40 / 92%);
  backdrop-filter: blur(10px);
  box-shadow:
    var(--highlight),
    0 18px 40px -12px rgb(0 0 0 / 70%);
}
.selection-bar__count strong,
.selection-bar__value strong {
  color: #f3f3f3;
  font-variant-numeric: tabular-nums;
}
.selection-bar__value {
  color: #b5b5b5;
}
.selection-bar__actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
#selected-count {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  .selection-bar:not([hidden]) {
    animation: polish-toast-in 200ms var(--ease);
  }
}

/* Sticky selection bar needs a panel that clips without becoming a scroll container. */
#inventory-panel {
  overflow: clip;
}

/* Inventory tables: fixed Buy | Sell columns so prices line up row to row.
   Routine signals (high confidence, zero risk) move to the price dialog. */
:is(#items-body, #trade-bot-items-body, #catalog-items) .item-pricing {
  min-width: 0;
}
:is(#items-body, #trade-bot-items-body, #catalog-items) .price-directions {
  display: grid;
  grid-template-columns: repeat(2, 196px);
  column-gap: 8px;
  justify-items: start;
}
:is(#items-body, #trade-bot-items-body, #catalog-items) .price-trigger {
  display: grid;
  grid-template-columns: 30px 80px repeat(2, auto);
  align-items: center;
  gap: 0;
  padding: 2px 0;
  text-align: left;
}
:is(#items-body, #trade-bot-items-body, #catalog-items) .price-trigger strong {
  justify-self: end;
  text-align: right;
  white-space: normal;
}
:is(#items-body, #trade-bot-items-body, #catalog-items) .price-trigger > :nth-child(n + 3) {
  margin-left: 7px;
}
/* Label, price and confidence fill the 196px column; risk and the warning
   mark sit on a second line under the price so they never spill into Sell. */
:is(#items-body, #trade-bot-items-body, #catalog-items) .price-risk-score {
  grid-area: 2 / 2;
  justify-self: end;
  margin-left: 0;
}
:is(#items-body, #trade-bot-items-body, #catalog-items) .price-risk-indicator {
  grid-area: 2 / 3;
}
:is(#items-body, #trade-bot-items-body, #catalog-items) .price-direction-label {
  width: auto;
  font-size: 11px;
}
:is(#items-body, #trade-bot-items-body, #catalog-items) .price-risk-score--quiet,
:is(#items-body, #trade-bot-items-body, #catalog-items) .price-confidence--high {
  display: none;
}
:is(#items-body, #trade-bot-items-body, #catalog-items) td {
  padding-block: 9px;
}

/* Offer rows: what moves each way and roughly what it is worth */
.offer-items-cell {
  min-width: 250px;
}
.offer-side {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}
.offer-side__label {
  color: #a3a3a3;
  font-size: 11px;
}
.offer-side__thumbs {
  display: flex;
  align-items: center;
  gap: 3px;
  min-width: 0;
}
.offer-side__thumbs img {
  width: 34px;
  height: 26px;
  object-fit: contain;
  border: 1px solid #444;
  border-radius: 5px;
  background: radial-gradient(circle at 50% 38%, #4a4a4a, #2a2a2a 72%);
}
.offer-side__more {
  padding: 2px 6px;
  color: #d6d6d6;
  font-size: 10.5px;
  border-radius: 999px;
  background: #333;
}
.offer-side__value {
  color: #e7e7e7;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.offer-side__value--recorded {
  white-space: normal;
}
.offer-net {
  display: inline-block;
  margin-top: 4px;
  padding: 1px 7px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  border-radius: 999px;
  background: #2c2c2c;
}
.offer-net--up {
  color: #b0d8be;
  background: #26362c;
}
.offer-net--down {
  color: #f0b8b8;
  background: #3c292a;
}
.offer-updated {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.offer-request-id {
  display: block;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Home bots table */
th.numeric,
td.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.home-bot-row,
.home-offer-row {
  cursor: pointer;
}
.home-bot-row:focus-visible,
.home-offer-row:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}
.home-bot-name {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
}
.home-bot-name .signal {
  grid-row: 1 / 3;
}
.home-bot-name .subline {
  grid-column: 2;
}
.home-bot-share {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 140px;
}
.share-bar {
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #2c2c2c;
}
.share-bar__fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8fb79c, #a1d2b2);
}
.home-bot-share small {
  width: 34px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Workspace inventory: stat cards match Home's value cards */
.inventory-stat {
  border-color: #3a3a3a;
  border-radius: 12px;
  background: linear-gradient(180deg, #252525, #202020);
  box-shadow: var(--highlight);
}
.inventory-stat strong {
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.inventory-table-heading {
  margin-top: 8px;
}
#fleet-inventory-items td,
#catalog-items td {
  padding-block: 9px;
}

/* Static explanations collapse so the numbers stay in view */
.footnote {
  margin-top: 12px;
  color: #a3a3a3;
  font-size: 12px;
}
.footnote summary {
  width: fit-content;
  color: #c4c4c4;
  cursor: pointer;
}
.footnote summary:hover {
  color: #e7e7e7;
}
.footnote p {
  max-width: 80ch;
  margin: 8px 0 0;
  line-height: 1.55;
}

/* Workspace inventory rows */
.fleet-item-icon {
  border: 1px solid #474747;
  border-radius: 9px;
  background: radial-gradient(circle at 50% 38%, #4a4a4a, #2a2a2a 72%);
  box-shadow: inset 0 -2px 0 var(--rarity, transparent);
}
.fleet-item[data-rarity='consumer'],
.fleet-item[data-rarity='base'] {
  --rarity: #b0c3d9;
}
.fleet-item[data-rarity='industrial'] {
  --rarity: #5e98d9;
}
.fleet-item[data-rarity='mil-spec'],
.fleet-item[data-rarity='high'] {
  --rarity: #4b69ff;
}
.fleet-item[data-rarity='restricted'],
.fleet-item[data-rarity='remarkable'] {
  --rarity: #8847ff;
}
.fleet-item[data-rarity='classified'],
.fleet-item[data-rarity='exotic'] {
  --rarity: #d32ce6;
}
.fleet-item[data-rarity='covert'],
.fleet-item[data-rarity='extraordinary'] {
  --rarity: #eb4b4b;
}
.fleet-item[data-rarity='contraband'] {
  --rarity: #e4ae39;
}
.bot-link {
  padding: 3px 9px;
  color: #d6d6d6;
  font: inherit;
  font-size: 12px;
  white-space: nowrap;
  border: 1px solid #3c3c3c;
  border-radius: 999px;
  background: #242424;
  cursor: pointer;
  transition:
    background-color 150ms ease,
    border-color 150ms ease;
}
.bot-link:hover {
  border-color: #5a5a5a;
  background: #2e2e2e;
}
th.numeric .table-sort {
  margin-left: auto;
}

/* Home, Inventory and Prices: no bot list, full width.
   On desktop the sidebar slides in from the left on Bots and back out when leaving. */
@media (min-width: 981px) {
  .app-shell {
    overflow: hidden;
    transition: grid-template-columns 340ms var(--ease);
  }
  .sidebar {
    width: 260px;
    transition:
      transform 340ms var(--ease),
      opacity 260ms ease,
      visibility 0s;
  }
  .app-shell--wide {
    grid-template-columns: 0px minmax(0, 1fr);
  }
  .app-shell--wide > .sidebar {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-100%);
    transition:
      transform 340ms var(--ease),
      opacity 260ms ease,
      visibility 0s 340ms;
  }
}
@media (max-width: 980px) {
  .app-shell--wide {
    grid-template: auto minmax(0, 1fr) / minmax(0, 1fr);
  }
  .app-shell--wide > .sidebar {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .app-shell,
  .sidebar,
  .app-shell--wide > .sidebar {
    transition: none;
  }
}
.home-health {
  margin: 6px 0 0;
  color: #c4c4c4;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

/* The filter bar already searches the same items. */
#inventory-items-panel > .inventory-table-heading {
  display: none;
}

/* Chart tooltip that follows the cursor */
.chart-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  display: grid;
  gap: 4px;
  min-width: 170px;
  padding: 10px 12px;
  color: #e7e7e7;
  font-size: 12px;
  border: 1px solid #4a4a4a;
  border-radius: 10px;
  background: rgb(32 32 32 / 96%);
  backdrop-filter: blur(8px);
  box-shadow: 0 16px 40px -12px rgb(0 0 0 / 70%);
  pointer-events: none;
}
.chart-tooltip__title {
  margin-bottom: 2px;
  font-size: 12px;
}
.chart-tooltip__row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: #b5b5b5;
}
.chart-tooltip__row b {
  color: #f0f0f0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.chart-tooltip__swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 2px;
}

/* Home cards */
.home-card {
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid #383838;
  border-radius: 12px;
  background: #202020;
  box-shadow: var(--highlight);
}
.home-card > header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 12px;
}
.home-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.home-card > header .muted {
  font-size: 11.5px;
}
.home-flow-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.home-flow-stat {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-left: 2px solid #4a4a4a;
}
.home-flow-stat--in {
  border-left-color: #a1d2b2;
}
.home-flow-stat--out {
  border-left-color: #9fb9e8;
}
.home-flow-stat span,
.home-flow-stat small {
  color: #a3a3a3;
  font-size: 11px;
}
.home-flow-stat strong {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.home-flow-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.home-flow-day {
  display: grid;
  grid-template-rows: 64px auto;
  gap: 4px;
  text-align: center;
}
.home-flow-day__bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  padding: 0 4px;
  border-bottom: 1px solid #333;
  border-radius: 4px;
  cursor: crosshair;
}
.home-flow-day__bars:hover,
.home-flow-day__bars:focus-visible {
  background: #262626;
}
.home-flow-bar {
  width: 42%;
  max-width: 14px;
  border-radius: 3px 3px 0 0;
}
.home-flow-bar--in {
  background: #a1d2b2;
}
.home-flow-bar--out {
  background: #9fb9e8;
}
.home-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}
.home-list__row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px 6px;
  border-top: 1px solid #2d2d2d;
  border-radius: 8px;
}
.home-list__row:first-child {
  border-top: 0;
}
.home-list__row--link {
  cursor: pointer;
  transition: background-color 150ms ease;
}
.home-list__row--link:hover,
.home-list__row--link:focus-visible {
  background: #262626;
}
.home-list__copy {
  display: grid;
  min-width: 0;
}
.home-list__copy strong,
.home-list__copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-list__copy strong {
  font-size: 13px;
  font-weight: 550;
}
.home-list__copy small {
  font-size: 11.5px;
}
.home-list__value {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.home-list__empty {
  padding: 12px 6px;
}
.home-thumb {
  display: grid;
  place-items: center;
  width: 40px;
  height: 30px;
  border: 1px solid #444;
  border-radius: 6px;
  background: radial-gradient(circle at 50% 38%, #4a4a4a, #2a2a2a 72%);
}
.home-thumb img {
  width: 36px;
  height: 26px;
  object-fit: contain;
}
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b6b6b;
}
.status-dot--success {
  background: #a1d2b2;
}
.status-dot--danger {
  background: #edaaaa;
}
.status-dot--warning {
  background: #ddc28f;
}
.home-now,
.home-activity-cell {
  white-space: nowrap;
}
.home-now > *,
.home-activity-cell > * {
  margin-right: 6px;
  vertical-align: middle;
}
.home-now__pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ddc28f;
}
@media (prefers-reduced-motion: no-preference) {
  .home-now__pulse {
    animation: polish-pulse 1.6s ease-out infinite;
  }
}
@keyframes polish-pulse {
  0% {
    box-shadow: 0 0 0 0 rgb(221 194 143 / 55%);
  }
  80%,
  100% {
    box-shadow: 0 0 0 6px rgb(221 194 143 / 0%);
  }
}
.text-button {
  padding: 0;
  color: #c9c9c9;
  font: inherit;
  font-size: 12px;
  background: none;
  border: 0;
  cursor: pointer;
}
.text-button:hover {
  color: #f0f0f0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mafile-import input[type='file'] {
  width: 100%;
  padding: 10px 0;
  font-size: 13px;
}
.mafile-import input::file-selector-button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-right: 12px;
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
}
.bot-row__proxy {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 3px;
}
.home-sync-time {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.home-proxy-ip {
  white-space: nowrap;
  font-size: 12px;
}
[data-mafile-feedback]:empty,
[data-proxy-import-feedback]:empty {
  display: none;
}

/* Home line charts */
.line-chart {
  display: grid;
  gap: 8px;
}
.line-chart__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  color: #a3a3a3;
  font-size: 11.5px;
}
.line-chart__key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.line-chart__key strong {
  color: #e7e7e7;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.line-chart__swatch {
  width: 10px;
  height: 2px;
  border-radius: 1px;
}
.line-chart__frame {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}
.line-chart__scale {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 36px;
  color: #8a8a8a;
  font-size: 10.5px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.line-chart__plot {
  display: block;
  width: 100%;
  height: 140px;
  overflow: visible;
}
.line-chart__grid {
  stroke: #333;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.line-chart__line {
  fill: none;
  stroke-width: 1.75;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.line-chart__hit {
  fill: transparent;
  cursor: crosshair;
}
.line-chart__hit:hover {
  fill: rgb(255 255 255 / 4%);
}
.line-chart__axis {
  display: flex;
  justify-content: space-between;
  padding-left: 44px;
  color: #8a8a8a;
  font-size: 10.5px;
}
.line-chart__empty {
  margin: 0;
  padding: 24px 0;
  font-size: 12px;
  text-align: center;
}

.workspace-cell {
  min-width: 8rem;
  max-width: 16rem;
  overflow-wrap: anywhere;
  color: var(--text-secondary, #bdbdbd);
}
.bot-health {
  --health-color: #8a8a8a;
  position: relative;
  width: 150px;
  max-width: 100%;
  outline-offset: 5px;
}
.bot-health--success {
  --health-color: #a1d2b2;
}
.bot-health--warning {
  --health-color: #ddc28f;
}
.bot-health--danger {
  --health-color: #e7a8a8;
}
.bot-health__summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--health-color);
  font-size: 12px;
  line-height: 1.5;
}
.bot-health__summary strong {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.bot-health__bar {
  height: 6px;
  margin-top: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: #363636;
}
.bot-health__bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--health-color);
}
.bot-header-health {
  margin-left: 8px;
}

.marketplace-intro p {
  font-size: 13px;
}
.sales-connections {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}
.sales-connection {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 13px;
}
.sales-connection small {
  flex-basis: 100%;
}
#sales-view .filter-card > label:not(.search) {
  flex: 1 1 130px;
  min-width: 0;
}
#sales-view .filter-card > label > select {
  width: 100%;
}
#sales-connections {
  flex: 1 1 260px;
  min-width: 0;
  margin: 0;
}
.sales-provider-cell strong {
  font-size: inherit;
  font-weight: 500;
}

.chart-crosshair {
  stroke: #a3a3a3;
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}

.chart-crosshair__dot {
  stroke: var(--panel);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

svg:has(> .chart-crosshair),
svg:has(> g > .chart-crosshair) {
  cursor: crosshair;
}

svg:has(> g > .chart-crosshair):focus-visible {
  outline: 2px solid var(--info);
  outline-offset: 2px;
}
