* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 30px 20px;
  background: #0b1120;
  color: #e5e7eb;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body > * {
  width: 100%;
  max-width: 1400px;
}

header {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-bottom: 35px;
  padding: 20px;
  background: #111827;
  border-bottom: 1px solid #1f2937;
  border-radius: 8px;
}

.logo-title {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: center;
  padding-bottom: 15px;
  border-bottom: 1px solid #1f2937;
}

.logo {
  height: 48px;
}

header h1 {
  margin: 0;
  font-size: 1.9rem;
  font-weight: 600;
  text-align: left;
}

.header-controls {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 12px;
}

.search-container {
  position: relative;
  width: 100%;
  grid-column: 1 / -1;
}

#search {
  width: 100%;
  grid-column: 1 / -1;
}

.header-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

input,
select,
button {
  padding: 10px 14px;
  border: 1px solid #1f2937;
  border-radius: 6px;
  background: #111827;
  color: #e5e7eb;
  font-size: 0.95rem;
  outline: none;
}

input::placeholder {
  color: #6b7280;
}

input:focus,
select:focus,
button:focus {
  border-color: #334155;
  background: #0f172a;
}

button {
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

select {
  min-width: 0;
  width: 100%;
}

.search-autocomplete {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #111827;
  border: 1px solid #1f2937;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 300px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.2s;
}

.autocomplete-item:hover {
  background: #0f172a;
}

.autocomplete-item img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.autocomplete-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.autocomplete-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e5e7eb;
}

.autocomplete-item-price {
  font-size: 0.75rem;
  color: #9ca3af;
}

.search-history {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #111827;
  border: 1px solid #1f2937;
  border-top: none;
  border-radius: 0 0 6px 6px;
  z-index: 99;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.search-history-header {
  padding: 8px 14px;
  background: #0f172a;
  border-bottom: 1px solid #1f2937;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-history-title {
  font-size: 0.75rem;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.clear-history {
  font-size: 0.75rem;
  color: #60a5fa;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.history-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s;
  font-size: 0.9rem;
  color: #e5e7eb;
}

.history-item:hover {
  background: #0f172a;
}

#loader {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 50px;
  margin-bottom: 15px;
  color: #9ca3af;
  font-size: 1rem;
}

.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  flex-wrap: wrap;
  gap: 10px;
}

#itemCount {
  color: #6b7280;
  font-size: 0.9rem;
}

#itemsContainer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.item-card-list {
  padding: 15px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
  align-items: start;
  position: relative;
}

.item-card-list-image {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 6px;
}

.item-card-list-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-card-list-name {
  font-size: 1rem;
  font-weight: 600;
  color: #e5e7eb;
  line-height: 1.3;
}

.item-card-list-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.75rem;
}

.item-card-list-id {
  padding: 3px 8px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 4px;
  color: #9ca3af;
}

.item-card-list-category {
  padding: 3px 8px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 4px;
  color: #60a5fa;
}

.item-card-list-trend {
  padding: 3px 8px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 4px;
  font-weight: 500;
}

.item-card-list-trend.rising { color: #4ade80; }
.item-card-list-trend.falling { color: #f87171; }
.item-card-list-trend.stable { color: #facc15; }
.item-card-list-trend.unstable { color: #fb923c; }

.item-card-list-prices {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}

.item-favourite-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.2rem;
}

.currency {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.currency-icon {
  width: 1em;
  height: 1em;
  object-fit: contain;
}

.rising { color: #4ade80; font-weight: 500; }
.falling { color: #f87171; font-weight: 500; }
.stable { color: #facc15; font-weight: 500; }
.unstable { color: #fb923c; font-weight: 500; }

#tradeCalculator {
  margin-top: 40px;
}

.calculator-title {
  text-align: center;
  margin-bottom: 30px;
}

.calculator-title h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: #e5e7eb;
  letter-spacing: 1px;
}

.calculator-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.action-btn {
  padding: 12px;
  border: 1px solid #1f2937;
  border-radius: 6px;
  background: #111827;
  color: #e5e7eb;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.calculator-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.share-trade-btn {
  width: 100%;
  padding: 14px;
  border: 1px solid #1f2937;
  border-radius: 6px;
  background: #111827;
  color: #e5e7eb;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.share-trade-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#calculatorContent {
  background: #0b1120;
  padding: 20px;
  border-radius: 8px;
  border: 1px solid #1f2937;
}

.export-header {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-bottom: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid #1f2937;
}

.export-logo { height: 40px; }

.export-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #e5e7eb;
}

.export-watermark {
  display: none;
  padding: 12px;
  margin-top: 15px;
  text-align: center;
  background: #0f172a;
  border-top: 1px solid #1f2937;
  border-radius: 0 0 6px 6px;
}

.watermark-text {
  font-size: 0.85rem;
  color: #9ca3af;
}

.difference-bar {
  margin-bottom: 20px;
  padding: 16px 20px;
  border: 1px solid #1f2937;
  border-radius: 8px;
  background: #111827;
  text-align: center;
}

.difference-content {
  font-size: 1rem;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.difference-percentage {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 8px;
}

.difference-percentage.positive { color: #4ade80; }
.difference-percentage.negative { color: #f87171; }

.difference-bar-visual {
  width: 100%;
  height: 8px;
  background: #1f2937;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 12px;
}

.difference-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4ade80, #22c55e);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.difference-bar-fill.negative {
  background: linear-gradient(90deg, #f87171, #ef4444);
}

.calculator-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.offer-column {
  border: 1px solid #1f2937;
  border-radius: 8px;
  background: #111827;
  padding: 16px;
  transition: all 0.2s;
  min-width: 0;
}

.offer-column.drag-over {
  border-color: #60a5fa;
  background: #0f1a2e;
}

.offer-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #1f2937;
}

.offer-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 10px;
  text-align: center;
}

.offer-totals {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 0.9rem;
  font-weight: 500;
}

.items-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  min-height: 60px;
}

.drop-zone {
  border: 2px dashed transparent;
  border-radius: 6px;
  padding: 8px;
  margin: -8px;
  transition: all 0.2s;
}

.drop-zone.drag-over {
  border-color: #60a5fa;
  background: rgba(96, 165, 250, 0.05);
}

.item-card {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid #1f2937;
  border-radius: 6px;
  background: #0f172a;
  transition: all 0.2s;
  min-width: 0;
}

.item-card-image {
  width: 50px;
  height: 50px;
  object-fit: contain;
  flex-shrink: 0;
}

.item-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.item-card-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #e5e7eb;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-card-prices {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.75rem;
  color: #9ca3af;
}

.item-card-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.item-card-qty {
  width: 50px;
  padding: 5px 8px;
  text-align: center;
  border: 1px solid #1f2937;
  border-radius: 4px;
  background: #111827;
  color: #e5e7eb;
  font-size: 0.85rem;
}

.item-card-qty:focus {
  border-color: #334155;
  background: #0f172a;
}

.item-card-remove {
  padding: 5px 10px;
  background: #111827;
  border: 1px solid #991b1b;
  border-radius: 4px;
  color: #fca5a5;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.add-item-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border: 1px dashed #374151;
  border-radius: 6px;
  background: #0f172a;
  cursor: pointer;
  transition: all 0.2s;
}

.add-icon {
  font-size: 2rem;
  font-weight: 300;
  line-height: 1;
  margin-bottom: 6px;
  color: #9ca3af;
}

.add-text {
  font-size: 0.8rem;
  color: #6b7280;
}

.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 17, 32, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
}

.modal-close,
.modal-close-history,
.modal-close-quick {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.8rem;
  color: #6b7280;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
  z-index: 10;
}

.modal-content h3 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 600;
  color: #e5e7eb;
}

.modal-content input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #1f2937;
  border-radius: 6px;
  background: #0f172a;
  color: #e5e7eb;
  font-size: 0.95rem;
}

.modal-content input:focus {
  border-color: #334155;
  background: #111827;
}

.modal-results {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-result-item {
  display: grid;
  grid-template-columns: 50px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid #1f2937;
  border-radius: 6px;
  background: #0f172a;
  cursor: pointer;
  transition: all 0.2s;
}

.modal-result-image {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.recommendations {
  margin-top: 20px;
  padding: 20px;
  border: 1px solid #1f2937;
  border-radius: 8px;
  background: #111827;
}

.recommendations h3 {
  margin: 0 0 15px 0;
  font-size: 1.1rem;
  color: #e5e7eb;
}

#recommendationsContent {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.recommendation-item {
  padding: 12px;
  border: 1px solid #1f2937;
  border-radius: 6px;
  background: #0f172a;
  cursor: grab;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.recommendation-item:active {
  cursor: grabbing;
  opacity: 0.5;
}

.recommendation-item.dragging { opacity: 0.5; }

.recommendation-item img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.recommendation-info { flex: 1; }

.recommendation-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: #e5e7eb;
  margin-bottom: 4px;
}

.recommendation-price {
  font-size: 0.8rem;
  color: #9ca3af;
}

.history-list {
  max-height: 500px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  padding: 15px;
  border: 1px solid #1f2937;
  border-radius: 6px;
  background: #0f172a;
  cursor: pointer;
  transition: all 0.2s;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.history-date {
  font-size: 0.85rem;
  color: #9ca3af;
}

.history-delete {
  padding: 4px 8px;
  border: 1px solid #991b1b;
  border-radius: 4px;
  background: #111827;
  color: #fca5a5;
  font-size: 0.8rem;
  cursor: pointer;
}

.history-trade {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
}

.history-side { font-size: 0.85rem; }

.history-side strong {
  display: block;
  margin-bottom: 5px;
  color: #e5e7eb;
}

.history-items { color: #9ca3af; }

.history-arrow {
  font-size: 1.2rem;
  color: #6b7280;
}

.preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(11, 17, 32, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.preview-modal-content {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 30px;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
}

.preview-modal-content h3 {
  margin: 0 0 20px 0;
  color: #e5e7eb;
  font-size: 1.4rem;
  text-align: center;
}

.preview-image-container {
  margin: 20px 0;
  border: 1px solid #1f2937;
  border-radius: 8px;
  overflow: hidden;
  background: #0b1120;
}

.preview-image-container img {
  width: 100%;
  height: auto;
  display: block;
}

.preview-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.preview-btn {
  padding: 12px 24px;
  border: 1px solid #1f2937;
  border-radius: 6px;
  background: #111827;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
}

.quick-view-modal {
  max-width: 800px;
  max-height: 90vh;
}

.quick-view-content {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  margin-bottom: 20px;
  align-items: stretch;
}

.quick-view-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 8px;
  padding: 20px;
}

.quick-view-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.quick-view-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.quick-view-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
}

.favourite-btn {
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  order: -1;
}

.favourite-btn:hover {
  background: #0f172a;
  border-color: #334155;
}

.favourite-btn.favourited {
  background: #0f172a;
  border-color: #334155;
  color: #fbbf24;
}

.quick-view-details h2 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: #e5e7eb;
  line-height: 1.2;
  flex: 1;
}

.quick-view-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-view-id {
  padding: 6px 12px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #9ca3af;
}

.quick-view-category {
  padding: 6px 12px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 6px;
  font-size: 0.85rem;
  color: #60a5fa;
}

.quick-view-trend {
  padding: 6px 12px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.quick-view-trend.rising { color: #4ade80; }
.quick-view-trend.falling { color: #f87171; }
.quick-view-trend.stable { color: #facc15; }
.quick-view-trend.unstable { color: #fb923c; }

.quick-view-prices {
  display: flex;
  gap: 20px;
  padding: 20px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 8px;
  flex-wrap: wrap;
}

.quick-view-price-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 600;
  color: #e5e7eb;
}

.currency-icon-large {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.quick-view-description {
  padding: 20px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 8px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.quick-view-description h3 {
  margin: 0 0 10px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.5px;
}

.quick-view-description p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #e5e7eb;
}

.quick-view-notes {
  padding: 20px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 8px;
  margin-bottom: 20px;
}

.quick-view-notes h3 {
  margin: 0 0 12px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.5px;
}

#itemNotes {
  width: 100%;
  min-height: 80px;
  padding: 12px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 6px;
  color: #e5e7eb;
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 10px;
}

#itemNotes:focus {
  outline: none;
  border-color: #334155;
}

.save-notes-btn {
  padding: 10px 20px;
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 6px;
  color: #e5e7eb;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.save-notes-btn:hover {
  background: #0f172a;
  border-color: #334155;
}

.quick-view-price-history {
  padding: 20px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 8px;
  margin-bottom: 20px;
}

.quick-view-price-history h3 {
  margin: 0 0 15px 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 0.5px;
}

#priceHistoryChart {
  width: 100% !important;
  height: 200px !important;
}

.quick-view-last-updated {
  padding: 12px 20px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.last-updated-label {
  color: #9ca3af;
  font-weight: 500;
}

.last-updated-date {
  color: #e5e7eb;
  font-weight: 600;
}

.quick-view-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 120px;
  grid-template-rows: auto auto;
  gap: 12px;
  margin-bottom: 20px;
}

.quick-view-btn {
  padding: 14px 16px;
  border: 1px solid #1f2937;
  border-radius: 8px;
  background: #111827;
  color: #e5e7eb;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.quick-view-quantity {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 8px;
}

.quick-view-quantity label {
  font-size: 0.75rem;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quick-view-quantity input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #1f2937;
  border-radius: 6px;
  background: #111827;
  color: #e5e7eb;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}

.quick-view-quantity input:focus {
  border-color: #334155;
  background: #0f172a;
}

.quick-view-btn-secondary {
  grid-column: 1 / -1;
  background: #111827;
  border: 1px solid #1f2937;
}

.quick-view-similar {
  padding-top: 20px;
  border-top: 1px solid #1f2937;
}

.quick-view-similar h3 {
  margin: 0 0 16px 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: #e5e7eb;
}

.similar-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.similar-item-card {
  padding: 12px;
  background: #0f172a;
  border: 1px solid #1f2937;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.similar-item-card img {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.similar-item-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: #e5e7eb;
}

.similar-item-price {
  font-size: 0.75rem;
  color: #9ca3af;
  display: flex;
  align-items: center;
  gap: 4px;
}

.similar-item-price img {
  width: 14px;
  height: 14px;
}

footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #1f2937;
  color: #6b7280;
  font-size: 0.85rem;
  text-align: center;
}

footer a {
  color: #60a5fa;
  text-decoration: none;
}

@media (hover: hover) {
  button:hover { background: #0f172a; border-color: #334155; }
  .action-btn:hover { background: #0f172a; border-color: #334155; }
  .share-trade-btn:hover { background: #0f172a; border-color: #334155; }
  .item-card-list:hover { background: #0f172a; border-color: #334155; }
  .item-card:hover { background: #1a1f2e; border-color: #374151; }
  .item-card-remove:hover { background: #7f1d1d; border-color: #b91c1c; }
  .add-item-box:hover { border-color: #4b5563; background: #1a1f2e; }
  .modal-close:hover,
  .modal-close-history:hover,
  .modal-close-quick:hover { color: #e5e7eb; }
  .modal-result-item:hover { background: #1a1f2e; border-color: #374151; }
  .recommendation-item:hover { background: #1a1f2e; border-color: #60a5fa; transform: translateY(-2px); }
  .history-item:hover { background: #1a1f2e; border-color: #60a5fa; }
  .history-delete:hover { background: #7f1d1d; }
  .preview-btn:hover { background: #0f172a; border-color: #334155; }
  .quick-view-btn:hover { background: #0f172a; border-color: #334155; }
  .similar-item-card:hover { background: #1a1f2e; border-color: #60a5fa; transform: translateY(-2px); }
  footer a:hover { text-decoration: underline; }
}

@media (max-width: 1440px) {
  body > * { max-width: 100%; }
}

@media (max-width: 768px) {
  body { padding: 15px; }
  header { padding: 15px; }
  .logo { height: 40px; }
  header h1 { font-size: 1.2rem; }
  #itemsContainer { grid-template-columns: 1fr; }
  .controls-bar { flex-direction: column; align-items: stretch; }
  .search-autocomplete, .search-history { max-height: 200px; }
  .calculator-title h2 { font-size: 1.5rem; }
  .calculator-actions { grid-template-columns: 1fr 1fr; }
  .action-btn { padding: 10px; font-size: 0.85rem; }
  .calculator-btn-row { grid-template-columns: 1fr; }
  .calculator-body { grid-template-columns: 1fr; gap: 15px; }
  .offer-column { padding: 12px; }
  .offer-title { font-size: 1rem; }
  .offer-totals { font-size: 0.85rem; gap: 12px; }
  .item-card { grid-template-columns: 45px 1fr; grid-template-rows: auto auto; align-items: start; gap: 8px; padding: 10px; }
  .item-card-image { width: 45px; height: 45px; grid-row: 1; grid-column: 1; }
  .item-card-info { grid-row: 1; grid-column: 2; }
  .item-card-name { font-size: 0.85rem; }
  .item-card-prices { flex-direction: column; font-size: 0.7rem; gap: 2px; }
  .item-card-controls { grid-row: 2; grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 4px; }
  .item-card-qty { width: 50px; padding: 5px 8px; font-size: 0.8rem; }
  .item-card-remove { padding: 5px 12px; font-size: 0.75rem; }
  .add-item-box { padding: 16px; }
  .add-icon { font-size: 1.5rem; }
  .add-text { font-size: 0.75rem; }
  #recommendationsContent { grid-template-columns: 1fr; }
  .modal-content { padding: 20px; max-height: 90vh; }
  .preview-modal { padding: 10px; }
  .preview-modal-content { padding: 20px; }
  .preview-buttons { flex-direction: column; }
  .preview-btn { width: 100%; }
  .quick-view-content { grid-template-columns: 1fr; gap: 16px; }
  .quick-view-image { height: 200px; padding: 16px; }
  .quick-view-details h2 { font-size: 1.5rem; }
  .quick-view-prices { flex-direction: column; gap: 12px; }
  #priceHistoryChart { height: 180px !important; }
  .quick-view-price-history { padding: 15px; margin-bottom: 16px; }
  .quick-view-last-updated { padding: 10px 15px; font-size: 0.85rem; flex-wrap: wrap; margin-bottom: 16px; }
  .quick-view-actions { grid-template-columns: 1fr; grid-template-rows: auto; margin-bottom: 16px; }
  .quick-view-quantity { flex-direction: row; justify-content: space-between; }
  .quick-view-quantity input { width: 80px; }
  .quick-view-btn-secondary { grid-column: 1; }
  .similar-items-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

@media (max-width: 480px) {
  body { padding: 10px; }
  header h1 { font-size: 1rem; }
  .calculator-title h2 { font-size: 1.2rem; }
  .calculator-actions { grid-template-columns: 1fr; }
  .action-btn { font-size: 0.8rem; padding: 8px; }
  .modal-content { padding: 15px; }
  .modal-content h3 { font-size: 1.2rem; }
  .quick-view-details h2 { font-size: 1.2rem; }
  #priceHistoryChart { height: 160px !important; }
  .quick-view-price-history { padding: 12px; }
  .quick-view-price-history h3 { font-size: 0.9rem; }
  .similar-items-grid { grid-template-columns: 1fr 1fr; }
}
