@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Nunito+Sans:wght@400;600;700;800&display=swap');

:root {
  --bg:           #060a14;
  --bg-card:      #0d1120;
  --bg-section:   rgba(13,17,32,0.97);
  --border:       rgba(255,255,255,0.08);
  --border-soft:  rgba(255,255,255,0.05);
  --text:         #e8eeff;
  --muted:        #8b96b8;
  --muted-light:  #6b759a;

  --gold:         #f0a500;
  --gold-soft:    rgba(240,165,0,0.14);
  --gold-border:  rgba(240,165,0,0.30);

  --blue:         #2563eb;
  --blue-2:       #0ea5e9;
  --blue-soft:    rgba(37,99,235,0.14);
  --blue-border:  rgba(37,99,235,0.30);

  --green:        #22c55e;
  --green-soft:   rgba(34,197,94,0.14);
  --green-border: rgba(34,197,94,0.35);

  --amber:        #f59e0b;
  --amber-soft:   rgba(245,158,11,0.12);
  --amber-border: rgba(245,158,11,0.32);

  --red:          #ef4444;
  --red-soft:     rgba(239,68,68,0.13);
  --red-border:   rgba(239,68,68,0.35);

  --shadow:       0 12px 32px rgba(0,0,0,0.50);
  --shadow-sm:    0 4px 14px rgba(0,0,0,0.35);
  --r:            16px;
  --r-sm:         10px;
  --r-lg:         22px;
  --header-h:     70px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Nunito Sans', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.65;
  background:
    radial-gradient(ellipse 1100px 600px at 15% 0%, rgba(240,165,0,0.06) 0%, transparent 55%),
    radial-gradient(ellipse 900px 500px at 90% 5%, rgba(37,99,235,0.08) 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; }
h1, h2, h3, h4, h5 { font-family: 'Outfit', system-ui, sans-serif; line-height: 1.25; }
h1 { margin: 0 0 8px; font-size: clamp(1.9rem, 3vw, 2.5rem); }
h1 span { color: var(--gold); }
h2 { margin: 0; font-size: 1.25rem; }
p { margin: 0; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background: #0e1e3d;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 2px 24px rgba(14,30,61,0.55);
}

.topbar .container {
  height: var(--header-h);
  display: flex;
  align-items: center;
}

.navwrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

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

.brand-logo {
  height: 44px;
  width: auto;
  display: block;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 32px;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  line-height: 1;
}

.page-shell {
  padding-top: 28px;
  padding-bottom: 28px;
}

.hero-card {
  padding: 26px 28px;
  background:
    linear-gradient(135deg, rgba(240,165,0,0.10), transparent 42%),
    linear-gradient(135deg, rgba(37,99,235,0.08), transparent 68%),
    var(--bg-section);
}

.hero-copy .sub {
  color: var(--muted);
  margin-top: 6px;
  max-width: 920px;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: #dfe7ff;
  font-size: 0.82rem;
  font-weight: 700;
}

.top-actions, .action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

button, .button-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

button:hover:not(:disabled), .button-like:hover {
  border-color: rgba(240,165,0,0.5);
  background: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

button.primary {
  border: 2px solid #c98a20;
  background: #122746;
  color: #f0a530;
}

button.primary:hover:not(:disabled) {
  background: #173055;
  border-color: #e0a743;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.upload-fallback input { display: none; }

.card {
  background: var(--bg-section);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
}

section, .summary-grid { margin-bottom: 18px; }

.helper, .empty, .small, label {
  color: var(--muted);
}

.helper {
  margin-top: 4px;
  font-size: 14px;
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14px;
}

input, select, textarea {
  width: 100%;
  background: #0b1220;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gold-border);
  box-shadow: 0 0 0 3px rgba(240,165,0,0.12);
}

input[type="range"] {
  padding: 0;
  accent-color: var(--gold);
  box-shadow: none;
}

textarea {
  min-height: 220px;
  resize: vertical;
}

.status {
  margin-top: 12px;
  color: #cbd5e1;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.stat {
  text-align: center;
  padding: 20px 14px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)),
    var(--bg-section);
}

.stat span {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
}

.stat small {
  color: var(--muted);
  font-size: 0.82rem;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}

th {
  color: #cbd5e1;
  font-size: 13px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.compact-gap { margin-bottom: 16px; }

.dashboard, .ai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}

.student-card,
.reuse-card,
.share-card,
.ai-card,
.compare-card,
.cluster-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: #0b1220;
}

.student-card + .student-card,
.reuse-card + .reuse-card,
.share-card + .share-card,
.ai-card + .ai-card,
.compare-card + .compare-card,
.cluster-card + .cluster-card {
  margin-top: 10px;
}

.student-top, .row-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.student-name, .cluster-title {
  font-size: 18px;
  font-weight: 700;
}

.student-meta, .small {
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
}

.flag-green { background: var(--green); }
.flag-amber { background: var(--amber); }
.flag-red { background: var(--red); }

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0;
}

.metric,
.preview,
.copied-highlight,
.summary-note {
  background: #121b2c;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 10px;
}

.metric { text-align: center; }
.metric b {
  display: block;
  font-size: 18px;
}

.preview, .copied-highlight, .summary-note {
  margin-top: 10px;
  color: #d1d5db;
}

mark {
  background: rgba(245, 158, 11, 0.35);
  color: #fff;
  padding: 0 3px;
  border-radius: 4px;
}

.heatmap-wrap {
  overflow-x: auto;
  margin: 12px 0;
}

.heatmap {
  border-collapse: separate;
  border-spacing: 4px;
}

.heatmap th, .heatmap td {
  border: 0;
  padding: 8px;
  min-width: 84px;
  text-align: center;
}

.heatmap .label {
  text-align: left;
  min-width: 200px;
  color: #cbd5e1;
}

.cell {
  border-radius: 10px;
  font-weight: 700;
}

.cell-0 { background: #122033; }
.cell-1 { background: #18324a; }
.cell-2 { background: #22506f; }
.cell-3 { background: #3b6f7b; }
.cell-4 { background: #7c5c22; }
.cell-5 { background: #b45309; }
.cell-6 { background: #991b1b; }

.legend {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0 0;
}

.legend span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #121b2c;
  font-size: 12px;
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}

.compare-side {
  background: #121b2c;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px;
}

.compare-side h4 {
  margin: 0 0 8px;
  font-size: 14px;
}

.compare-text {
  white-space: pre-wrap;
  color: var(--text);
  line-height: 1.45;
}

.ai-score {
  font-size: 28px;
  font-weight: 800;
}

.ai-reasons {
  margin: 10px 0 0;
  padding-left: 18px;
  color: #d1d5db;
}

.ai-reasons li { margin: 4px 0; }
.ai-files { margin-top: 10px; color: var(--muted); font-size: 13px; }

.network-wrap { overflow: auto; margin-top: 12px; }
.network-svg {
  width: 100%;
  min-height: 420px;
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.site-footer {
  text-align: center;
  color: var(--muted-light);
  font-size: 0.9rem;
  padding: 8px 0 0;
}

@media (max-width: 1180px) {
  .summary-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 980px) {
  .container { padding: 0 16px; }
  .navwrap { flex-direction: column; align-items: flex-start; padding: 12px 0; }
  .topbar .container { height: auto; }
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .compare-grid { grid-template-columns: 1fr; }
  .stack-on-mobile { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 640px) {
  .page-shell { padding-top: 18px; }
  .hero-card { padding: 20px; }
  .summary-grid { grid-template-columns: 1fr; }
  .dashboard, .ai-grid { grid-template-columns: 1fr; }
  .metric-row { grid-template-columns: repeat(2, 1fr); }
  button, .button-like { width: 100%; }
  .top-actions, .action-row { width: 100%; }
  .brand-divider { display: none; }
}
