*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:       #0f1117;
  --surface:  #1a1d27;
  --surface2: #22263a;
  --border:   #2e3348;
  --accent:   #6c63ff;
  --accent2:  #00d4aa;
  --danger:   #ff4d6d;
  --text:     #e4e6f1;
  --muted:    #6b7280;
  --radius:   10px;
}

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--accent); }

.hidden { display: none !important; }
.muted  { color: var(--muted); }

button, .btn {
  cursor: pointer;
  font: inherit;
  border: none;
  border-radius: var(--radius);
  transition: background .15s, opacity .15s;
  display: inline-block;
  text-decoration: none;
}
button:hover, .btn:hover { opacity: .85; }
button:disabled { opacity: .4; cursor: default; }

.btn-primary { background: var(--accent); color: #fff; padding: 10px 20px; font-weight: 600; }
.btn-ghost   { background: var(--surface2); color: var(--text); padding: 10px 20px; border: 1px solid var(--border); }

input, textarea, select {
  font: inherit;
  color: var(--text);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  outline: none;
  width: 100%;
  transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { border-color: var(--accent); }
label { display: block; font-size: 13px; color: var(--muted); margin: 16px 0 6px; }
label:first-child { margin-top: 0; }

/* Honeypot: hidden from sighted humans, still reachable by bots that fill every field. */
.hp-field { position: absolute; left: -9999px; top: -9999px; opacity: 0; height: 0; overflow: hidden; }

.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }

header.site {
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
header.site .logo { font-weight: 700; font-size: 18px; color: var(--text); text-decoration: none; }
header.site .logo span { color: var(--accent); }
header.site nav a { color: var(--muted); text-decoration: none; margin-left: 18px; font-size: 14px; }
header.site nav a:hover { color: var(--text); }

.hero { padding: 48px 0 28px; text-align: center; }
.hero h1 { font-size: 32px; margin-bottom: 10px; }
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 24px 0; }
.toolbar input[type=search] { flex: 1; min-width: 200px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 24px; }
.chip {
  background: var(--surface2); border: 1px solid var(--border); color: var(--muted);
  padding: 6px 14px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text);
}
.card:hover { border-color: var(--accent); opacity: 1; }
.card .row { display: flex; align-items: center; gap: 10px; }
.card img.favicon { width: 28px; height: 28px; border-radius: 6px; background: var(--surface2); }
.card h3 { font-size: 16px; }
.card .tagline { color: var(--muted); font-size: 13.5px; flex: 1; }
.card .meta { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; color: var(--muted); }
.badge { background: var(--surface2); border-radius: 6px; padding: 2px 8px; }

.empty { text-align: center; color: var(--muted); padding: 60px 0; }

.detail { padding: 32px 0; }
.detail .row { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.detail img.favicon { width: 48px; height: 48px; border-radius: 10px; background: var(--surface2); }
.detail h1 { font-size: 26px; }
.detail .tagline { color: var(--muted); margin-bottom: 18px; }
.detail .desc { white-space: pre-wrap; line-height: 1.7; margin: 20px 0; }
.detail .actions { display: flex; gap: 10px; align-items: center; margin: 20px 0; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.tag { background: var(--surface2); border-radius: 6px; padding: 3px 10px; font-size: 12.5px; color: var(--muted); }

form.card-form {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 28px; max-width: 640px; margin: 24px auto;
}
.field-error { color: var(--danger); font-size: 13px; margin-top: 6px; }
.form-msg { margin: 16px 0; padding: 12px 14px; border-radius: var(--radius); font-size: 14px; }
.form-msg.error { background: rgba(255,77,109,.12); color: var(--danger); border: 1px solid rgba(255,77,109,.3); }
.form-msg.success { background: rgba(0,212,170,.12); color: var(--accent2); border: 1px solid rgba(0,212,170,.3); }

.thanks { text-align: center; padding: 80px 0; }
.thanks .edit-link { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; word-break: break-all; margin: 20px auto; max-width: 480px; font-size: 13.5px; }

footer.site { border-top: 1px solid var(--border); padding: 24px 0; text-align: center; color: var(--muted); font-size: 13px; margin-top: 40px; }

/* Admin */
.admin-panel { max-width: 720px; margin: 60px auto; }
.queue-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.queue-item .actions { display: flex; gap: 8px; margin-top: 12px; }
.score { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--surface2); color: var(--muted); }
.score.high { background: rgba(255,77,109,.15); color: var(--danger); }
