:root {
  /* From school color scheme PDF — Main + MYP */
  --gray: #766e65;
  --gold: #f2b334;
  --silver: #c2bdb7;
  --myp-green: #207028;
  --myp-lime: #67c04d;
  --alert: #f32735;
  --navy: #00188a;
  --ink: #2a2622;
  --muted: #766e65;
  --line: rgba(118, 110, 101, 0.22);
  --card: #ffffff;
  --bg: #f4f2ef;
  --soft: #ebe8e4;
  --black: #0e0e0e;
  --green: #207028;
  --green-deep: #16521d;
  --teal: #207028;
  --teal-deep: #16521d;
  --sky: #00188a;
  --amber: #f2b334;
  --coral: #f32735;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(ellipse 55% 35% at 100% 0%, rgba(242, 179, 52, 0.16), transparent 55%),
    radial-gradient(ellipse 50% 40% at 0% 0%, rgba(32, 112, 40, 0.1), transparent 50%),
    linear-gradient(180deg, #f7f5f2 0%, #f0eeea 100%);
  min-height: 100vh;
}

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.1rem 2.75rem;
}

.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--black);
  color: #f5f4f2;
  border-radius: 1rem;
  padding: 0.85rem 1.15rem;
  margin-bottom: 1rem;
  box-shadow: 0 12px 28px rgba(14, 14, 14, 0.18);
}

.brand-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
}

.brand-logo {
  height: 52px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.brand-copy {
  min-width: 0;
}

.brand-copy .eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}

.brand-copy h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
}

.brand-copy .lede {
  margin: 0.3rem 0 0;
  color: var(--silver);
  font-size: 0.88rem;
  line-height: 1.35;
  max-width: 34rem;
}

.brand-badge {
  flex-shrink: 0;
  background: rgba(242, 179, 52, 0.14);
  border: 1px solid rgba(242, 179, 52, 0.35);
  color: var(--gold);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
}

.privacy {
  background: rgba(242, 179, 52, 0.12);
  border: 1px solid rgba(242, 179, 52, 0.35);
  color: #6b5410;
  border-radius: 0.75rem;
  padding: 0.7rem 1rem;
  margin-bottom: 0.9rem;
  line-height: 1.4;
  font-size: 0.92rem;
}

.upload-card {
  background: var(--card);
  border: 2px dashed rgba(32, 112, 40, 0.35);
  border-radius: 1.1rem;
  padding: 1.45rem 1.15rem 1.3rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  box-shadow: 0 10px 28px rgba(42, 38, 34, 0.05);
}

.upload-card:hover,
.upload-card.dragover {
  border-color: var(--myp-green);
  background: #f7faf6;
  box-shadow: 0 14px 36px rgba(32, 112, 40, 0.1);
}

.upload-icon {
  width: 2.6rem;
  height: 2.6rem;
  margin: 0 auto 0.55rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(32, 112, 40, 0.16), rgba(242, 179, 52, 0.22));
  color: var(--myp-green);
  font-size: 1.25rem;
  font-weight: 700;
}

.upload-card h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 1.3rem;
}

.upload-card p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  margin-top: 1rem;
}

.btn {
  font: inherit;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.58rem 1.05rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.primary {
  background: linear-gradient(90deg, var(--myp-green), #2a8a35);
  color: #fff;
}

.btn.ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.btn.ghost:hover {
  border-color: var(--gold);
  color: var(--myp-green);
}

.demo-label {
  margin: 1.05rem 0 0.45rem !important;
  font-weight: 700;
  color: var(--ink) !important;
  font-size: 0.88rem !important;
}

.demo-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

.demo-picks .btn {
  font-size: 0.82rem;
  padding: 0.48rem 0.85rem;
}

.ordinal-note {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.75rem;
  background: rgba(0, 24, 138, 0.06);
  border: 1px solid rgba(0, 24, 138, 0.18);
  color: var(--navy);
  line-height: 1.4;
  font-size: 0.88rem;
}

.file-name {
  margin-top: 0.7rem !important;
  font-weight: 600;
  color: var(--myp-green) !important;
  min-height: 1.15rem;
  font-size: 0.9rem !important;
}

.dashboard { margin-top: 1.35rem; }
.hidden { display: none !important; }

.file-notice {
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.95rem;
  border-radius: 0.75rem;
  background: rgba(32, 112, 40, 0.08);
  border: 1px solid rgba(32, 112, 40, 0.22);
  color: var(--green-deep);
  line-height: 1.4;
  font-size: 0.92rem;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.65rem;
  align-items: end;
  margin-bottom: 0.95rem;
}

.field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.field select {
  width: 100%;
  font: inherit;
  padding: 0.5rem 0.6rem;
  border-radius: 0.55rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.mode-pill {
  justify-self: start;
  align-self: end;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(32, 112, 40, 0.12);
  color: var(--green-deep);
  font-weight: 700;
  font-size: 0.8rem;
  white-space: nowrap;
}

.mode-pill.generic {
  background: rgba(242, 179, 52, 0.18);
  color: #6b5410;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.95rem;
}

.kpi {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.85rem 0.95rem;
  box-shadow: 0 6px 18px rgba(42, 38, 34, 0.04);
  position: relative;
}

.kpi::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--myp-green), var(--gold), var(--myp-lime));
}

.kpi .label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.3;
}

.kpi .value {
  margin-top: 0.25rem;
  font-family: "Fraunces", serif;
  font-size: 1.65rem;
  line-height: 1.1;
  color: var(--ink);
}

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

.chart-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 0.9rem 1rem 1rem;
  box-shadow: 0 8px 22px rgba(42, 38, 34, 0.04);
}

.chart-card.wide {
  grid-column: 1 / -1;
}

.chart-card > h3 {
  margin: 0 0 0.75rem;
  font-family: "Fraunces", serif;
  font-size: 1.05rem;
  line-height: 1.35;
}

.chart-head h3 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: 1.05rem;
  line-height: 1.35;
}

.chart-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.scatter-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.scatter-picks label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.scatter-picks select {
  font: inherit;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  min-width: 10rem;
  padding: 0.45rem 0.55rem;
  border-radius: 0.55rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.chart-wrap {
  position: relative;
  height: 300px;
}

.chart-wrap.tall {
  height: 340px;
}

.chart-guide {
  margin: 0.7rem 0 0;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
  line-height: 1.4;
  color: var(--muted);
}

.chart-guide strong {
  color: var(--green-deep);
  font-weight: 700;
}

.heatmap-wrap {
  overflow: auto;
  max-height: 420px;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
}

.heatmap {
  border-collapse: separate;
  border-spacing: 2px;
  font-size: 0.72rem;
  min-width: 100%;
}

.heatmap th,
.heatmap td {
  border: none;
  padding: 0.5rem 0.45rem;
  text-align: center;
}

.heatmap th {
  background: var(--soft);
  color: var(--gray);
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: normal;
  line-height: 1.25;
  min-width: 3.2rem;
  max-width: 6.5rem;
}

.heatmap th.row-label,
.heatmap td.row-label {
  text-align: left;
  position: sticky;
  left: 0;
  background: #fff;
  z-index: 2;
  max-width: 12rem;
  white-space: normal;
  overflow: visible;
  line-height: 1.3;
  font-weight: 600;
  color: var(--ink);
}

.heatmap th.row-label {
  z-index: 3;
  background: var(--soft);
}

.heatmap td.heat {
  color: #fff;
  font-weight: 700;
  border-radius: 4px;
  min-width: 2.4rem;
  white-space: nowrap;
}

.heatmap td.heat.empty {
  background: #ebe8e4;
  color: transparent;
}

.heatmap-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.65rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.heatmap-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.heatmap-legend i {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 3px;
  display: inline-block;
}

.preview {
  margin-top: 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.75rem 0.95rem;
}

.preview summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--myp-green);
  font-size: 0.95rem;
}

.table-wrap {
  overflow: auto;
  margin-top: 0.65rem;
  max-height: 260px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

th, td {
  border: 1px solid var(--line);
  padding: 0.35rem 0.5rem;
  text-align: left;
  white-space: nowrap;
}

th { background: var(--soft); color: var(--green-deep); position: sticky; top: 0; }

.empty-note {
  color: var(--muted);
  padding: 1.25rem;
  text-align: center;
}

.notice-box {
  grid-column: 1 / -1;
  background: #fff;
  border: 1px solid rgba(242, 179, 52, 0.4);
  border-radius: 0.9rem;
  padding: 1.1rem 1.25rem;
  color: var(--ink);
  line-height: 1.45;
}

.notice-box p {
  margin: 0.55rem 0 0;
  color: var(--muted);
}

@media (max-width: 700px) {
  .page { padding: 1rem 0.85rem 2.25rem; }
  .brand-bar { flex-direction: column; align-items: flex-start; }
  .brand-logo { height: 44px; }
  .chart-wrap { height: 220px; }
}
