* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  background: #f5f6f8;
  color: #1a1a1a;
}

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

h1 { font-size: 20px; margin: 0; }

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  background: #e5e7eb;
  color: #1a1a1a;
  font-size: 14px;
}

button.primary {
  background: #2563eb;
  color: white;
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 8px;
}

#statusBanner {
  font-size: 13px;
  color: #555;
  min-height: 18px;
  margin-bottom: 8px;
}

#addForm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: white;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 14px;
  border: 1px solid #e5e5e5;
}

#addForm input, #addForm select, details select {
  padding: 10px;
  border: 1px solid #d1d1d1;
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
}

details {
  background: white;
  border-radius: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e5e5;
}

details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  padding: 4px 0;
}

details input, details select {
  margin-top: 8px;
}

.threshold-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.threshold-row select { flex: 1; }
.threshold-row input { width: 80px; }

#productList {
  list-style: none;
  margin: 0 0 14px 0;
  padding: 0;
}

.product-item {
  background: white;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}

.item-row { display: flex; gap: 10px; }
.item-info { flex: 1; min-width: 0; }

.thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
  background: #f0f0f0;
  border: 1px solid #e5e5e5;
}
.thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bbb;
  font-size: 18px;
}

.title {
  font-weight: 600;
  font-size: 14px;
  display: block;
  margin-bottom: 2px;
}

.url {
  font-size: 11px;
  color: #888;
  display: block;
  word-break: break-all;
  margin-bottom: 6px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.price-current { font-size: 17px; font-weight: 700; }
.price-drop { color: #16a34a; }
.price-error { color: #dc2626; font-size: 12px; margin-top: 4px; }

.stock-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.stock-in { background: #dcfce7; color: #16a34a; }
.stock-out { background: #fee2e2; color: #dc2626; }

.remove-btn {
  background: #f3f4f6;
  color: #444;
  font-size: 12px;
  padding: 6px 10px;
}

.meta-line {
  font-size: 11px;
  color: #999;
  margin-top: 6px;
}

.hint {
  font-size: 11px;
  color: #999;
  margin: 8px 0 0;
}

#settingsSection label {
  display: block;
  font-size: 13px;
  margin-top: 10px;
  margin-bottom: 4px;
}

#settingsSection input, #settingsSection select {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d1d1;
  border-radius: 8px;
  font-size: 14px;
}
