:root {
  color-scheme: light dark;
  --bg: #0f1115;
  --panel: #171a21;
  --border: #2a2f3a;
  --text: #e7e9ee;
  --muted: #9aa2b1;
  --accent: #4f8cff;
  --best: #1f7a3f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

h1 {
  font-size: 1.6rem;
  margin-bottom: 4px;
}

.subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0;
  margin-bottom: 24px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
}

.search-field {
  flex: 1 1 240px;
}

label {
  font-size: 0.8rem;
  color: var(--muted);
}

input, select, button {
  font-size: 0.95rem;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #0c0e13;
  color: var(--text);
}

button {
  background: var(--accent);
  border: none;
  color: white;
  cursor: pointer;
  font-weight: 600;
}

button:disabled {
  background: #3a3f4b;
  cursor: not-allowed;
}

.suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  background: #0c0e13;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-top: 4px;
  max-height: 260px;
  overflow-y: auto;
}

.suggestions.hidden {
  display: none;
}

.suggestion {
  padding: 8px 10px;
  cursor: pointer;
}

.suggestion:hover, .suggestion.active {
  background: #1a1e27;
}

.suggestion .en {
  color: var(--muted);
  font-size: 0.8rem;
}

.build-list-section {
  margin-top: 20px;
}

.build-list-section.hidden {
  display: none;
}

.build-list-section h2 {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 8px;
}

#build-table select {
  padding: 4px 8px;
}

.remove-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  width: 28px;
  height: 28px;
  padding: 0;
  line-height: 1;
  font-size: 1rem;
}

.remove-btn:hover {
  color: #ff6b6b;
  border-color: #ff6b6b;
}

.city-controls {
  margin-top: 16px;
}

.status {
  margin-top: 16px;
  color: var(--muted);
}

.status.hidden, .total.hidden {
  display: none;
}

.status.error {
  color: #ff6b6b;
}

.total {
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.total-warning {
  margin-top: 4px;
  color: #e0a83e;
  font-size: 0.85rem;
}

.result {
  margin-top: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

th {
  color: var(--muted);
  font-weight: 600;
}

tr.best {
  background: rgba(31, 122, 63, 0.25);
}

tr.best td:first-child::after {
  content: " ★ лучшая цена";
  color: #59d685;
  font-size: 0.75rem;
}

tr.stale td:last-child {
  color: #e0a83e;
}

tr.no-price td {
  color: var(--muted);
}
