:root {
  --bg: #0b0c0f;
  --fg: #eaeef3;
  --muted: #a7b1bd;
  --card: #13161b;
  --border: #2a2f36;
  --brand: #2ea8ff;
  --accent: #00cc88;
  --error: #ff4d4f;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #ffffff;
    --fg: #0b0c0f;
    --muted: #4b5563;
    --card: #f8fafc;
    --border: #e5e7eb;
    --brand: #0067c8;
    --accent: #059669;
    --error: #c62828;
  }
}
[data-theme="light"] {
  --bg: #ffffff;
  --fg: #0b0c0f;
  --muted: #4b5563;
  --card: #f8fafc;
  --border: #e5e7eb;
  --brand: #0067c8;
  --accent: #059669;
  --error: #c62828;
}
[data-theme="dark"] {
  --bg: #0b0c0f;
  --fg: #eaeef3;
  --muted: #a7b1bd;
  --card: #13161b;
  --border: #2a2f36;
  --brand: #2ea8ff;
  --accent: #00cc88;
  --error: #ff4d4f;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

header {
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.container { width: min(1100px, 94%); margin: 0 auto; }
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 0;
}
.brand {
  display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.2px;
}
.brand img { width: 28px; height: 28px; }
.search { flex: 1; display: flex; gap: 8px; align-items: center; }
.search input {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: transparent; color: var(--fg);
}
.lang, .theme { display: inline-flex; gap: 8px; align-items: center; }
select, button {
  background: var(--card); color: var(--fg); border: 1px solid var(--border);
  border-radius: 10px; padding: 8px 12px; cursor: pointer;
}
main { padding: 26px 0 40px; }
.hero { display: grid; gap: 8px; margin: 10px 0 18px; }
.hero h1 { margin: 0; font-size: clamp(22px, 3vw, 28px); }
.muted { color: var(--muted); }
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 16px;
}
.card h3 { margin: 0 0 8px; font-size: 16px; }
.small { font-size: 13px; }
.ad-slot { display:block; min-height: 280px; border: 1px dashed var(--border); border-radius: 12px; padding: 6px; }
.ad-label { font-size: 11px; color: var(--muted); margin-bottom: 4px; }

.columns { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .columns { grid-template-columns: 1fr 1fr; } }
textarea, pre {
  width: 100%; min-height: 320px; padding: 12px; border-radius: 12px; border: 1px solid var(--border);
  background: #0d0f13; color: #eaeef3; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  overflow: auto;
}
@media (prefers-color-scheme: light) {
  textarea, pre { background: #f8fafc; color: #111827; }
}
.btns { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-primary { background: var(--brand); color: white; border-color: transparent; }
.btn-ghost { background: transparent; }
.error { color: var(--error); white-space: pre-wrap; }

footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  margin-top: 40px;
}
footer .footer-inner {
  display: grid; gap: 10px; padding: 18px 0;
  grid-template-columns: 1fr; align-items: center;
}
@media (min-width: 700px) {
  footer .footer-inner { grid-template-columns: 1fr auto auto; }
}

/* Consent banner (stub) */
.consent {
  position: fixed; inset: auto 0 18px 0; margin: 0 auto; width: min(720px, 94%);
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 9999;
  display: none;
}
.consent.show { display: block; }
.consent .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.consent .actions { display: flex; gap: 8px; }