:root {
  --bg: #111312;
  --panel: #1a1d1b;
  --panel-2: #222623;
  --line: #2f3430;
  --text: #e6e8e3;
  --muted: #9aa198;
  --accent: #f2c230;      /* hazard yellow */
  --accent-ink: #1a1500;
  --ok: #6fcf7a;
  --warn: #f08a3c;
  --danger: #ef5b5b;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 6px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--mono); letter-spacing: -0.01em; line-height: 1.2; }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 0.75rem; }

/* header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.logo { font-family: var(--mono); font-weight: 700; color: var(--text); font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem; }
.logo:hover { text-decoration: none; }
.logo-mark {
  display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem;
  background: var(--accent); color: var(--accent-ink); border-radius: 4px; font-size: 0.95rem;
}
.top nav { display: flex; gap: 1rem; align-items: center; font-size: 0.95rem; flex-wrap: wrap; }
.top nav a { color: var(--muted); }
.top nav a:hover, .top nav a.active { color: var(--text); text-decoration: none; }

/* hazard-tape strip */
.hazard {
  background: var(--panel);
  color: var(--text);
  text-align: center;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-image: repeating-linear-gradient(135deg, var(--accent) 0 10px, #000 10px 20px) 4;
}

main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

.bottom { border-top: 1px solid var(--line); padding: 1rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
.bottom a { color: var(--muted); }

/* toolbar */
.toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.toolbar input[type=search] { flex: 1 1 240px; }

/* forms */
input, select, textarea, button {
  font: inherit; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 0.55rem 0.7rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
textarea { min-height: 5rem; resize: vertical; width: 100%; }
button, .btn {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
  font-weight: 600; cursor: pointer; display: inline-block;
}
button.secondary { background: transparent; color: var(--text); border-color: var(--line); }
button:disabled { opacity: 0.5; cursor: wait; }
label { display: block; font-size: 0.85rem; color: var(--muted); margin-bottom: 0.25rem; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin: 0 0 1.25rem; }
legend { font-family: var(--mono); padding: 0 0.4rem; color: var(--text); }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.9rem; }
.grid-form .wide { grid-column: 1 / -1; }
.grid-form input, .grid-form select { width: 100%; }
.hint { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: var(--text); display: flex; flex-direction: column;
}
.card:hover { border-color: var(--accent); text-decoration: none; }
.card .thumb { aspect-ratio: 1; background: var(--panel-2); display: grid; place-items: center; color: var(--muted); font-family: var(--mono); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .body { padding: 0.75rem; display: grid; gap: 0.3rem; }
.card .mk { font-family: var(--mono); font-weight: 600; word-break: break-word; }
.card .sub { color: var(--muted); font-size: 0.85rem; }

.tag {
  display: inline-block; font-family: var(--mono); font-size: 0.75rem;
  padding: 0.05rem 0.4rem; border: 1px solid var(--line); border-radius: 3px; color: var(--muted);
}
.tag.pending { color: var(--warn); border-color: var(--warn); }
.tags { display: flex; gap: 0.3rem; flex-wrap: wrap; }

/* detail */
.detail { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 2rem; }
@media (max-width: 760px) {
  .detail { grid-template-columns: 1fr; }
  .detail .gallery { order: -1; }   /* photos first on phones */
}
.specs { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.specs th, .specs td { text-align: left; padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.specs th { color: var(--muted); font-weight: normal; width: 42%; }
.specs td { font-family: var(--mono); }
.gallery { display: grid; gap: 0.75rem; }
.gallery figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.gallery img { width: 100%; display: block; }
.gallery figcaption { padding: 0.5rem 0.75rem; font-size: 0.85rem; color: var(--muted); }

.notice { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--accent); padding: 0.8rem 1rem; border-radius: var(--radius); margin-bottom: 1rem; }
.notice.error { border-left-color: var(--danger); }
.notice.ok { border-left-color: var(--ok); }
.empty { color: var(--muted); padding: 2rem 0; text-align: center; }

.previews { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; }
.previews img { width: 90px; height: 90px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 760px) { .split { grid-template-columns: 1fr; } }
.stack { display: grid; gap: 0.75rem; }
.stack input { width: 100%; }

.pager { display: flex; gap: 0.5rem; justify-content: center; margin-top: 1.5rem; align-items: center; color: var(--muted); }
.prose { max-width: 68ch; }
