/* Past Papers 2 Go — directory-first, myIQ-adjacent warmth + clarity */

:root {
  --bg: #f6f3ef;
  --bg-card: #fffcfa;
  --ink: #1a1714;
  --ink-muted: #5c564e;
  --accent: #c45c2a;
  --accent-soft: rgba(196, 92, 42, 0.12);
  --accent-hover: #a34a22;
  --line: #e8e2da;
  --success: #2d6a4f;
  --shadow: 0 18px 50px rgba(26, 23, 20, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Nunito Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-hover);
}

/* Subtle paper texture */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  z-index: -1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(246, 243, 239, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.header-promo {
  flex: 1;
  min-width: 0;
  position: relative;
  min-height: 2.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.header-promo-item {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-decoration: none;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, color 0.2s ease;
}
.header-promo-item.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}
.header-promo-trustpilot {
  color: var(--ink);
}
.header-promo-tp-inner {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  max-width: 100%;
}
.header-promo-tp-mark {
  flex-shrink: 0;
}
.header-promo-tp-wordmark {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.header-promo-tp-rating {
  color: #00b67a;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}
.header-promo-tp-score {
  color: var(--ink-muted);
  font-weight: 600;
}
.header-promo-tp-score strong {
  color: var(--ink);
  font-weight: 800;
}
.header-promo-maths,
.header-promo-english {
  color: var(--accent);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  text-decoration-color: var(--accent-soft);
}
.header-promo-maths:hover,
.header-promo-english:hover {
  color: var(--ink);
  text-decoration-color: var(--accent);
}
@media (max-width: 720px) {
  .header-promo {
    display: none;
  }
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex-shrink: 0;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.header-inner > .header-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.header-actions nav {
  flex-shrink: 0;
}
.header-country-field {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.header-country-custom {
  position: relative;
}
.header-country-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0.35rem 1.85rem 0.35rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background-color: var(--bg-card);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b6560'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 0.95rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-width: 3.5rem;
}
.header-country-btn:hover,
.header-country-btn:focus-visible {
  border-color: var(--accent-soft);
}
.header-country-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.header-country-flag-img {
  display: block;
  width: 22px;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.header-country-list {
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  z-index: 100;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  min-width: 12rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}
.header-country-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.55rem;
  border-radius: calc(var(--radius-sm) - 2px);
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-muted);
  transition: background 0.15s ease;
}
.header-country-option img {
  flex-shrink: 0;
  width: 22px;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.header-country-option-name {
  flex: 1;
  min-width: 0;
}
.header-country-option:hover,
.header-country-option:focus {
  background: var(--accent-soft);
  color: var(--ink);
  outline: none;
}
.header-country-option.is-selected {
  color: var(--accent);
}
.brand-mark {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
}
.brand-tag {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
}

.nav-tools {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink-muted);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  transition: border-color 0.2s, color 0.2s;
}
.nav-tools:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
}

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  flex: 1;
  width: 100%;
}

.hero {
  text-align: center;
  padding: 2rem 0 3rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 2.85rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 1rem;
  letter-spacing: -0.02em;
}

.hero-lead {
  max-width: 36rem;
  margin: 0 auto 1.5rem;
  color: var(--ink-muted);
  font-size: 1.05rem;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem 2rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
  font-weight: 600;
}
.trust-strip span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.trust-strip strong {
  color: var(--success);
  font-weight: 800;
}

.directory-toolbar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}
@media (min-width: 640px) {
  .directory-toolbar {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }
  .directory-toolbar > .directory-toolbar-primary:first-child:last-child {
    flex: 1 1 100%;
    max-width: 100%;
  }
}
.directory-toolbar-primary {
  flex: 1;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.directory-search-form {
  width: 100%;
  margin: 0;
}
.browse-col-title a {
  color: inherit;
  text-decoration: none;
}
.browse-col-title a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.trending-line {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
  line-height: 1.4;
  min-height: 1.35em;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
}
.trending-line-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.68rem;
  color: var(--accent);
  font-weight: 800;
}
.trending-line-value {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: opacity 0.28s ease, color 0.2s, border-color 0.2s;
}
.trending-line-value:hover {
  color: var(--accent);
  border-bottom-color: var(--accent-soft);
}
.trending-line-value:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}
.trending-line-value.is-dim {
  opacity: 0.25;
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  width: 100%;
}
.search-wrap label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.search-wrap input {
  width: 100%;
  padding: 0.85rem 2.75rem 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--bg-card);
  box-shadow: var(--shadow);
}
.search-icon-btn {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.5rem;
  border: none;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--ink-muted);
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.search-icon-btn:hover {
  opacity: 0.95;
  color: var(--ink);
}
.search-icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.search-icon-btn:active {
  background: var(--accent-soft);
  opacity: 1;
}

.board-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  flex-shrink: 0;
}
.board-filters button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--ink-muted);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.board-filters button:hover,
.board-filters button.is-active {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
}

.browse-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem 2rem;
  margin-bottom: 2.5rem;
}

.home-extra-browse {
  margin-top: 1.75rem;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) {
  .home-extra-browse {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 960px) {
  .home-extra-browse {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 600px) {
  .browse-columns {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 960px) {
  .browse-columns {
    grid-template-columns: repeat(4, 1fr);
  }
}
.browse-col {
  margin: 0;
  min-width: 0;
}
.browse-col-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.browse-col-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.browse-col-list li {
  padding: 0;
  min-width: 0;
  max-width: 100%;
}
.browse-col-list a {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink-muted);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.browse-col-list a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.browse-col-list a[data-subject],
.browse-col-list a[data-board] {
  color: var(--ink);
}
#browse-results,
#browse-columns {
  scroll-margin-top: 5.5rem;
}

.home-section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.latest-comments {
  margin-top: 0.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}
.latest-comments-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem 1.5rem;
}
@media (min-width: 600px) {
  .latest-comments-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 960px) {
  .latest-comments-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.latest-comment-col {
  min-width: 0;
}
.latest-comment-col--empty {
  min-height: 1px;
}
.comment-card {
  height: 100%;
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.comment-card-body {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--ink);
  flex: 1;
}
.comment-card-author {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-muted);
}
.comment-card-paper {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  line-height: 1.35;
}
.comment-card-paper:hover {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.latest-comments-fallback {
  grid-column: 1 / -1;
  margin: 0;
}

.paper-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
  width: 100%;
}
.paper-back {
  margin: 0 0 1.5rem;
  font-size: 0.92rem;
}
.paper-back a {
  color: var(--ink-muted);
  font-weight: 700;
  text-decoration: none;
}
.paper-back a:hover {
  color: var(--accent);
  text-decoration: underline;
}
.paper-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--line);
}
.paper-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}
.paper-meta {
  margin: 0 0 1rem;
  color: var(--ink-muted);
  font-weight: 600;
  font-size: 0.95rem;
}
.paper-external-wrap {
  margin: 0;
}
.paper-external-link {
  display: inline-flex;
  font-weight: 800;
  font-size: 0.92rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.paper-external-link:hover {
  filter: brightness(1.05);
}
.paper-comments-section h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 0 0 0.75rem;
}
.paper-comments-note {
  margin: 0 0 1.25rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.45;
}
.paper-comments-note code {
  font-size: 0.8rem;
}
.paper-comments-list {
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.paper-comment {
  margin: 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.45);
}
.paper-comment--local {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
}
.paper-comment-body {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.paper-comment-meta {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
}
.paper-comment-author {
  font-weight: 700;
  color: var(--ink);
}
.paper-comment-form {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}
.paper-turnstile-wrap {
  margin: 0.2rem 0 0.85rem;
}
.paper-turnstile-hint {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink-muted);
}
.paper-comment-form-title {
  font-size: 1rem;
  margin: 0 0 1rem;
}
.paper-comment-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-muted);
  margin-bottom: 1rem;
}
.paper-comment-label input,
.paper-comment-label textarea {
  font: inherit;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
}
.paper-comment-label textarea {
  resize: vertical;
  min-height: 6rem;
}
.paper-comment-error {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #b42318;
}
.paper-comment-submit {
  font: inherit;
  font-weight: 800;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  cursor: pointer;
}
.paper-comment-submit:hover {
  opacity: 0.92;
}

.pdf-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin: 0 0 1.25rem;
}
.pdf-viewer {
  width: 100%;
  height: 70vh;
  min-height: 560px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow);
}

.board-section {
  margin-bottom: 2.75rem;
}
.board-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--line);
}

.subject-block {
  margin-bottom: 1.75rem;
}
.subject-name {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

.paper-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}
@media (min-width: 720px) {
  .paper-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

.paper-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(26, 23, 20, 0.04);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.paper-card:hover {
  border-color: var(--accent-soft);
  box-shadow: var(--shadow);
}
.paper-card a.paper-link {
  font-weight: 800;
  color: var(--ink);
  font-size: 0.95rem;
}
.paper-card a.paper-link:hover {
  color: var(--accent);
}
.paper-meta {
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-muted);
  font-weight: 600;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(255, 252, 250, 0.8);
  padding: 2.5rem 1.5rem 2rem;
  margin-top: auto;
}
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.5rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
}
.footer-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem 2.5rem;
  width: 100%;
  text-align: left;
  align-items: start;
}
@media (min-width: 720px) {
  .footer-columns {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  }
}
.footer-col {
  margin: 0;
  min-width: 0;
}
.footer-desc {
  margin: 0;
  line-height: 1.55;
  font-weight: 600;
  color: var(--ink-muted);
}
.footer-desc a {
  font-weight: 800;
  color: var(--accent);
}
.footer-desc a:hover {
  color: var(--accent-hover);
}
.footer-col-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.65rem;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.footer-col-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.footer-col-list li {
  min-width: 0;
  max-width: 100%;
}
.footer-col-list a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  font-weight: 700;
  color: var(--ink-muted);
  font-size: 0.88rem;
}
.footer-col-list a:hover {
  color: var(--accent);
}
.footer-col-list a[aria-current="page"] {
  color: var(--accent);
}
.footer-social {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
}
.footer-col .footer-social {
  margin-top: 1.1rem;
}
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--ink-muted);
  transition: color 0.2s, border-color 0.2s, transform 0.15s;
}
.footer-social a:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
  transform: translateY(-2px);
}
.footer-social a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.footer-social svg {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
}
.footer-copy {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-muted);
  font-weight: 600;
  text-align: center;
  align-self: center;
}

/* Tools page */
.tools-hero {
  text-align: center;
  max-width: 38rem;
  margin: 0 auto 2rem;
}
.tools-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin: 0 0 0.75rem;
}
.tools-hero p {
  color: var(--ink-muted);
  margin: 0;
}

.tool-panel[id],
.tool-roadmap {
  scroll-margin-top: 5.5rem;
}
.tool-section-note {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--ink-muted);
  font-weight: 600;
  line-height: 1.45;
}
.tool-roadmap {
  max-width: 1120px;
  margin: 2.5rem auto 0;
  padding: 1.25rem 1.35rem;
  background: var(--bg-card);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}
.tool-roadmap h2 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
}
.tool-roadmap p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-muted);
  font-weight: 600;
  line-height: 1.45;
}
.tool-roadmap + .tool-roadmap {
  margin-top: 1rem;
}

.tools-layout {
  display: grid;
  gap: 1.5rem;
}
@media (min-width: 900px) {
  .tools-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.tool-panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}
.tool-panel h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 1rem;
}
.tool-panel textarea {
  width: 100%;
  min-height: 180px;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font: inherit;
  resize: vertical;
  margin-bottom: 1rem;
}
.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.btn {
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0.75rem 1.35rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.result-shell {
  position: relative;
  min-height: 280px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #faf8f5;
}

.result-inner {
  padding: 1.25rem;
}
.result-inner.is-locked {
  filter: blur(8px);
  user-select: none;
  pointer-events: none;
  transform: scale(0.98);
  opacity: 0.85;
}
.result-inner.revealed {
  filter: none;
  user-select: text;
  pointer-events: auto;
  transform: none;
  opacity: 1;
}

.result-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  background: linear-gradient(
    180deg,
    rgba(246, 243, 239, 0.15) 0%,
    rgba(246, 243, 239, 0.92) 45%,
    rgba(246, 243, 239, 0.97) 100%
  );
  backdrop-filter: blur(2px);
}
.result-overlay.hidden {
  display: none;
}

.pay-card {
  max-width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.pay-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}
.pay-card .price {
  font-size: 2rem;
  font-weight: 900;
  color: var(--accent);
  margin: 0.25rem 0;
}
.pay-card .fine-print {
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--ink-muted);
  margin: 0.75rem 0 1rem;
}
.mock-pay {
  width: 100%;
}

.progress-bar {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 1rem;
  display: none;
}
.progress-bar.active {
  display: block;
}
.progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 2.2s ease-out;
}
.progress-bar.active span {
  width: 100%;
}

.back-link {
  display: inline-block;
  margin-bottom: 1.5rem;
  font-weight: 700;
  font-size: 0.9rem;
}

.breadcrumb {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}
.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}
.breadcrumb li {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}
.breadcrumb li:not(:last-child)::after {
  content: "/";
  color: var(--ink-muted);
  margin-left: 0.55rem;
}
.breadcrumb a {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 700;
}
.breadcrumb a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

main.legal-main {
  padding-top: 2rem;
  padding-bottom: 1rem;
}
.legal-page {
  max-width: 40rem;
  margin: 0 auto;
}
.legal-page h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2rem);
  margin: 0 0 1rem;
}
.legal-page p {
  margin: 0 0 1rem;
  color: var(--ink-muted);
}
.legal-page .lede {
  color: var(--ink);
  font-weight: 600;
}
