  .btn {
    background: #2e2e2e;
    color: #e0e0e0;
    border: 1px solid #444;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
  }
  .btn:hover {
    background: #3a3a3a;
    border-color: #bdfc9a;
    box-shadow: 0 0 10px 3px #bdfc9a;
    color: #bdfc9a;
  }
  
    /* Page-specific layout (kept small so you can continue using general.css everywhere) */
    .page-wrap { max-width: 1400px; margin: 0 auto; }
    .value-layout {
      display: grid;
      grid-template-columns: minmax(280px, 1.15fr) minmax(320px, 1.6fr);
      gap: 16px;
      align-items: start;
      margin-top: 18px;
    }
    @media (max-width: 900px) {
      .value-layout { grid-template-columns: 1fr; }
    }

    /* Left: search + grid */
    #petValueSearch {
      width: 100%;
      box-sizing: border-box;
      padding: 8px 10px;
      border-radius: 8px;
      border: 1px solid #444;
      background: #111;
      color: #eee;
      font-size: 14px;
    }

    .value-filters {
      display:flex;
      flex-wrap: wrap;
      gap: 10px;
      align-items: center;
      margin-top: 10px;
    }
    .value-filters select, .value-filters button {
      font-size: 14px;
      padding: 8px 10px;
      border-radius: 8px;
    }

    #petValueGrid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
      gap: 10px;
      margin-top: 10px;
      max-height: 68vh;
      overflow-y: auto;
      padding-right: 8px;
    }

    .pet-card {
      border: 1px solid #444;
      background: #151515;
      border-radius: 14px;
      padding: 10px 8px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 6px;
      cursor: pointer;
      transition: transform 0.08s ease, box-shadow 0.08s ease, border-color 0.08s ease, background 0.08s ease;
      user-select: none;
      min-height: 120px;
      text-transform: capitalize;
    }
    .pet-card:hover {
      transform: translateY(-1px);
      border-color: #e2e21a;
      box-shadow: 0 0 10px 2px rgba(189, 252, 154, 0.35);
    }
    .pet-card.active {
      border: 2px solid #e2e21a;
      background-color: #123c12;
      box-shadow: 0 0 10px 2px #e2e21a;
    }
    .pet-card img {
      width: 64px;
      height: 64px;
      object-fit: contain;
      border-radius: 10px;
    }
    .pet-card .pet-name {
      font-size: 12px;
      color: #ddd;
      text-align: center;
      word-break: break-word;
    }

    /* Right: details */
    .panel {
      background: #111;
      border: 1px solid #333;
      border-radius: 12px;
      padding: 12px;
    }
    .panel h2 {
      margin: 0 0 10px;
      font-size: 18px;
      font-weight: 700;
    }

    .kv-row {
      display:flex;
      flex-wrap: wrap;
      gap: 10px 16px;
      align-items: center;
      margin-bottom: 10px;
    }
    .kv-row label {
      font-size: 13px;
      font-weight: 600;
      opacity: .9;
    }
    .kv-row input[type="range"] { width: 240px; max-width: 100%; }
    .pill {
      display: inline-flex !important;
      align-items:center;
      gap:8px;
      padding: 6px 10px;
      border-radius: 999px;
      border: 1px solid #333;
      background: #191919;
      font-size: 13px;
      accent-color: #d71212;
      visibility: visible !important;
      opacity: 1 !important;
    }

    .pill select,
    .pill select option {
      display: inline-block !important;
      visibility: visible !important;
      opacity: 1 !important;
      color: #eee !important;
      background: #191919 !important;
      border: 1px solid #444 !important;
      color-scheme: dark !important;
      -webkit-appearance: auto !important;
      appearance: auto !important;
    }
    
    .pill label,
    .pill span,
    .pill strong {
      color: #eee !important;
      visibility: visible !important;
      opacity: 1 !important;
    }    

    .value-big {
      font-size: 44px;
      color: #e2e21a;
      margin-top: 10px;
      line-height: 1.05;
      word-break: break-word;
    }
    .value-sub {
      margin-top: 6px;
      font-size: 13px;
      color: #aaa;
    }

    .datapoints {
      margin-top: 12px;
      border-top: 1px solid #2a2a2a;
      padding-top: 10px;
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
    }
    .datapoints .dp-grid {
      display:grid;
      grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
      gap: 8px;
    }
    .dp {
      background: #151515;
      border: 1px solid #333;
      border-radius: 10px;
      padding: 8px 10px;
      font-size: 13px;
      display:flex;
      justify-content: space-between;
      gap: 12px;
    }
    .dp .w { color:#ccc; }
    .dp .v { color:#e2e21a; font-weight: 700; }

    .warn {
      background: #151515;
      border: 1px dashed #555;
      border-radius: 10px;
      padding: 10px 12px;
      color: #ccc;
      font-size: 13px;
    }
	
	.modal-backdrop{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.65);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 9999;
}
.modal-card{
  width: min(720px, 96vw);
  background: #0f0f0f;
  border: 1px solid #333;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 0 18px rgba(0,0,0,.5);
}


.dp { overflow: visible !important; }
#datapointsGrid { overflow: visible !important; }

.dp-note{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:18px;height:18px;
  border-radius:999px;
  border:1px solid #555;
  background:#1b1b1b;
  color:#e2e21a;
  font-weight:800;
  font-size:12px;
  cursor:pointer;
  line-height:1;
  position:relative;
  flex:0 0 auto;
  -webkit-tap-highlight-color: transparent;
}

.dp-note-pop{
  position:absolute;
  left:50%;
  top: calc(100% + 8px);
  transform: translateX(-50%);
  width: min(320px, 70vw);
  background:#0f0f0f;
  border:1px solid #333;
  border-radius:10px;
  padding:10px 12px;
  color:#ddd;
  font-weight:500;
  font-size:12px;
  white-space:pre-wrap;
  box-shadow:0 0 18px rgba(0,0,0,.55);
  opacity:0;
  pointer-events:none;
  transition: opacity .12s ease-in-out;
  z-index:9999;
}

.dp-note:hover .dp-note-pop,
.dp-note:focus .dp-note-pop,
.dp-note.show .dp-note-pop{
  opacity:1;
  pointer-events:auto;
}




/* IMPORTANT: allow tooltip to escape the card */
.dp { overflow: visible !important; }
#datapointsGrid { overflow: visible !important; }



.note-red { color: #ff5a5a; font-weight: 700; }
.note-yellow { color: #e2e21a; font-weight: 700; }

.trade-calculator {
  margin: 0 0 18px;
}

.trade-header,
.trade-totals,
.trade-side-top {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.trade-summary-badge {
  border: 1px solid #444;
  background: #151515;
  border-radius: 8px;
  padding: 10px 12px;
  color: #f1f1f1;
  font-weight: 800;
}

.trade-totals {
  margin-top: 12px;
}

.trade-total {
  flex: 1 1 240px;
  border: 1px solid #333;
  background: #151515;
  border-radius: 8px;
  padding: 10px 12px;
}

.trade-total span {
  display: block;
  color: #aaa;
  font-size: 12px;
  margin-bottom: 4px;
}

.trade-total strong {
  color: #e2e21a;
  font-size: 26px;
}

.trade-total-difference {
  text-align: center;
}

.trade-sides {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.trade-side {
  border: 1px solid #333;
  background: #101010;
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
}

.trade-side h3 {
  margin: 0;
  font-size: 18px;
}

.trade-side-flat {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.trade-side-flat-label {
  color: #d7d7d7;
  font-size: 13px;
  font-weight: 800;
}

.trade-side-flat-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #151515;
  color: #eee;
  font-size: 14px;
}

.trade-side-flat-input.invalid {
  border-color: #b85b5b;
}

.trade-side-flat-hint {
  min-height: 18px;
  color: #aaa;
  font-size: 12px;
  line-height: 1.35;
}

.trade-side-flat-hint.error {
  color: #ff8d8d;
}

.trade-side-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.trade-row-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.trade-slot-card {
  position: relative;
  min-height: 146px;
  border: 1px dashed #4a4a4a;
  background: #151515;
  border-radius: 8px;
  overflow: hidden;
  min-width: 0;
}

.trade-slot-card.filled {
  border-style: solid;
  border-color: #426b37;
  background: #101810;
}

.trade-slot-card.flat-entry {
  border-color: #8b6b37;
  background: #18140d;
}

.trade-slot-card.flat-entry .trade-slot-main:hover,
.trade-slot-card.flat-entry .trade-slot-main:focus {
  background: rgba(255, 211, 107, 0.08);
}

.trade-modal-mode-hidden {
  display: none !important;
}

.trade-slot-main {
  width: 100%;
  min-height: 146px;
  border: 0;
  background: transparent;
  color: #eee;
  cursor: pointer;
  padding: 12px;
  text-align: left;
  display: grid;
  align-content: center;
  gap: 6px;
}

.trade-slot-main-inner {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.trade-slot-card:not(.filled) .trade-slot-main {
  place-items: center;
  text-align: center;
}

.trade-slot-main:hover,
.trade-slot-main:focus {
  outline: none;
  background: rgba(189, 252, 154, 0.08);
}

.trade-slot-plus {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid #555;
  display: grid;
  place-items: center;
  color: #f1f1f1;
  font-size: 32px;
  font-weight: 800;
  line-height: 1;
}

.trade-slot-index {
  color: #aaa;
  font-size: 12px;
  font-weight: 800;
}

.trade-slot-pet-img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 8px;
  background: #0d0d0d;
}

.trade-slot-name {
  font-size: 15px;
  font-weight: 800;
  text-transform: capitalize;
  padding-right: 28px;
  overflow-wrap: anywhere;
}

.trade-slot-value {
  font-weight: 800;
  color: #e2e21a;
  font-size: 20px;
}

.trade-slot-meta {
  color: #cfcfcf;
  font-size: 14px;
  line-height: 1.45;
}

.trade-slot-status {
  color: #b8b8b8;
  font-size: 14px;
  line-height: 1.45;
}

.trade-slot-clear {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  justify-content: center !important;
  z-index: 2;
}

.trade-verdict {
  margin-top: 12px;
}

.trade-modal-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.trade-modal-field {
  display: grid;
  gap: 6px;
}

.trade-modal-field span {
  font-size: 13px;
  font-weight: 800;
  color: #ccc;
}

.trade-modal-field input,
.trade-modal-field select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 10px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #111;
  color: #eee;
}

.trade-modal-selected {
  color: #bdfc9a;
  font-size: 13px;
  font-weight: 800;
  min-height: 18px;
}

.trade-modal-pet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(82px, 1fr));
  gap: 8px;
  max-height: 330px;
  overflow: auto;
  padding: 2px 6px 2px 0;
}

.trade-modal-pet-option {
  border: 1px solid #333;
  background: #151515;
  color: #eee;
  border-radius: 8px;
  padding: 8px 6px;
  min-height: 98px;
  cursor: pointer;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  text-align: center;
}

.trade-modal-pet-option:hover,
.trade-modal-pet-option:focus {
  border-color: #bdfc9a;
  outline: none;
}

.trade-modal-pet-option.active {
  border-color: #90ee90;
  background: #123c12;
  box-shadow: 0 0 8px rgba(144, 238, 144, .45);
}

.trade-modal-pet-option img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.trade-modal-pet-option span {
  font-size: 11px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  text-transform: capitalize;
}

@media (max-width: 980px) {
  .trade-sides {
    grid-template-columns: 1fr;
  }

  .trade-row-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .trade-row-list {
    grid-template-columns: 1fr;
  }
}

/* ── Tablet (≤ 768px) ─────────────────────────────────── */
@media (max-width: 768px) {
  .value-layout {
    gap: 12px;
    margin-top: 12px;
  }

  .panel {
    padding: 10px;
  }

  .value-big {
    font-size: 36px;
  }

  .kv-row {
    gap: 8px 12px;
  }

  .kv-row input[type="range"] {
    width: 180px;
  }

  .datapoints .dp-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .trade-total {
    flex: 1 1 140px;
  }

  .trade-total strong {
    font-size: 22px;
  }

  .trade-slot-value {
    font-size: 17px;
  }

  .trade-slot-name {
    font-size: 13px;
  }

  .trade-slot-meta,
  .trade-slot-status {
    font-size: 12px;
  }

  .trade-modal-pet-grid {
    max-height: 240px;
  }
}

/* ── Small phones (≤ 480px) ──────────────────────────── */
@media (max-width: 480px) {
  #petValueGrid {
    grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
    gap: 8px;
    max-height: 50vh;
  }

  .pet-card {
    min-height: 96px;
    padding: 8px 4px;
    gap: 4px;
    border-radius: 10px;
  }

  .pet-card img {
    width: 48px;
    height: 48px;
  }

  .pet-card .pet-name {
    font-size: 10px;
  }

  .value-big {
    font-size: 30px;
  }

  .value-sub {
    font-size: 12px;
  }

  .pill {
    font-size: 12px;
    padding: 5px 8px;
    gap: 6px;
  }

  .kv-row input[type="range"] {
    width: 100%;
  }

  .kv-row {
    gap: 6px;
  }

  .btn {
    padding: 8px 14px;
    font-size: 0.9rem;
  }

  .trade-total {
    flex: 1 1 100%;
  }

  .trade-total strong {
    font-size: 20px;
  }

  .trade-slot-pet-img {
    width: 40px;
    height: 40px;
  }

  .trade-slot-value {
    font-size: 15px;
  }

  .trade-slot-name {
    font-size: 12px;
    padding-right: 20px;
  }

  .modal-card {
    padding: 10px;
    border-radius: 10px;
  }

  .trade-modal-pet-grid {
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    max-height: 200px;
  }

  .trade-modal-pet-option {
    min-height: 80px;
    padding: 6px 4px;
  }

  .trade-modal-pet-option img {
    width: 36px;
    height: 36px;
  }
}