:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --line: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --brand: #2563eb;
  --brand-hover: #1d4ed8;
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #f87171;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}
.card.wide { max-width: 720px; }

.hero { display: block; width: 100%; max-width: 420px; height: auto; aspect-ratio: 16 / 9; margin: 0 auto 12px; border-radius: 16px; background: #000; object-fit: cover; }

h1 { margin: 0 0 4px; font-size: 1.5rem; text-align: center; }
.card.wide h1 { text-align: left; }

.muted { color: var(--muted); text-align: center; margin: 0 0 16px; }
.card.wide .muted { text-align: left; }

.status {
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--line);
}
.status.ok   { color: var(--ok);   border-color: var(--ok); }
.status.warn { color: var(--warn); border-color: var(--warn); }
.status.error{ color: var(--err);  border-color: var(--err); }
.status.off  { color: var(--muted); }

.hint {
  background: #422006;
  border: 1px solid var(--warn);
  color: #fde68a;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: .92rem;
}

.field { display: block; margin: 12px 0; }
.field span { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }

input, textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
}
input:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.grid { display: grid; gap: 0 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid { grid-template-columns: 1fr 1fr; } }

.row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

button {
  flex: 1 1 auto;
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button:hover { background: var(--brand-hover); }
button:disabled { opacity: .6; cursor: progress; }
button.secondary { background: transparent; border: 1px solid var(--line); color: var(--text); }
button.secondary:hover { background: var(--bg); }
button[hidden] { display: none; }

.msg { min-height: 1.4em; margin: 14px 0 0; text-align: center; }
.card.wide .msg { text-align: left; }
.msg.ok { color: var(--ok); }
.msg.error { color: var(--err); }

.tablewrap { overflow-x: auto; margin-top: 8px; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }

.api { margin-top: 20px; color: var(--muted); }
.api summary { cursor: pointer; }
pre {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  overflow-x: auto;
  font-size: .8rem;
  color: var(--text);
}
