:root {
  --bg: #07111d;
  --surface: #0f1b2b;
  --surface-2: #122238;
  --border: #22344c;
  --text: #eef4fb;
  --muted: #a8b5c6;
  --dim: #6f8197;
  --accent: #2bb8d6;
  --purple: #8b5cf6;
  --warning: #f5b84b;
  --danger: #f87171;
  --ok: #35d399;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(43, 184, 214, 0.18), transparent 32%),
    radial-gradient(circle at 88% 20%, rgba(139, 92, 246, 0.14), transparent 30%),
    linear-gradient(135deg, #07111d, #0a1524 52%, #08111e);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
}

a { color: inherit; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px clamp(18px, 4vw, 48px);
  background: rgba(7, 17, 29, 0.82);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
}

.brand small {
  display: block;
  color: var(--dim);
  font-size: 11px;
  margin-top: 1px;
}

.mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: white;
  font-weight: 800;
}

nav {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

nav a { text-decoration: none; }
nav a:hover { color: var(--accent); }

main {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 32px;
  min-height: 68vh;
  align-items: center;
  padding: 78px 0 64px;
}

.eyebrow {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 12px;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  font-size: clamp(42px, 8vw, 78px);
  line-height: 0.95;
  max-width: 760px;
  margin-bottom: 22px;
  letter-spacing: -0.03em;
}

.hero-copy > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.65;
  max-width: 690px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.notice {
  background: rgba(245, 184, 75, 0.1);
  border: 1px solid rgba(245, 184, 75, 0.34);
  border-radius: 8px;
  color: #f4d39b;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 18px;
  padding: 14px 16px;
}

.notice strong {
  color: var(--warning);
}

.notice.compact {
  margin: 24px 0 0;
  max-width: 720px;
}

.button, .mini {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 20px;
}

.button:hover, .mini:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.primary {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  color: white;
}

.ghost { background: rgba(255, 255, 255, 0.04); }
.wide { width: 100%; margin-top: 18px; }

.hero-panel {
  background: rgba(15, 27, 43, 0.72);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 18px;
}

.hero-panel div {
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
}

.hero-panel div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.hero-panel span {
  display: block;
  font-size: 30px;
  font-weight: 850;
}

.hero-panel small {
  color: var(--dim);
  font-size: 12px;
}

.workspace, .systems-grid, .about {
  scroll-margin-top: 86px;
}

.section-head {
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 30px;
  margin: 0;
}

.tool {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 380px;
  gap: 16px;
}

.right-stack {
  display: grid;
  align-content: start;
  gap: 16px;
}

.systems {
  display: grid;
  align-content: start;
  gap: 8px;
}

.system-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: rgba(15, 27, 43, 0.8);
  color: var(--muted);
  border-radius: 8px;
  padding: 11px 12px;
  cursor: pointer;
  font-weight: 750;
}

.system-btn.active {
  background: rgba(43, 184, 214, 0.13);
  border-color: rgba(43, 184, 214, 0.55);
  color: var(--accent);
}

.card {
  background: rgba(15, 27, 43, 0.82);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.form-head, .result-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.form-head h3, .result-top h3 {
  margin: 0 0 4px;
  font-size: 24px;
}

.form-head p, .result-top small {
  color: var(--dim);
  font-size: 12px;
  margin: 0;
}

.badge {
  color: var(--accent);
  background: rgba(43, 184, 214, 0.12);
  border: 1px solid rgba(43, 184, 214, 0.28);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.field { margin-bottom: 14px; }
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

label {
  display: block;
  color: var(--dim);
  font-size: 11px;
  font-weight: 750;
  margin-bottom: 5px;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: #081423;
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--border);
  background: #081423;
  color: var(--muted);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  cursor: pointer;
}

.chip.active {
  border-color: var(--accent);
  background: rgba(43, 184, 214, 0.12);
  color: var(--accent);
}

.copy-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mini {
  padding: 7px 10px;
  font-size: 11px;
}

.mini.accent {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  border: 0;
}

.result-list {
  display: grid;
  gap: 13px;
  margin: 0;
}

.result-list div {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

dt {
  font-size: 11px;
  color: var(--dim);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

dd {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

#category.ok { color: var(--accent); }
#category.warn { color: var(--warning); }

.ai-card .form-head {
  margin-bottom: 12px;
}

.ai-disclaimer {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.24);
  border-radius: 8px;
  color: #f6b2b2;
  font-size: 12px;
  line-height: 1.55;
  margin-bottom: 14px;
  padding: 11px 12px;
}

.ai-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ai-status {
  color: var(--dim);
  font-size: 12px;
  min-height: 18px;
  margin: 12px 0 0;
}

.ai-output {
  border-top: 1px solid var(--border);
  color: var(--muted);
  display: none;
  font-size: 13px;
  line-height: 1.6;
  margin-top: 10px;
  padding-top: 12px;
  white-space: pre-wrap;
}

.systems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin: 72px 0 18px;
}

.system-card h3 {
  margin-bottom: 8px;
}

.system-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 0;
}

.about {
  margin: 18px 0 72px;
}

.about p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 14px;
}

.about p:last-child {
  margin-bottom: 0;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 30px 0 44px;
  color: var(--dim);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

@media (max-width: 980px) {
  .hero, .tool {
    grid-template-columns: 1fr;
  }
  .systems {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 640px) {
  nav { display: none; }
  main, footer { width: min(100% - 28px, 1180px); }
  .hero { padding-top: 46px; }
  .actions .button { width: 100%; }
  .ai-actions { grid-template-columns: 1fr; }
}
