:root {
  --orange: #ff8c00;
  --orange-deep: #ae6000;
  --teal: #2498a8;
  --ink: #425e62;
  --text: #212529;
  --card: #ebf6f8;
  --info: #fff0dd;
  --footer: #e8f8f7;
  --line: rgba(36, 152, 168, 0.3);
  --shadow: 0 10px 30px rgba(23, 48, 51, 0.08);
  --container: 1140px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

img { max-width: 100%; }

button, input, textarea { font: inherit; }

a { color: inherit; }

.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.brand-bar {
  background: #fde5f2;
  color: #333;
}

.brand-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 6px 0;
}

.brand-logo {
  height: 32px;
  width: auto;
  flex: none;
}

.brand-tagline {
  flex: 1;
  min-width: 0;
  margin: 0;
  text-align: right;
  line-height: 1.25;
}

.brand-tagline strong,
.brand-tagline span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-tagline strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
}

.brand-tagline span {
  display: block;
  font-size: 12px;
  color: #666;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
  min-width: 0;
  margin-left: 16px;
}

.user-chip[hidden] { display: none !important; }

.user-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.user-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-meta {
  min-width: 0;
  line-height: 1.2;
  text-align: left;
}

.user-meta strong {
  display: block;
  overflow: hidden;
  max-width: 180px;
  color: #333;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta span {
  display: block;
  overflow: hidden;
  max-width: 180px;
  color: #666;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero {
  color: #fff;
  padding: 28px 0 26px;
  background-color: var(--orange);
  background-image: linear-gradient(rgba(255, 140, 0, 0.82), rgba(255, 140, 0, 0.88)), url("../assets/bg-waves.png");
  background-size: cover;
  background-position: center 30%;
}

.disclaimer {
  margin: 0 0 18px;
  text-align: center;
  font-family: Sen, Arial, Helvetica, sans-serif;
  font-size: 16px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}

.hero h1,
.hero h2,
.section-title,
.panel h2,
.modal h2 {
  font-family: Sen, Arial, Helvetica, sans-serif;
}

.hero h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.2;
  font-weight: 700;
}

.hero h2 {
  margin: 4px 0 16px;
  font-size: 30px;
  line-height: 1.25;
  font-weight: 500;
}

.hero p {
  margin: 0 0 12px;
  max-width: 720px;
  font-family: Sen, Arial, Helvetica, sans-serif;
}

.hero .grant { font-size: 16px; }

.hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 18px;
}

.badge {
  display: inline-grid;
  grid-template-columns: 22px auto;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 7px 16px;
  border-radius: 25px;
  background: var(--orange-deep);
  color: #fff;
  font-family: Sen, Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.badge img { width: 18px; height: 22px; }

.faculty-link {
  display: block;
  width: 180px;
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-family: Sen, Arial, Helvetica, sans-serif;
  font-size: 15px;
}

.portrait {
  position: relative;
  width: 130px;
  height: 130px;
  margin: 0 0 8px auto;
}

.portrait img {
  width: 130px;
  height: 130px;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  border: 2px solid transparent;
  background: #fff;
}

.faculty-link:hover img { border-color: var(--info); }

.portrait .info-dot {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 14px;
  line-height: 22px;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

.nav-wrap { margin-top: 22px; }

.menu-toggle {
  display: none;
  width: 46px;
  height: 40px;
  margin-left: auto;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 3px;
  margin: 6px 0;
  background: #fff;
  border-radius: 2px;
}

.nav-list {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0;
  padding: 8px 10px;
  list-style: none;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(120, 55, 0, 0.14);
}

.nav-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 4px 14px 4px 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--teal);
  font-family: Sen, Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  text-decoration: none;
  transition: 0.2s ease;
}

.nav-list a img {
  width: 36px;
  height: 36px;
  padding: 6px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  box-sizing: border-box;
  flex: none;
}

.nav-list a:hover { background: rgba(36, 152, 168, 0.08); }

.nav-list a.is-locked {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

.nav-list a.active,
.nav-list a.active:hover {
  background: var(--teal);
  color: #fff;
}

.nav-list a.active img { filter: brightness(0) invert(1); }

.main {
  position: relative;
  padding: 34px 0 20px;
  background: #fff url("../assets/bg-waves.png") left -40px / 980px auto no-repeat;
}

.section-title {
  margin: 0 0 6px;
  color: var(--orange);
  font-size: 30px;
  font-weight: 700;
}

.compulsory {
  margin: 0 0 18px;
  color: #6c757d;
  font-size: 14px;
}

.card {
  margin: 0 0 16px;
  padding: 20px;
  background: var(--card);
}

.card.missing { outline: 2px solid rgba(255, 8, 8, 0.45); background: rgba(255, 8, 8, 0.12); }

.prompt {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 16px;
}

.prompt strong { font-family: Sen, Arial, Helvetica, sans-serif; }

.hint { font-weight: 400; }

.options { display: flex; flex-direction: column; gap: 2px; }

.options.inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px 18px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 0 0 8px;
  color: var(--ink);
  font-family: Sen, Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
}

.option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mark {
  position: relative;
  flex: none;
  width: 21px;
  height: 21px;
  margin-top: 0;
  background: #fff;
}

.mark.radio,
.mark.check {
  outline: 1px solid rgba(36, 152, 168, 0.7);
}

.mark.radio { border-radius: 50%; }

.mark.radio::after,
.mark.check::after { content: ""; position: absolute; display: none; }

.mark.radio::after {
  top: 4px;
  left: 4px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--teal);
}

.mark.check::after {
  left: 7px;
  top: 2px;
  width: 6px;
  height: 12px;
  border: solid #fff;
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

.option:hover .mark.radio::after { display: block; }
.option:hover .mark.check { background: var(--teal); }

.option input:checked + .mark.radio::after { display: block; }

.option input:checked + .mark.check { background: var(--teal); }
.option input:checked + .mark.check::after { display: block; }

.option input:disabled ~ span,
fieldset:disabled .option { cursor: default; }

fieldset:disabled { opacity: 0.72; }

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.likert {
  display: grid;
  grid-template-columns: minmax(240px, 410px) 1fr;
  gap: 12px 16px;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.likert:last-child,
.likert.plain {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.likert p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.follow {
  margin-top: 16px;
  padding-top: 8px;
}

.follow[hidden],
.submit-btn[hidden],
.primary-btn[hidden],
.other-field[hidden],
.view[hidden],
.tab-panel[hidden],
.modal[hidden],
.score-panel[hidden],
.rationale[hidden] { display: none !important; }

.submit-row { margin-top: 8px; }

.submit-btn,
.cert-link,
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 40px;
  font-family: Sen, Arial, Helvetica, sans-serif;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.submit-btn {
  margin-top: 8px;
  padding: 6px 28px;
  border: 1px solid var(--teal);
  background: #fff;
  color: var(--teal);
  font-size: 14px;
}

.submit-btn:hover { background: var(--teal); color: #fff; }

.text-input,
textarea {
  width: min(100%, 640px);
  margin: 4px 0 8px;
  padding: 8px 10px;
  border: 1px solid rgba(36, 152, 168, 0.45);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
}

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

.other-field[hidden] { display: none; }

.cert-link {
  margin: 8px 0 28px;
  padding: 12px 22px;
  border: 1px solid var(--teal);
  background: transparent;
  color: var(--teal);
  font-size: 16px;
}

.cert-link:hover:not(:disabled) { background: var(--teal); color: #fff; }

.cert-link:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#cert-status { margin-top: -18px; }

.utility {
  margin: -12px 0 28px;
  font-size: 13px;
}

.utility button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  text-decoration: underline;
  cursor: pointer;
}


.panel {
  margin-bottom: 28px;
  padding: 8px 0 12px;
}

.panel p, .panel li { color: var(--ink); }

.panel h3 {
  margin: 18px 0 8px;
  font-family: Sen, Arial, Helvetica, sans-serif;
  color: var(--orange);
}

.primary-btn {
  padding: 10px 18px;
  border: 0;
  background: var(--teal);
  color: #fff;
}

.info {
  padding: 28px 0 36px;
  background: var(--info);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--ink);
  border-radius: 25px;
  background: transparent;
  color: var(--ink);
  font-family: Sen, Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.tabs button svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: var(--orange);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabs button:hover {
  color: var(--orange);
  border-color: var(--orange-deep);
}

.tabs button[aria-selected="true"],
.tabs button[aria-selected="true"]:hover {
  border-color: var(--orange);
  background: var(--orange);
  color: #fff;
}

.tabs button[aria-selected="true"] svg {
  stroke: #fff;
}

.tab-panel {
  padding: 28px;
  border: 1px solid var(--ink);
  border-radius: 20px;
  background: transparent;
}


.tab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.ebac-logo {
  display: block;
  width: 210px;
  height: auto;
  margin: 0 0 22px;
}

.tab-panel h3 {
  margin: 0 0 8px;
  font-family: Sen, Arial, Helvetica, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--orange);
}

.tab-panel p,
.tab-panel li {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--ink);
}

.tab-panel ol { margin: 0 0 12px; padding-left: 18px; }

.site-footer {
  padding: 42px 0 48px;
  background: var(--footer);
  text-align: left;
}

.site-footer img { height: 40px; width: auto; }

.site-footer p {
  margin: 0 0 8px;
  font-size: 14px;
}

.site-footer a { color: var(--ink); }

.site-footer a:hover { color: var(--orange); }


.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 32, 34, 0.45);
}

.modal-card {
  width: min(460px, 100%);
  padding: 28px 24px;
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.modal-card h2 {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 600;
}

.name-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  text-align: left;
}

.name-row label { font-weight: 700; }

.name-row input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
}

.modal-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.ghost-btn {
  padding: 10px 16px;
  border: 0;
  background: #c0c2c2;
  color: #fff;
  font-family: Sen, Arial, Helvetica, sans-serif;
  font-weight: 700;
  cursor: pointer;
}

.error {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: #c0392b;
  font-size: 14px;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 255px;
  column-gap: 30px;
  align-items: start;
}

.article-copy { grid-column: 1; grid-row: 1; }

.toc {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: 24px;
  z-index: 1;
}

.toc a {
  display: block;
  width: 100%;
  margin: 0 0 5px;
  padding: 12px 16px;
  border: 1px solid #2498a8;
  border-radius: 0;
  background: #c2e5e9;
  color: #425e62;
  font-family: Sen, Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  text-decoration: none;
  opacity: 0.5;
  pointer-events: none;
  transition: background 0.3s, color 0.3s, opacity 0.3s;
}

.toc a.activated {
  opacity: 1;
  pointer-events: auto;
}

.toc a.activated:hover,
.toc a.is-active {
  background: #2498a8;
  color: #fff;
  opacity: 1;
  pointer-events: auto;
}

.reveal-1,
.reveal-2 { display: none; }

.reveal-1.is-open,
.reveal-2.is-open {
  display: block;
  animation: section-in 0.3s ease;
}

@keyframes section-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.article-copy h3 {
  margin: 28px 0 10px;
  color: var(--orange);
  font-family: Sen, Arial, Helvetica, sans-serif;
  font-size: 26px;
}

.article-copy h3.table-heading {
  margin: 4px 0 14px;
  color: #1c7c8c;
  font-size: 22px;
  font-weight: 700;
}

.article-copy p,
.rationale p {
  color: var(--ink);
}

.article-copy .note,
.rationale .note {
  font-size: 14px;
  color: #5c6f72;
}

.article-video {
  display: block;
  width: min(100%, 760px);
  margin: 8px 0 12px;
  background: #111;
}

.qbox,
.rationale {
  margin: 0 0 16px;
  padding: 16px 18px;
  background: var(--card);
}

.article-copy .key-box.orange-tint,
.article-copy .orange-tint {
  margin: 16px 0;
  padding: 16px 18px;
  background: var(--info);
}

.article-copy hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }

.table-wrap { margin: 12px 0 16px; }

.evidence-table { position: relative; }

.evidence-table-clip { position: relative; overflow-x: auto; }

.evidence-table.is-collapsed .evidence-table-clip {
  overflow: hidden;
}

.evidence-table.is-collapsed .evidence-table-clip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #fff 62%);
  pointer-events: none;
}

.table-toggle {
  position: relative;
  z-index: 1;
  display: block;
  margin: 14px auto 0;
  padding: 10px 22px;
  border: 0;
  border-radius: 6px;
  background: #1aa3b3;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(23, 72, 78, 0.16);
}

.table-toggle:hover { background: #178fa0; }

.evidence-table.is-collapsed .table-toggle {
  position: absolute;
  left: 50%;
  bottom: 16px;
  margin: 0;
  transform: translateX(-50%);
}

.article-copy table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 14px;
  line-height: 1.45;
}

.article-copy th,
.article-copy td {
  padding: 14px 16px;
  border: 0;
  vertical-align: top;
  text-align: left;
}

.article-copy th {
  background: #ff8c00;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  vertical-align: middle;
}

.article-copy .standardTable tr:nth-child(even) td { background: #fff; }

.article-copy .standardTable tr:nth-child(odd) td { background: #e5f5f7; }

.refs {
  margin: 24px 0 8px;
  border-top: 1px solid var(--line);
}

.refs summary {
  padding: 14px 0;
  color: var(--orange);
  font-family: Sen, Arial, Helvetica, sans-serif;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
}

.post-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 20px;
  row-gap: 20px;
  margin-bottom: 22px;
}

.post-grid .card {
  margin: 0;
  height: 100%;
}

.post-next {
  display: flex;
  align-items: center;
  width: min(100%, 66%);
  margin: 0 0 28px;
  padding: 12px 16px;
  border: 1px solid var(--teal);
  border-radius: 45px;
  background: transparent;
  color: var(--teal);
  font-family: Sen, Arial, Helvetica, sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  cursor: pointer;
}

.post-next img {
  width: 28px;
  height: 26px;
  margin-right: 16px;
  flex: none;
}

.post-next-arrow {
  width: 30px;
  height: 30px;
  margin-left: auto;
  flex: none;
}

.post-next:hover:not(:disabled) {
  background: var(--teal);
  color: #fff;
}

.post-next:hover:not(:disabled) img { filter: brightness(0) invert(1); }

.post-next:disabled {
  opacity: 0.5;
  cursor: default;
}

.score-panel {
  margin: 0 0 22px;
  padding: 4px 0 0;
  text-align: left;
}

.score-value {
  margin: 0 0 8px;
  color: var(--orange);
  font-family: Sen, Arial, Helvetica, sans-serif;
  font-size: 48px;
  font-weight: 700;
}

.option.is-correct { font-weight: 700; }

.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 15;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  box-shadow: 0 8px 20px rgba(174, 96, 0, 0.28);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background 0.2s ease;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.to-top:hover { background: var(--orange-deep); }

#auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: #fff;
  color: var(--ink);
  text-align: center;
}

#auth-screen[hidden] { display: none !important; }

#auth-message {
  max-width: 36rem;
  margin: 0;
  font-size: 18px;
  line-height: 1.5;
}

.to-top svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 980px) {
  .post-grid { grid-template-columns: 1fr; }
  .post-next { width: 100%; }
  .article-layout { grid-template-columns: 1fr; }
  .article-copy { grid-column: 1; grid-row: 1; }
  .toc { grid-column: 1; grid-row: 2; position: static; }
}

@media (max-width: 980px) {
  .hero-grid,
  .likert,
  .tab-grid { grid-template-columns: 1fr; }

  .hero h1 { font-size: 30px; }
  .hero h2, .section-title { font-size: 24px; }

  .hero-side, .faculty-link, .portrait { align-items: center; text-align: center; }
  .portrait { margin: 0 auto 8px; }
  .badge { margin: 0 auto; }

  .menu-toggle { display: block; }

  .nav-list {
    display: none;
    flex-direction: column;
    align-items: stretch;
    margin-top: 12px;
    border-radius: 24px;
  }

  .nav-list.open { display: flex; }

  .to-top { right: 16px; bottom: 16px; }

  .brand-logo { height: 24px; }
  .brand-tagline strong { font-size: 12px; }
  .brand-tagline span { font-size: 11px; }
  .user-meta strong { max-width: 140px; font-size: 12px; }
  .user-meta span { max-width: 140px; }
}

@media (max-width: 640px) {
  .brand-tagline { display: none; }
  .user-chip { margin-left: auto; }
}
