* { box-sizing: border-box; }

body {
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  margin: 0;
  background: #f6f7f9;
  color: #111;
}

header {
  padding: 1rem 1.5rem;
  background: #fff;
  border-bottom: 1px solid #e3e5e8;
  position: sticky;
  top: 0;
  z-index: 10;
}
header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
header h1 .brand {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
}
header h1 .logo {
  width: 28px;
  height: 28px;
  display: block;
}

form { display: flex; gap: 0.5rem; }
input[type="search"] {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border: 1px solid #c4c7cd;
  border-radius: 6px;
  font: inherit;
  /* Mobile Safari zooms in when an input's font-size is < 16px on focus.
     Explicit 16px overrides the 14px inherited from body. */
  font-size: 16px;
}
button {
  padding: 0.55rem 1rem;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
}
button:hover { background: #1d4ed8; }

#status {
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.5rem;
  min-height: 1.2em;
}
#status .adapter { white-space: nowrap; }
#status .adapter.running { color: #2563eb; }
#status .adapter.done { color: #555; }
#status .adapter.err { color: #b91c1c; }

.spinner {
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-left: 0.25em;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -0.15em;
  animation: amadexa-spin 0.8s linear infinite;
}
@keyframes amadexa-spin {
  to { transform: rotate(360deg); }
}

main {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  padding: 1.5rem;
}

.card {
  background: #fff;
  border: 1px solid #e3e5e8;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s ease;
}
.card:hover { box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08); }
.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #eef0f3;
}
.card .body {
  padding: 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.card .source {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}
.card .title { font-weight: 600; line-height: 1.3; }
.card .price { color: #166534; font-weight: 600; }
.card .meta { font-size: 0.8rem; color: #555; }
.card a.listing {
  color: inherit;
  text-decoration: none;
  display: contents;
}
