:root {
  --bg: #09111b;
  --panel: #101b2a;
  --panel-2: #12253b;
  --ink: #e8f0f8;
  --muted: #9db4ca;
  --line: #25425f;
  --brand: #0f8b8d;
  --accent: #d9922b;
  --ok: #4ade80;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at 10% 10%, #13253c 0%, var(--bg) 45%);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  background: rgba(9, 17, 27, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.brand {
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.topbar nav a {
  color: var(--muted);
  text-decoration: none;
  margin-left: 1rem;
}

main {
  width: min(1240px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  padding: clamp(2rem, 6vw, 4rem) 0;
}

.kicker {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.hero h1 {
  margin: 0.2rem 0 0.8rem;
  font-size: clamp(2rem, 6vw, 3.6rem);
}

.hero p { color: var(--muted); max-width: 72ch; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.card {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
}

.card h2 {
  margin-top: 0;
  font-size: 1.15rem;
}

label { display: block; margin: 0.4rem 0; color: var(--muted); }

input {
  width: 100%;
  margin-bottom: 0.6rem;
  background: #0c1622;
  border: 1px solid #2a4764;
  border-radius: 7px;
  color: var(--ink);
  padding: 0.65rem 0.7rem;
}

button {
  border: 0;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--brand), #0fa0bf);
  color: #001018;
  font-weight: 700;
  padding: 0.62rem 0.9rem;
  cursor: pointer;
}

.consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem;
}

.consent input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.2rem;
}

.output {
  margin: 0.8rem 0 0;
  min-height: 5.2rem;
  max-height: 22rem;
  overflow: auto;
  background: #08111a;
  border: 1px solid #1f3549;
  padding: 0.7rem;
  border-radius: 7px;
  color: #c8e1f7;
  white-space: pre-wrap;
}

.notes {
  margin: 2rem 0;
  padding: 1rem;
  border: 1px solid #2a4764;
  border-radius: 10px;
  background: rgba(8, 18, 29, 0.7);
}

.notes li { color: var(--muted); }

footer {
  text-align: center;
  color: #7f95aa;
  padding: 1.6rem;
}

.result-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
}

.result-modal.open {
  display: block;
}

.result-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 8, 14, 0.68);
}

.result-modal-panel {
  position: relative;
  margin: 4vh auto;
  width: min(1100px, calc(100% - 2rem));
  max-height: 92vh;
  background: linear-gradient(180deg, #0f1b2a, #102233);
  border: 1px solid #2a4764;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.result-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #2a4764;
}

.result-modal-header h3 {
  margin: 0;
  color: var(--ink);
}

.result-modal-close {
  background: #1f3549;
  color: #cfe8ff;
  border: 1px solid #365775;
  border-radius: 7px;
  padding: 0.4rem 0.65rem;
}

.result-modal-body {
  margin: 0;
  padding: 1rem;
  max-height: calc(92vh - 4rem);
  overflow: auto;
  color: #d3e9fb;
  background: #0a1420;
}

.result-section {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: #0f1b2a;
  border: 1px solid #23425e;
  border-radius: 8px;
}

.result-section h4 {
  margin: 0 0 0.5rem;
  color: #9dd3ff;
}

.result-section p {
  margin: 0;
}

.result-section pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.result-grid {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-bottom: 1rem;
}

.result-row {
  background: #0f1b2a;
  border: 1px solid #23425e;
  border-radius: 8px;
  padding: 0.7rem;
}

.result-row span {
  display: block;
  font-size: 0.8rem;
  color: #96b8d8;
  margin-bottom: 0.2rem;
}

.result-row strong {
  color: #e5f2ff;
  word-break: break-word;
}
