
:root {
  --bg: #050714;
  --bg-alt: #090d1f;
  --card-bg: #111529;
  --accent: #ffd66b;
  --accent-soft: #ffe9aa33;
  --text: #f5f6ff;
  --muted: #a1a4c7;
  --border: #262c4b;
  --danger: #ff6b6b;
  --warn: #facc15;
  --success: #4ade80;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
body.light {
  --bg: #f3f4fb;
  --bg-alt: #e3e5f5;
  --card-bg: #ffffff;
  --accent: #f59e0b;
  --accent-soft: #fcd34d33;
  --text: #111827;
  --muted: #6b7280;
  --border: #d1d5db;
  --danger: #dc2626;
  --warn: #ca8a04;
  --success: #16a34a;
}
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(circle at top, #252f60 0, var(--bg) 55%);
  color: var(--text);
  transition: background 0.2s ease, color 0.2s ease;
}
body.light {
  background: radial-gradient(circle at top, #e5e7ff 0, var(--bg) 55%);
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.2rem 1rem 2.4rem;
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.3rem;
  margin-bottom: 0.8rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.logo {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: conic-gradient(from 210deg, #ffba4b, #ffe987, #ffba4b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #241100;
  box-shadow: 0 0 26px #ffba4b77;
  font-size: 1.1rem;
}
.brand-text h1 {
  margin: 0 0 0.1rem;
  font-size: 1.25rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.brand-text span {
  font-size: 0.8rem;
  color: var(--muted);
}

.top-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 0.9rem;
}

label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.18rem;
}

select, input, textarea {
  border-radius: 0.6rem;
  border: 1px solid var(--border);
  background: #050816;
  color: var(--text);
  padding: 0.42rem 0.55rem;
  font-size: 0.82rem;
  outline: none;
  min-width: 0;
  transition: border 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
body.light select, body.light input, body.light textarea {
  background: #ffffff;
}
select:focus, input:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px #ffdd8050;
}
textarea {
  width: 100%;
  resize: vertical;
  min-height: 70px;
}

button {
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 0.46rem 0.9rem;
  font-size: 0.8rem;
  cursor: pointer;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent);
  color: #211100;
  box-shadow: 0 0 18px #ffdd8055;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
  white-space: nowrap;
}
button:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 23px #ffdd8075;
}
button.secondary {
  background: transparent;
  color: var(--muted);
  border-color: var(--border);
  box-shadow: none;
}
button.secondary:hover {
  background: rgba(15,23,42,0.5);
  box-shadow: 0 0 12px #00000044;
}
.theme-toggle {
  border-radius: 999px;
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  color: var(--muted);
  border: 1px dashed var(--border);
  box-shadow: none;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.8rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.35rem;
}
.tab {
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  border: 1px solid transparent;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, border 0.15s ease;
}
.tab.active {
  background: rgba(24,32,72,0.95);
  border-color: var(--accent-soft);
  color: var(--text);
  box-shadow: 0 10px 20px #00000055;
}
body.light .tab.active {
  background: #e5e7ff;
  box-shadow: 0 8px 18px #9ca3af55;
}

.tab-panel {
  display: none;
  animation: fadeIn 0.18s ease;
}
.tab-panel.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: radial-gradient(circle at top left, #252f59 0, #111529 45%, #050816 100%);
  border-radius: 1.05rem;
  border: 1px solid var(--border);
  padding: 0.9rem 0.9rem 1rem;
  box-shadow: 0 18px 40px #00000066;
}
body.light .card {
  background: #ffffff;
  box-shadow: 0 12px 32px #9ca3af55;
}

.card-header-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}
.card-header-row h2 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.card-header-row small {
  color: var(--muted);
  font-size: 0.76rem;
}

.pill {
  font-size: 0.7rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--accent-soft);
  background: var(--accent-soft);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  white-space: nowrap;
}

.mini-tag {
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin: 0.1rem 0 0.4rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.8fr);
  gap: 0.7rem;
}
@media (max-width: 900px) {
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}
.field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.55rem 0.75rem;
}

.sub-title {
  margin-top: 0.45rem;
  margin-bottom: 0.2rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}
.divider {
  border-top: 1px dashed var(--border);
  margin: 0.6rem -0.2rem 0.5rem;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.45rem;
  margin-top: 0.5rem;
}
.stat-chip {
  padding: 0.38rem 0.55rem;
  border-radius: 0.8rem;
  background: rgba(5,8,22,0.8);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  min-height: 2.6rem;
}
body.light .stat-chip {
  background: #f9fafb;
}
.stat-label {
  color: var(--muted);
  font-size: 0.7rem;
}
.stat-value {
  font-weight: 600;
  margin-top: 0.1rem;
  display: inline-block;
}
.stat-value.green { color: var(--success); }
.stat-value.red { color: var(--danger); }
.stat-value.warn { color: var(--warn); }

.status-pill {
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  margin-top: 0.55rem;
  display: inline-block;
}
.status-incomplete {
  background: #1f2937;
  color: #d1d5db;
  border: 1px dashed #4b5563;
}
.status-pass {
  background: #064e3b;
  color: #bbf7d0;
  border: 1px solid #22c55e;
}
.status-warn {
  background: #422006;
  color: #fed7aa;
  border: 1px solid #facc15;
}
.status-fail {
  background: #450a0a;
  color: #fecaca;
  border: 1px solid #ef4444;
}

.footer-note {
  margin-top: 1rem;
  font-size: 0.75rem;
  text-align: center;
  color: var(--muted);
}
.footer-note strong { color: var(--accent); }

canvas {
  width: 100% !important;
  max-height: 220px;
}
