:root {
  color-scheme: light;
  --navy: #0f172a;
  --navy-deep: #0b1120;
  --blue: #2563eb;
  --sky: #0284c7;
  --teal: #64748b;
  --yellow: #facc15;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --soft: #f8fafc;
  --panel: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--soft);
  color: #334155;
  font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(216, 224, 234, 0.9);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0;
}

.brand,
.main-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: var(--navy);
  font-size: 19px;
  font-weight: 800;
  text-decoration: none;
}

.brand span:last-child {
  display: grid;
  gap: 1px;
}

.brand small {
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #bfdbfe;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 0%, #dbeafe 64%, #f8fafc 100%);
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
  box-shadow: inset 0 0 8px rgba(37, 99, 235, 0.16), 0 2px 8px rgba(15, 23, 42, 0.08);
}

.main-nav {
  gap: 18px;
  color: #3a4a5f;
  font-size: 14px;
  font-weight: 700;
}

.main-nav a {
  color: inherit;
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 16px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn-whatsapp {
  background: #25d366;
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(37, 211, 102, 0.35);
}

.primary-action {
  background: var(--blue);
  color: #ffffff;
  box-shadow: 0 3px 12px rgba(37, 99, 235, 0.35);
}

.secondary-action {
  width: 100%;
  border-color: var(--line);
  background: #ffffff;
  color: var(--navy);
}

.secondary-action:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.generator-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 36px;
}

.hero-copy h1 {
  max-width: 820px;
  margin: 10px 0 14px;
  color: var(--navy);
  font-size: clamp(38px, 5vw, 62px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 720px;
  margin: 0;
  color: #42526a;
  font-size: 18px;
  line-height: 1.55;
}

.kicker {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.workspace {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 48px;
}

.filters,
.results-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.filters {
  align-self: start;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.filter-head h2,
.results-head h2 {
  margin: 3px 0 0;
  color: var(--navy);
  font-size: 21px;
  line-height: 1.2;
}

.filters label {
  display: grid;
  gap: 6px;
  color: #344256;
  font-size: 13px;
  font-weight: 800;
}

.hidden-filter {
  display: none !important;
}

select,
input[type="number"],
input[type="text"],
input[type="file"] {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--ink);
  padding: 0 11px;
}

input[type="file"] {
  padding: 8px 11px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #344256;
  font-size: 14px;
  font-weight: 800;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}

.primary-action {
  width: 100%;
  margin-top: 4px;
}

.results-panel {
  min-width: 0;
  overflow: hidden;
}

.results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(26, 188, 156, 0.12);
  color: #087c68;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.question-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
}

.question-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: #344256;
  font-size: 12px;
  line-height: 1.3;
}

.question-pill strong {
  display: block;
  color: var(--navy);
  font-size: 13px;
}

.preview-shell {
  overflow: auto;
  max-height: calc(100vh - 150px);
  padding: 24px;
  background: #e9eef5;
}

.compact-preview {
  position: relative;
  max-height: 400px;
  overflow: hidden;
}

.compact-preview .paper-page {
  zoom: 0.45;
}

.compact-preview::after {
  content: "Download the PDF for the full worksheet";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 150px;
  padding-bottom: 20px;
  background: linear-gradient(180deg, rgba(233, 238, 245, 0) 0%, #e9eef5 80%);
  color: #475467;
  font-size: 14px;
  font-weight: 600;
  pointer-events: none;
}

.admin-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 52px 0 30px;
}

.admin-hero h1 {
  margin: 8px 0 10px;
  color: var(--navy);
  font-size: clamp(36px, 5vw, 60px);
  line-height: 1;
  letter-spacing: 0;
}

.admin-hero p {
  max-width: 720px;
  margin: 0;
  color: #42526a;
  font-size: 18px;
  line-height: 1.55;
}

.admin-workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 48px;
}

.admin-upload,
.admin-list-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.admin-upload {
  align-self: start;
  display: grid;
  gap: 14px;
  padding: 18px;
}

.admin-upload label {
  display: grid;
  gap: 6px;
  color: #344256;
  font-size: 13px;
  font-weight: 800;
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.databank-list {
  display: grid;
}

.databank-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.databank-row:last-child {
  border-bottom: 0;
}

.databank-row strong,
.databank-row span {
  display: block;
}

.databank-row strong {
  color: var(--navy);
  font-size: 16px;
}

.databank-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.danger-button {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fff5f5;
  color: #b42318;
  padding: 0 13px;
  font-weight: 800;
}

.empty-library {
  display: grid;
  gap: 4px;
  padding: 28px 18px;
  color: var(--muted);
}

.empty-library strong {
  color: var(--navy);
}

.compact-preview .paper-page.locked-state {
  zoom: 1;
  display: grid;
  place-items: center;
  min-height: 320px;
  width: min(100%, 560px);
}

.compact-preview:has(.paper-page.locked-state)::after {
  display: none;
}

.locked-panel {
  display: grid;
  gap: 12px;
  justify-items: center;
  max-width: 400px;
  padding: 16px;
  text-align: center;
  font-family: inherit;
}

.locked-panel .locked-icon {
  font-size: 34px;
}

.locked-panel h3 {
  margin: 0;
  color: var(--navy);
  font-size: 20px;
}

.locked-panel p {
  margin: 0;
  color: #42526a;
  font-size: 14px;
  line-height: 1.55;
}

.locked-panel a.btn {
  text-decoration: none;
}

.locked-panel .unlock-code-btn {
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--blue);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.seo-content {
  border-top: 1px solid #e4e9f1;
  background: #ffffff;
  padding: 52px 0 60px;
}

.seo-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  color: #42526a;
  line-height: 1.6;
}

.seo-inner h2 {
  margin: 0 0 14px;
  color: var(--navy);
  font-size: 30px;
  line-height: 1.15;
}

.seo-inner h3 {
  margin: 26px 0 10px;
  color: var(--navy);
  font-size: 19px;
}

.seo-inner p {
  max-width: 820px;
  margin: 0 0 10px;
}

.seo-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px;
  margin-top: 6px;
}

.seo-columns ul,
.seo-columns ol {
  margin: 0;
  padding-left: 20px;
}

.seo-columns li {
  margin: 6px 0;
}

.faq-list {
  max-width: 820px;
  margin: 0;
}

.faq-list dt {
  margin-top: 16px;
  color: var(--navy);
  font-weight: 700;
}

.faq-list dd {
  margin: 6px 0 0;
}

.site-footer {
  padding: 26px 0 34px;
  border-top: 1px solid var(--navy-deep);
  background: var(--navy-deep);
  color: #9fadc7;
  font-size: 14px;
  text-align: center;
}

.site-footer p {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-footer a {
  color: #c6d0e2;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 920px) {
  .main-nav {
    display: none;
  }

  .seo-columns {
    grid-template-columns: 1fr;
  }

  .generator-hero,
  .workspace,
  .admin-hero,
  .admin-workspace {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .paper-page {
    padding: 30px 24px;
  }
}

/* Site-specific addition (not in the upstream psle-prep repo): about section links. */
.about-tmg a {
  color: var(--blue);
  font-weight: 600;
}
