/*
 * CS Contractor v2 — the tradeup finder.
 *
 * Parameters, then a progress bar over the collection x wear x StatTrak jobs,
 * then the contracts themselves ranked by profit.
 */

.params-card {
  background: var(--raised);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 13px 14px;
  padding: 15px 16px;
}

.params-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.params-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--t8);
  letter-spacing: .06em;
}

/* checkbox that keeps the token palette */
.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--t3);
  cursor: pointer;
  min-height: 28px;
}

.check input {
  appearance: none;
  width: 15px;
  height: 15px;
  flex: none;
  margin: 0;
  border: 1px solid var(--edge2);
  border-radius: 4px;
  background: var(--input);
  cursor: pointer;
  display: grid;
  place-content: center;
}

.check input::before {
  content: "";
  width: 8px;
  height: 8px;
  transform: scale(0);
  background: var(--brand-on);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

.check input:checked {
  background: var(--brand);
  border-color: var(--brand);
}

.check input:checked::before { transform: scale(1); }

/* -------------------------------------------------------------- progress -- */

.progress-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.progress-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.progress-label { font-size: 12.5px; color: var(--t4); }

.progress-pct {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
  color: var(--text);
}

.progress-track {
  height: 6px;
  background: var(--sel);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--good);
}

/* Running: diagonal stripes in the brand orange, marching left to right. */
.progress-fill.running {
  background-image: linear-gradient(
    45deg,
    var(--brand) 25%, rgba(235, 104, 52, .55) 25%,
    rgba(235, 104, 52, .55) 50%, var(--brand) 50%,
    var(--brand) 75%, rgba(235, 104, 52, .55) 75%,
    rgba(235, 104, 52, .55)
  );
  background-size: 28px 28px;
  animation: stripeSlide .8s linear infinite;
}

/* ------------------------------------------------------- contract cards -- */

.contracts {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.contract {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.contract-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 15px;
  background: var(--raised);
  border-bottom: 1px solid var(--line);
}

.contract-rank {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
}

.contract-collection {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text2);
}

.contract-wear {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--t6);
}

.contract-path {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
}

.contract-path .arrow { color: var(--t8); }

.contract-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.stat-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 11px;
  background: var(--chipbg);
  border: 1px solid var(--chipborder);
  white-space: nowrap;
}

.stat-chip .k { color: var(--t7); }
.stat-chip .v {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--text2);
}

.stat-chip.ev { background: var(--sev-info-bg); border-color: transparent; }
.stat-chip.ev .v { color: var(--info); }
.stat-chip.profit { background: var(--sev-good-bg); border-color: transparent; }
.stat-chip.profit .v { color: var(--good); }
.stat-chip.range { background: var(--sev-warn-bg); border-color: transparent; }
.stat-chip.range .v { color: var(--warn); }

.contract-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1px;
  background: var(--line);
}

.contract-col {
  background: var(--panel);
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.contract-col-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--t6);
}

.stack-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 24px;
}

.qty-pill {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--sel);
  color: var(--t3);
  flex: none;
}

.stack-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stack-price {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  color: var(--t5);
  flex: none;
}

.stack-row.trash .stack-name,
.stack-row.trash .stack-price { color: var(--t8); }

.contract-note {
  font-size: 11px;
  line-height: 1.5;
  color: var(--t7);
  margin: 4px 0 0;
  text-wrap: pretty;
}

.contract-note code {
  font-family: var(--mono);
  color: var(--t5);
}

/* ------------------------------------------------------- recent searches -- */

.recent-table {
  width: 100%;
  border-collapse: collapse;
}

.recent-table th {
  padding: 9px 13px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--t6);
  text-align: left;
  background: var(--raised);
  border-bottom: 1px solid var(--line2);
  white-space: nowrap;
}

.recent-table td {
  padding: 8px 13px;
  font-size: 12px;
  color: var(--t3);
  border-bottom: 1px solid var(--rowline);
  white-space: nowrap;
}

.recent-table td.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--t4);
}

.recent-table tbody tr:last-child td { border-bottom: 0; }
.recent-table tbody tr:hover { background: var(--hover); }

.status-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
}

.status-done { background: var(--sev-good-bg); color: var(--good); }
.status-running { background: var(--sev-info-bg); color: var(--info); }
.status-queued { background: var(--sev-dead-bg); color: var(--t5); }
