:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #6b7280;
  --line: #dbe3ee;
  --accent: #0f8b8d;
  --accent-dark: #0b6668;
  --warn: #b45309;
  --bad: #b91c1c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 32px auto;
  display: grid;
  gap: 18px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 12px 36px rgba(29, 43, 67, 0.07);
}
.hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}
.kicker {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
}
h1, h2, h3 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.02; }
h2 { font-size: 20px; }
h3 { font-size: 18px; }
.status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 13px;
  color: var(--muted);
  white-space: nowrap;
}
.status.ok { color: var(--accent-dark); }
.status.bad { color: var(--bad); }
.grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 14px;
  align-items: end;
}
label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}
input, button {
  min-height: 42px;
  border-radius: 7px;
  border: 1px solid var(--line);
  font: inherit;
}
input {
  padding: 0 12px;
  background: #fbfdff;
  color: var(--text);
}
button {
  padding: 0 16px;
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  font-weight: 750;
  cursor: pointer;
}
button.secondary, .actions button {
  background: #ffffff;
  color: var(--accent-dark);
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.alerts {
  display: grid;
  gap: 12px;
}
.alert-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fbfdff;
}
.meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.price {
  font-size: 20px;
  font-weight: 800;
  text-align: right;
}
.actions {
  display: flex;
  gap: 8px;
}
.empty {
  color: var(--muted);
  padding: 14px 0;
}
@media (max-width: 860px) {
  .hero, .section-head { align-items: flex-start; flex-direction: column; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid button { grid-column: 1 / -1; }
  .alert-card { grid-template-columns: 1fr; }
  .price { text-align: left; }
}
@media (max-width: 520px) {
  .shell { width: min(100% - 20px, 1120px); margin: 10px auto; }
  .panel { padding: 16px; }
  .grid { grid-template-columns: 1fr; }
}

.place-field {
  position: relative;
}
.suggestions {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(29, 43, 67, 0.16);
}
.suggestions[hidden] { display: none; }
.suggestion {
  min-height: 58px;
  display: grid;
  gap: 3px;
  justify-items: start;
  align-content: center;
  padding: 10px 12px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  text-align: left;
}
.suggestion:last-child { border-bottom: 0; }
.suggestion:hover, .suggestion:focus { background: #eef8f8; }
.suggestion b { color: var(--accent-dark); }
.suggestion small {
  color: var(--muted);
  font-size: 12px;
}

.alert-main {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.history-chart {
  width: min(100%, 520px);
  height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}
.delete {
  color: var(--bad) !important;
  border-color: #f1c7c7 !important;
}
.delete:hover, .delete:focus {
  background: #fff1f1 !important;
}

.head-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.edit {
  color: var(--accent-dark) !important;
}
#cancelEdit[hidden] {
  display: none;
}

