:root {
  --ink: #17202a;
  --muted: #64707d;
  --line: #dce3ea;
  --paper: #ffffff;
  --wash: #f4f7f9;
  --navy: #16324f;
  --teal: #087b72;
  --saffron: #d98b20;
  --green: #1f8d63;
  --shadow: 0 18px 45px rgba(20, 37, 55, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--wash);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topline,
.brand-row {
  max-width: 1180px;
  margin: 0 auto;
  padding: 9px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.topline {
  color: #eef6fb;
  background: var(--navy);
  max-width: none;
  padding-inline: max(24px, calc((100vw - 1180px) / 2 + 24px));
  font-size: 13px;
}

.topline nav,
.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.topline a {
  color: #d9edf5;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--navy), var(--teal));
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.brand strong {
  display: block;
  font-size: 27px;
  color: var(--navy);
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: -3px;
}

.main-nav a {
  color: #2f3c48;
  font-size: 14px;
  font-weight: 700;
}

.menu-button {
  display: none;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--navy);
  border-radius: 6px;
  padding: 9px 12px;
  font-weight: 700;
}

.hero {
  min-height: 430px;
  display: grid;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(8, 21, 35, 0.86) 0%, rgba(8, 21, 35, 0.74) 39%, rgba(8, 21, 35, 0.2) 72%),
    url("assets/study-hero.png") center / cover;
}

.notes-hero {
  min-height: 330px;
  display: grid;
  align-items: center;
  background:
    linear-gradient(90deg, rgba(8, 21, 35, 0.9) 0%, rgba(8, 21, 35, 0.72) 46%, rgba(8, 21, 35, 0.25) 100%),
    url("assets/study-hero.png") center / cover;
}

.hero-copy {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 64px 24px;
  color: #fff;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--saffron);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1.02;
}

.hero p:not(.eyebrow) {
  max-width: 560px;
  color: #e8eef3;
  font-size: 18px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.primary-action,
.secondary-action,
.widget button {
  border: 0;
  border-radius: 6px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
}

.primary-action,
.widget button {
  background: var(--saffron);
  color: #17130d;
}

.secondary-action {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.44);
}

.secondary-action.dark {
  background: #eef4f7;
  color: var(--navy);
  border: 1px solid var(--line);
}

.search-band {
  max-width: 1180px;
  margin: -36px auto 0;
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 22px;
  align-items: end;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 5;
}

label {
  display: block;
  font-weight: 800;
  margin-bottom: 7px;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  font-size: 16px;
}

select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--paper);
  font: inherit;
}

textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  color: var(--ink);
  font: inherit;
  resize: vertical;
}

.stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.stats strong {
  display: block;
  color: var(--navy);
  font-size: 20px;
}

.content-shell {
  max-width: 1180px;
  margin: 34px auto 0;
  padding: 0 24px 48px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
  align-items: start;
}

.quiz-lab {
  max-width: 1180px;
  margin: 34px auto 0;
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.quiz-lab-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.quiz-lab-header h2 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: 30px;
  line-height: 1.18;
}

.quiz-lab-header p:last-child {
  margin: 0;
  color: var(--muted);
}

.source-link {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--teal);
  font-weight: 800;
  padding: 10px 12px;
}

.quiz-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.quiz-tabs button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fbfc;
  color: var(--navy);
  font-weight: 800;
  padding: 10px 12px;
  cursor: pointer;
}

.quiz-tabs [aria-selected="true"] {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.quiz-form {
  display: grid;
  gap: 16px;
}

.question-block {
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.question-block legend {
  display: flex;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  padding: 0 6px;
}

.question-block legend span {
  width: 26px;
  height: 26px;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 13px;
}

.options {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.options label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  font-weight: 400;
  cursor: pointer;
}

.options input {
  width: 18px;
  min-height: 18px;
  margin-top: 3px;
}

.explanation {
  margin: 14px 0 0;
  padding: 12px;
  border-radius: 6px;
  background: #eef8f5;
  color: #24453c;
}

.question-block.is-correct {
  border-color: rgba(31, 141, 99, 0.55);
}

.question-block.is-incorrect {
  border-color: rgba(217, 139, 32, 0.65);
}

.quiz-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.quiz-score {
  color: var(--navy);
  font-size: 18px;
  font-weight: 800;
}

.daily-note-quiz {
  max-width: 1180px;
  margin: 34px auto 0;
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.daily-note-quiz .section-heading p:last-child {
  margin-bottom: 20px;
}

.download-hub,
.link-library {
  max-width: 1180px;
  margin: 34px auto 0;
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.download-grid,
.link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.download-card,
.resource-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfd;
}

.download-card {
  display: grid;
  gap: 12px;
  align-content: start;
}

.download-card h3,
.resource-card h3 {
  margin: 0;
  color: var(--navy);
}

.download-card p,
.resource-card p {
  margin: 0;
  color: var(--muted);
}

.download-card .primary-action {
  display: inline-flex;
  justify-content: center;
  width: fit-content;
}

.file-type {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eef8f5;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.resource-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.resource-card a {
  color: var(--teal);
  font-weight: 800;
}

.notes-shell,
.daily-pib,
.notes-library {
  max-width: 1180px;
  margin: 34px auto 0;
  padding: 0 24px;
}

.daily-pib-head,
.one-pager {
  background: var(--paper);
  border: 1px solid var(--line);
}

.daily-pib-head {
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: end;
}

.daily-pib-head h2 {
  margin: 0 0 8px;
  color: var(--navy);
}

.daily-pib-head p:last-child {
  margin: 0;
  color: var(--muted);
}

.date-loader-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
}

.date-loader-controls .primary-action,
.date-loader-controls .quiz-jump {
  min-height: 48px;
  white-space: nowrap;
}

.date-loader-controls .quiz-jump {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.daily-pib-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
  align-items: start;
}

.one-pager {
  padding: 28px;
}

.summary-title-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 18px;
}

.summary-title-row time {
  color: var(--saffron);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-title-row h3 {
  margin: 4px 0 0;
  color: var(--navy);
  font-size: 30px;
  line-height: 1.18;
}

.summary-lead {
  margin: 0 0 20px;
  color: #314251;
  font-size: 17px;
}

.summary-blocks {
  display: grid;
  gap: 14px;
}

.summary-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 16px;
}

.summary-block h4 {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 17px;
}

.summary-block ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.summary-block li + li {
  margin-top: 6px;
}

.mind-map {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  display: grid;
  grid-template-columns: minmax(150px, 0.36fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.mind-map-core {
  min-height: 74px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 2px solid rgba(8, 123, 114, 0.28);
  border-radius: 999px;
  padding: 12px;
  background: #eef8f5;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
}

.mind-map-branches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mind-map-branches span {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: var(--paper);
  color: #314251;
  font-size: 12px;
  font-weight: 800;
}

.mind-map-branches span::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -9px;
  width: 8px;
  border-top: 1px solid rgba(8, 123, 114, 0.42);
}

.summary-side {
  display: grid;
  gap: 18px;
}

.source-list {
  display: grid;
  gap: 10px;
}

.source-list a {
  display: block;
  color: var(--teal);
  font-weight: 800;
}

.source-list small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.notes-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
  align-items: start;
}

.notes-form,
.notes-library {
  background: var(--paper);
  border: 1px solid var(--line);
}

.notes-form {
  padding: 28px;
  display: grid;
  gap: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.notes-side {
  display: grid;
  gap: 18px;
}

.check-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.check-list li + li {
  margin-top: 8px;
}

.tags button {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: #314251;
  background: #f9fbfc;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.notes-actions,
.library-toolbar,
.note-card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.notes-library {
  margin-bottom: 48px;
  padding: 28px;
}

.library-toolbar {
  margin-bottom: 18px;
}

.library-toolbar input {
  flex: 1 1 260px;
}

.notes-list {
  display: grid;
  gap: 14px;
}

.note-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.note-card time {
  color: var(--saffron);
  font-size: 13px;
  font-weight: 800;
}

.note-card h3 {
  margin: 4px 0 8px;
  color: var(--navy);
}

.note-card p {
  margin: 0 0 12px;
  color: var(--muted);
}

.note-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.note-meta span,
.note-meta a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  background: var(--paper);
  color: #314251;
  font-size: 12px;
  font-weight: 800;
}

.note-meta a {
  color: var(--teal);
}

.note-card-actions {
  align-content: start;
}

.note-card-actions button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--navy);
  font-weight: 800;
  padding: 9px 11px;
  cursor: pointer;
}

.empty-state {
  margin: 0;
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfcfd;
}

.archive,
.widget {
  background: var(--paper);
  border: 1px solid var(--line);
}

.archive {
  padding: 28px;
}

.section-heading h2,
.widget h2 {
  margin: 0 0 10px;
  color: var(--navy);
}

.section-heading p:last-child {
  color: var(--muted);
  margin-bottom: 28px;
}

.month-group {
  border-top: 3px solid var(--navy);
  margin-top: 24px;
  padding-top: 14px;
}

.month-group[hidden] {
  display: none;
}

.month-group h3 {
  margin: 0 0 10px;
  font-size: 24px;
  color: var(--navy);
}

.quiz-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.quiz-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.quiz-list a {
  color: var(--teal);
  font-weight: 800;
}

.quiz-list span {
  color: var(--muted);
  font-size: 13px;
}

.pagination {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.pagination a {
  min-width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--navy);
  font-weight: 800;
}

.pagination [aria-current="page"] {
  background: var(--navy);
  color: #fff;
}

.sidebar {
  display: grid;
  gap: 18px;
}

.widget {
  padding: 22px;
}

.widget a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--teal);
  font-weight: 700;
}

.widget p {
  color: var(--muted);
}

.highlight {
  border-top: 5px solid var(--green);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: #314251;
  background: #f9fbfc;
  font-size: 13px;
}

footer {
  padding: 24px;
  background: var(--navy);
  color: #e7f2f7;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.visitor-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d9edf5;
  font-size: 13px;
  font-weight: 800;
}

.visitor-count img {
  display: block;
  height: 20px;
}

@media (max-width: 900px) {
  .topline {
    display: none;
  }

  .brand-row {
    flex-wrap: wrap;
  }

  .menu-button {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    width: 100%;
    padding: 8px 0 12px;
  }

  .main-nav.is-open {
    display: grid;
    gap: 10px;
  }

  .search-band,
  .content-shell,
  .daily-pib-head,
  .daily-pib-grid,
  .notes-shell {
    grid-template-columns: 1fr;
  }

  .search-band {
    margin: 0;
    border-left: 0;
    border-right: 0;
  }

  .content-shell {
    margin-top: 22px;
  }

  .quiz-lab,
  .daily-note-quiz {
    margin-top: 22px;
    padding: 22px;
  }

  .quiz-lab-header {
    display: grid;
  }

  .form-grid,
  .note-card,
  .download-grid,
  .link-grid {
    grid-template-columns: 1fr;
  }

  .notes-shell,
  .daily-pib,
  .notes-library {
    margin-top: 22px;
  }

  .quiz-list li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .date-loader-controls {
    grid-template-columns: 1fr;
  }

  .mind-map {
    grid-template-columns: 1fr;
  }

  .mind-map-branches span::before {
    display: none;
  }
}

@media (max-width: 560px) {
  .brand strong {
    font-size: 23px;
  }

  .hero {
    min-height: 390px;
  }

  .archive {
    padding: 20px;
  }
}
