:root {
  --bg: #060d1f;
  --bg2: #0a1830;
  --card: #0c1c38;
  --line: #1e3d6e;
  --text: #e6f4ff;
  --dim: #8ba3c7;
  --accent: #22d3ee;
  --teal: #2dd4bf;
  --red: #ff6b6b;
  --amber: #ffb84d;
  --cta: linear-gradient(135deg, #22d3ee, #2dd4bf);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: linear-gradient(165deg, #060d1f 0%, #0a1f44 100%);
  background-attachment: fixed; color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  line-height: 1.55;
}
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent); }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* header */
.site-header {
  background: linear-gradient(180deg, rgba(10,31,68,.92), rgba(6,13,31,.92));
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10;
  overflow: hidden;
}
.site-header::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 42%, rgba(34,211,238,.10) 50%, transparent 58%);
  transform: translateX(-100%);
  animation: aegisHeaderShimmer 6s ease-in-out infinite;
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; padding-bottom: 12px; position: relative; }
.brand { display: flex; align-items: center; gap: 12px; }
.logo {
  width: 42px; height: 42px; border-radius: 10px; background: var(--cta);
  border: 1px solid rgba(34,211,238,.45); display: flex; align-items: center; justify-content: center;
  font-family: monospace; font-weight: bold; font-size: 20px; color: #04222e;
  box-shadow: 0 0 18px rgba(34,211,238,.35);
}
.brand h1 { margin: 0; font-size: 22px; letter-spacing: 0.5px; }
.tagline { margin: 0; color: var(--dim); font-size: 13px; }
.site-header nav a { color: var(--dim); text-decoration: none; font-size: 14px; margin-left: 18px; }
.site-header nav a:hover { color: var(--text); }

/* tabs */
.tabs { display: flex; gap: 8px; margin: 26px 0 20px; }
.tab {
  background: var(--bg2); border: 1px solid var(--line); color: var(--dim);
  border-radius: 10px; padding: 10px 22px; font-size: 15px; cursor: pointer;
}
.tab:hover { color: var(--text); border-color: var(--accent); }
.tab.active {
  background: var(--card); color: var(--text); border-color: var(--accent);
  box-shadow: 0 0 14px rgba(34,211,238,.18);
}
.tab .keyless {
  font-size: 11px; color: var(--teal); border: 1px solid var(--teal);
  border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px;
}

/* layout */
.gen-grid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; padding-bottom: 40px; }
.verify-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .gen-grid, .verify-grid { grid-template-columns: 1fr; } }
.schema-panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; align-self: start;
  box-shadow: 0 4px 24px rgba(3,8,20,.45);
}
h3 { font-size: 14px; margin: 18px 0 10px; color: var(--text); }
h3:first-child { margin-top: 0; }
.lede { color: var(--dim); font-size: 15px; max-width: 760px; }

textarea, input[type="text"], input[type="password"], select {
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 10px 12px; font-size: 13.5px; width: 100%;
}
textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; }
input[type="password"], input[type="text"] { margin-bottom: 8px; }
label.muted { display: block; margin-top: 12px; }
.muted { color: var(--dim); font-size: 13px; }
.muted-sm { color: var(--dim); font-size: 12px; font-weight: normal; }

.btnrow { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.btn {
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 8px 16px; font-size: 13.5px; cursor: pointer;
}
.btn:hover { border-color: var(--accent); box-shadow: 0 0 10px rgba(34,211,238,.15); }
.btn.primary {
  background: var(--cta); border-color: transparent; color: #03232c; font-weight: 700;
  box-shadow: 0 2px 16px rgba(34,211,238,.30);
}
.btn.primary:hover { box-shadow: 0 2px 22px rgba(34,211,238,.45); }
.btn:disabled { opacity: .45; cursor: default; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.chip {
  background: var(--bg2); border: 1px solid var(--line); color: var(--dim);
  border-radius: 999px; padding: 5px 14px; font-size: 12.5px; cursor: pointer;
}
.chip:hover { color: var(--text); border-color: var(--teal); }

/* loop log */
.loop-log {
  margin-top: 14px; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--dim);
}
.loop-log .round { margin-bottom: 6px; }
.loop-log .round:last-child { margin-bottom: 0; }
.loop-log .bad { color: var(--red); }
.loop-log .good { color: var(--teal); }

/* verdict */
.verdict {
  position: relative;
  margin: 18px 0 6px; padding: 12px 16px; border-radius: 10px; font-weight: 700; font-size: 15px;
  border: 1px solid var(--line); background: var(--bg2);
}
.verdict::after {
  content: ""; position: absolute; inset: -2px; border-radius: 12px;
  border: 2px solid rgba(34,211,238,.5); opacity: 0; pointer-events: none;
  animation: aegisShieldPulse 3s ease-out infinite;
}
.verdict.safe {
  border-color: var(--teal); color: var(--teal);
  background: linear-gradient(135deg, rgba(34,211,238,.10), rgba(45,212,191,.10));
  box-shadow: 0 0 28px rgba(45,212,191,.22), inset 0 0 14px rgba(45,212,191,.06);
}
.verdict.safe::after { border-color: rgba(45,212,191,.65); }
.verdict.review { border-color: var(--amber); color: var(--amber); }
.verdict.review::after { border-color: rgba(255,184,77,.55); }
.verdict.blocked { border-color: var(--red); color: var(--red); }
.verdict.blocked::after { border-color: rgba(255,107,107,.55); }

/* sql output */
.sqlout {
  background: #071026; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; overflow: auto; font-size: 13.5px; white-space: pre-wrap;
}

/* issues */
.issues { display: flex; flex-direction: column; gap: 8px; }
.issue {
  border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px;
  padding: 10px 14px; background: var(--bg2); font-size: 13.5px;
}
.issue.error { border-left-color: var(--red); }
.issue.warning { border-left-color: var(--amber); }
.issue.info { border-left-color: var(--accent); }
.issue .code {
  font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--dim); display: block; margin-bottom: 2px;
}
.issue.error .code { color: var(--red); }
.issue.warning .code { color: var(--amber); }
.issue .sugg { color: var(--dim); font-size: 12.5px; margin-top: 4px; }
.issue .sugg::before { content: "→ "; }
.no-issues { color: var(--teal); font-size: 14px; }

.explain {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; font-size: 14px;
  box-shadow: 0 4px 24px rgba(3,8,20,.45);
}

/* about */
.article { max-width: 760px; margin: 30px auto 60px; }
.article h2 { margin-top: 30px; }
.article h3 { margin-top: 24px; color: var(--accent); font-size: 16px; }
.article code { background: var(--bg2); padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.article pre { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; overflow: auto; font-size: 13px; }
.article table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 12px 0; }
.article th, .article td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.article th { background: var(--bg2); }

.site-footer { border-top: 1px solid var(--line); padding: 24px 0 40px; margin-top: 20px; }
.site-footer p { margin: 6px 0; font-size: 13.5px; color: var(--dim); }
[hidden] { display: none !important; }

/* AEGIS signature animations (transform/opacity only) */
@keyframes aegisShieldPulse {
  0% { transform: scale(1); opacity: .75; }
  70% { transform: scale(1.045); opacity: 0; }
  100% { transform: scale(1.045); opacity: 0; }
}
@keyframes aegisHeaderShimmer {
  0% { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
