:root {
  color-scheme: dark;
  --bg: #07131a;
  --surface: #0c1d27;
  --surface-alt: #112734;
  --border: #3a6073;
  --border-strong: #67a8c4;
  --text: #eef6f8;
  --text-muted: #b7cfd9;
  --accent: #38e59a;
  --accent-ink: #04130d;
  --focus: #ffd60a;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  overflow-x: clip;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.preview-bar {
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.preview-bar a { color: var(--accent); font-weight: 600; }

main {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

h1 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.85rem); line-height: 1.25; }
.subtitle { margin: 0; color: var(--text-muted); }

.search-box-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
}

input[type="search"] {
  flex: 1 1 200px;
  min-width: 0;
  width: 100%;
  min-height: 48px;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  border-radius: 10px;
  border: 2px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
}

button {
  min-height: 48px;
  min-width: 48px;
  padding: 0.55rem 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  cursor: pointer;
}

button.primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

.help-panel {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font-size: 0.92rem;
}

.status-strip {
  font-size: 0.86rem;
  color: var(--text-muted);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.listing-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.listing-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  overflow-wrap: anywhere;
}

.listing-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.listing-tag {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-alt);
  border: 1px solid var(--border-strong);
}

.listing-meta { font-size: 0.84rem; color: var(--text-muted); }

/* Non-blocking 1x1 hidden WebGPU compute surface (never display:none, always tabindex=-1) */
#canvas {
  position: fixed;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 480px) {
  main { padding: 1rem 0.6rem 2rem; }
  .search-box-wrap button { width: 100%; }
}
