:root {
  --ink: #1c2733;
  --muted: #5c6b7a;
  --paper: #f6f4ef;
  --card: #ffffff;
  --line: #dcd6ca;
  --accent: #7a1f2b;      /* deep VCE maroon */
  --accent-soft: #f3e6e8;
  --good: #2e7d4f;
  --warn: #b26a00;
  --bad: #b3362a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}
main { max-width: 1080px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.9rem 1.5rem;
  background: var(--accent); color: #fff;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; letter-spacing: 0.02em; }
.brand span { font-weight: 400; opacity: 0.85; }
.topbar nav a {
  color: #fff; text-decoration: none; margin-left: 1.4rem; opacity: 0.9; font-size: 0.95rem;
}
.topbar nav a:hover { opacity: 1; text-decoration: underline; }

h1 { font-size: 1.7rem; margin: 0.5rem 0 0.75rem; }
h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
a { color: var(--accent); }
.muted, .hint { color: var(--muted); font-size: 0.92rem; }
.meta { color: var(--muted); font-size: 0.9rem; margin-top: -0.4rem; }
.crumbs { font-size: 0.9rem; }

.hero { text-align: center; margin: 2.5rem 0 2rem; }
.hero p { max-width: 42rem; margin: 0.5rem auto; color: var(--muted); }

.section-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem; margin-top: 1.5rem;
}
.section-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 1.4rem; text-decoration: none; color: inherit; position: relative;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.section-card.active { border-color: var(--accent); box-shadow: 0 2px 10px rgba(122,31,43,0.12); }
.section-card.active:hover { transform: translateY(-2px); transition: transform 0.15s; }
.section-card.disabled { opacity: 0.6; }
.section-card p { color: var(--muted); font-size: 0.95rem; margin: 0; flex: 1; }
.badge {
  align-self: flex-start; font-size: 0.75rem; padding: 0.15rem 0.6rem;
  border-radius: 999px; background: #e8e4da; color: var(--muted); margin-top: 0.6rem;
}
.badge.live { background: var(--accent); color: #fff; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 1.3rem 1.4rem; margin-bottom: 1.5rem;
}
.panel.sticky { position: sticky; top: 1rem; }

form label { display: block; margin-bottom: 0.9rem; font-weight: 600; font-size: 0.95rem; }
form input[type=text], form input[type=password], form select, form textarea, form input[type=number], form input[type=file] {
  display: block; width: 100%; margin-top: 0.3rem; padding: 0.5rem 0.6rem;
  border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff;
}
form textarea { resize: vertical; }
form label.check { font-weight: 600; }
form label.check input { display: inline; width: auto; margin-right: 0.4rem; }
button {
  background: var(--accent); color: #fff; border: 0; border-radius: 6px;
  padding: 0.6rem 1.2rem; font: inherit; font-weight: 600; cursor: pointer;
}
button:hover { filter: brightness(1.1); }
button:disabled { opacity: 0.5; cursor: wait; }
button.secondary { background: #fff; color: var(--accent); border: 1px solid var(--accent); }
.status { color: var(--accent); font-size: 0.92rem; }
.notice {
  background: var(--accent-soft); border-radius: 6px; padding: 0.6rem 0.8rem; font-size: 0.92rem;
}

.list-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.list-table th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 0.82rem;
  text-transform: uppercase; letter-spacing: 0.04em; padding: 0.4rem 0.5rem;
}
.list-table td { padding: 0.45rem 0.5rem; border-top: 1px solid var(--line); }
.weights-table input { max-width: 5.5rem; }

.band {
  display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 0.1rem 0.55rem;
  border-radius: 999px; background: #e8e4da;
}
.band-excellent, .band-strong { background: #dff0e5; color: var(--good); }
.band-competent, .band-developing { background: #fdf0dc; color: var(--warn); }
.band-basic, .band-limited { background: #f9e2df; color: var(--bad); }

/* Exam paper */
.exam-paper {
  background: #fff; border: 1px solid var(--line); border-radius: 4px;
  padding: 2rem 2.2rem; font-family: Georgia, "Times New Roman", serif;
  box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}
.background-box {
  border: 1.5px solid var(--ink); padding: 0.9rem 1.1rem; margin-bottom: 1.6rem;
  font-size: 0.95rem;
}
.background-box h3 { margin: 0 0 0.4rem; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }
.exam-text { margin-bottom: 2rem; }
.text-kind { font-size: 0.75rem; letter-spacing: 0.1em; color: var(--muted); font-family: inherit; }
.headline { font-size: 1.5rem; line-height: 1.25; margin: 0.2rem 0 0.3rem; }
.subheading { font-style: italic; color: var(--muted); margin: 0 0 0.3rem; }
.byline { font-size: 0.9rem; font-weight: 700; margin: 0 0 1rem; }
.exam-visual { margin: 1.5rem 0 0; }
.exam-visual img { width: 100%; border: 1px solid var(--line); }
.exam-visual figcaption { font-size: 0.85rem; color: var(--muted); font-style: italic; margin-top: 0.4rem; }
.visual-fallback { border: 1px dashed var(--muted); padding: 1rem; font-size: 0.92rem; }

/* Results */
.score-summary { display: flex; gap: 1.5rem; align-items: center; }
.score-big { display: flex; align-items: baseline; gap: 0.3rem; }
.score-number { font-size: 3rem; font-weight: 800; color: var(--accent); }
.score-max { font-size: 1.3rem; color: var(--muted); }
.deductions li { margin-bottom: 0.4rem; }

.criterion { border-top: 1px solid var(--line); padding: 0.35rem 0; }
.criterion summary {
  display: flex; justify-content: space-between; gap: 1rem; cursor: pointer;
  padding: 0.45rem 0.2rem; list-style: none;
}
.criterion summary::-webkit-details-marker { display: none; }
.crit-name { font-weight: 600; font-size: 0.97rem; }
.crit-score { font-weight: 700; white-space: nowrap; }
.crit-score em { font-weight: 400; color: var(--muted); font-size: 0.85em; }
.score-5, .score-4 { color: var(--good); }
.score-3 { color: var(--warn); }
.score-2, .score-1, .score-0 { color: var(--bad); }
.crit-body { padding: 0.2rem 0.2rem 0.9rem; font-size: 0.94rem; }
.crit-body .quote { font-style: italic; }
.improve { background: var(--accent-soft); padding: 0.5rem 0.7rem; border-radius: 6px; }
.model-example { background: #eef3ee; padding: 0.5rem 0.7rem; border-radius: 6px; }
.essay-text { font-family: Georgia, serif; }

.spark { width: 100%; max-width: 460px; margin-bottom: 0.8rem; }
.spark .line { stroke: var(--accent); stroke-width: 2; }
.spark .grid { stroke: var(--line); stroke-dasharray: 4 4; }
.spark circle { fill: var(--accent); }

.upload-form { margin-top: 1.2rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.site-footer {
  text-align: center; color: var(--muted); font-size: 0.85rem; padding: 1.2rem;
  border-top: 1px solid var(--line);
}
details.panel summary { cursor: pointer; }

.whoami { margin-left: 1.4rem; font-size: 0.85rem; opacity: 0.85; }
.whoami a { color: #fff; text-decoration: underline; margin-left: 0 !important; }

.login-wrap { max-width: 420px; margin: 3rem auto; }
.login-panel h1 { margin-top: 0; }
.login-error { color: var(--bad); background: #f9e2df; }
.uploaded-source {
  font-family: Georgia, "Times New Roman", serif; white-space: pre-wrap;
  line-height: 1.6; font-size: 0.97rem;
}
