:root {
  --bg: #f7f7f2;
  --surface: #ffffff;
  --ink: #202124;
  --muted: #62665f;
  --line: #deded4;
  --accent: #1f6f68;
  --accent-dark: #174f4a;
  --gold: #c58b33;
  --rose: #b85b5b;
  --blue: #4e6f9d;
  --shadow: 0 18px 45px rgba(34, 36, 31, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
}

body.modal-open {
  overflow: hidden;
}

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

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 52px);
  border-bottom: 1px solid rgba(32, 33, 36, 0.08);
  background: rgba(247, 247, 242, 0.92);
  backdrop-filter: blur(16px);
}

.brand,
.topnav,
.hero-actions,
.download-row,
.card-actions {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 760;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  border-radius: 8px;
  background: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0;
}

.topnav {
  gap: 20px;
  color: var(--muted);
  font-size: 0.95rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topnav > a {
  position: relative;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 11px;
  white-space: nowrap;
  font-weight: 500;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.topnav > a[aria-current="page"] {
  transform: translateY(-2px);
  border-color: var(--line);
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 6px 14px rgba(32, 33, 36, 0.1);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  list-style: none;
  cursor: pointer;
  font-weight: 700;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::after {
  content: "v";
  margin-left: 5px;
  font-size: 0.7rem;
}

.nav-dropdown[open] summary,
.nav-dropdown summary:hover,
.topnav a:hover {
  color: var(--ink);
}

.nav-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 40;
  display: grid;
  min-width: 250px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.nav-menu a {
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--muted);
  white-space: nowrap;
}

.nav-menu a:hover {
  background: #e5f0ee;
  color: var(--accent-dark);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 64px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: clamp(20px, 3vw, 44px);
  align-items: center;
  min-height: 570px;
  padding: 42px 0 30px;
}

.template-page-hero {
  max-width: 920px;
  padding: clamp(52px, 8vw, 92px) 0 34px;
}

.template-page-hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 7vw, 5.6rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.template-page-hero p:not(.eyebrow) {
  max-width: 760px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.7;
}

.hero-copy h1 {
  max-width: 590px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.35rem, 4.5vw, 4rem);
  line-height: 1.02;
  letter-spacing: 0;
  overflow-wrap: normal;
}

.hero-copy p:not(.eyebrow) {
  max-width: 560px;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(0.96rem, 1.5vw, 1.08rem);
  line-height: 1.65;
}

.hero-copy .eyebrow {
  margin-bottom: 10px;
  font-size: 0.72rem;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.hero-search-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.hero-search-panel h2 {
  margin: 0 0 16px;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  letter-spacing: 0;
}

.hero-keyword-list {
  display: grid;
  gap: 8px;
}

.hero-keyword-list a {
  position: relative;
  display: block;
  min-height: 54px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 32px 10px 12px;
  background: #eef0f0;
  color: var(--ink);
  line-height: 1.3;
}

.hero-keyword-list a::after {
  content: ">";
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 800;
}

.hero-keyword-list a:hover {
  border-color: rgba(31, 111, 104, 0.35);
  background: #e5f0ee;
  color: var(--accent-dark);
}

.button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  background: var(--surface);
  color: var(--ink);
  font-weight: 720;
}

.button.primary {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

.button.primary:hover {
  background: var(--accent-dark);
}

.button.secondary:hover,
.button.ghost:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.button.ghost {
  background: transparent;
}

.hero-visual {
  position: relative;
  min-height: 520px;
  z-index: 0;
}

.paper {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 42px 38px;
  border: 1px solid #ece9df;
  border-radius: 8px;
  background: #fffdf8;
  box-shadow: var(--shadow);
}

.paper-main {
  inset: 22px 10px 28px 58px;
  transform: rotate(1.5deg);
}

.paper-back {
  inset: 78px 68px 108px 0;
  transform: rotate(-7deg);
  background: #f5fbfa;
}

.paper-date,
.paper-line,
.paper-block,
.signature {
  display: block;
  border-radius: 999px;
  background: #d9ddd4;
}

.paper-date {
  width: 112px;
  height: 10px;
  align-self: flex-end;
}

.paper-line {
  width: 72%;
  height: 10px;
}

.paper-line.wide {
  width: 92%;
}

.paper-line.medium {
  width: 58%;
}

.paper-line.short {
  width: 38%;
}

.paper-block {
  width: 100%;
  height: 118px;
  margin: 10px 0;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(31, 111, 104, 0.15), rgba(197, 139, 51, 0.18));
}

.paper-block.small {
  height: 84px;
}

.signature {
  width: 155px;
  height: 16px;
  margin-top: auto;
  background: var(--gold);
}

.toolbar,
.detail-shell,
.seo-intent,
.seo-copy {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 10px 30px rgba(34, 36, 31, 0.05);
}

.seo-intent {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 22px;
  align-items: start;
  margin: 4px 0 28px;
  padding: 22px;
}

.seo-intent h2,
.seo-copy h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
}

.seo-intent p,
.seo-copy p {
  color: var(--muted);
  line-height: 1.65;
}

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

.keyword-grid a {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 8px;
  padding: 10px 14px;
  background: #eef0f0;
  color: var(--ink);
  line-height: 1.25;
}

.keyword-grid a::after {
  content: "⌕";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1.15rem;
}

.keyword-grid a:hover {
  background: #e5f0ee;
  color: var(--accent-dark);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  padding: 18px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 760;
}

.toolbar label {
  gap: 11px;
  line-height: 1.3;
}

input,
select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--ink);
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(31, 111, 104, 0.25);
  outline-offset: 2px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.category-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 24px 0 10px;
}

.category-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-weight: 720;
}

.category-chip.active {
  border-color: var(--accent);
  background: #e5f0ee;
  color: var(--accent-dark);
}

.results-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 34px 0 18px;
}

.results-head > div {
  max-width: 860px;
}

.results-head h2,
.detail-meta h2,
.empty-state h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  letter-spacing: 0;
}

.template-intro {
  max-width: 820px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

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

.template-card {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 14px;
  min-height: 338px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--accent-dark);
  background: #e5f0ee;
  font-size: 0.76rem;
  font-weight: 760;
}

.tag.alt {
  color: #764519;
  background: #f6ead8;
}

.template-card h3 {
  margin: 12px 0 8px;
  font-size: 1.24rem;
  letter-spacing: 0;
}

.template-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.guide-link {
  display: inline-flex;
  margin-top: 12px;
  color: var(--accent-dark);
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.mini-doc {
  width: 62px;
  height: 78px;
  flex: 0 0 62px;
  border: 1px solid #e7e2d8;
  border-radius: 6px;
  padding: 12px 8px;
  background: #fffaf1;
}

.mini-doc span {
  display: block;
  height: 5px;
  margin-bottom: 7px;
  border-radius: 999px;
  background: #d7cfc2;
}

.mini-doc span:nth-child(2) {
  width: 72%;
}

.mini-doc span:nth-child(3) {
  width: 88%;
}

.facts {
  display: grid;
  gap: 7px;
  align-self: end;
  margin-top: 4px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.fact {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
  min-width: 0;
}

.fact b {
  color: var(--accent-dark);
  font-size: 0.68rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

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

.card-actions .button {
  min-width: 0;
  text-align: center;
  white-space: nowrap;
}

.detail-shell {
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 0.58fr);
  gap: 24px;
  margin-top: 42px;
  padding: clamp(18px, 3vw, 28px);
}

.detail-meta p {
  color: var(--muted);
  line-height: 1.6;
}

dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 9px 12px;
  margin: 20px 0;
}

dt {
  color: var(--muted);
  font-weight: 760;
}

dd {
  margin: 0;
}

.download-row {
  gap: 10px;
  flex-wrap: wrap;
}

.letter-preview {
  min-height: 560px;
  border: 1px solid #ebe4d8;
  border-radius: 8px;
  padding: clamp(24px, 5vw, 54px);
  background: #fffdf8;
  box-shadow: inset 0 0 0 10px rgba(247, 247, 242, 0.45);
  color: #2d2e2c;
  line-height: 1.72;
}

.letter-preview .placeholder {
  color: var(--muted);
}

.letter-preview h3 {
  margin: 0 0 24px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
}

.letter-preview p {
  margin: 0 0 16px;
}

.letter-preview .field {
  border-radius: 4px;
  padding: 1px 4px;
  background: #fff2cf;
  color: #684307;
  font-weight: 700;
}

.empty-state {
  margin: 18px 0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 38px 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
}

.seo-copy {
  margin-top: 32px;
  padding: clamp(18px, 3vw, 28px);
}

.seo-copy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.seo-copy article {
  border-top: 3px solid var(--accent);
  padding-top: 12px;
}

.seo-copy h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.article-body {
  max-width: 980px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.72;
}

.article-body p {
  margin: 0 0 16px;
}

.blog-article {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(52px, 8vw, 92px) 0 10px;
}

.blog-article h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 5.4vw, 4.7rem);
  line-height: 1;
  letter-spacing: 0;
}

.blog-lede {
  max-width: 760px;
  margin: 18px 0 26px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.7;
}

.related-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.related-link-grid a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--accent-dark);
  font-weight: 760;
  line-height: 1.35;
}

.related-link-grid a:hover {
  background: #e5f0ee;
}

.breadcrumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 28px;
  color: var(--muted);
  font-size: 0.8rem;
}

.breadcrumbs a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.keyword-page-hero {
  padding-top: clamp(36px, 6vw, 68px);
}

.keyword-page-hero h1 {
  max-width: 980px;
  font-size: clamp(2.4rem, 6vw, 4.8rem);
}

.keyword-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 4px 0 36px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.keyword-summary div {
  display: grid;
  gap: 6px;
}

.keyword-summary span {
  color: var(--accent-dark);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.keyword-summary strong {
  font-size: 0.92rem;
  line-height: 1.45;
}

.keyword-sample {
  margin-top: 0;
}

.keyword-article {
  max-width: 940px;
  margin: 36px auto 0;
  padding-right: 0;
  padding-left: 0;
}

.keyword-article > p {
  font-size: 1.02rem;
  line-height: 1.76;
}

.keyword-checklist,
.keyword-faq {
  margin-top: 34px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}

.keyword-checklist ul {
  display: grid;
  gap: 9px;
  margin: 16px 0 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.55;
}

.keyword-faq details {
  border-bottom: 1px solid var(--line);
  padding: 13px 0;
}

.keyword-faq summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 760;
}

.keyword-faq details p {
  margin: 10px 0 2px;
}

.related-resources {
  margin-top: 36px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.related-resources h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
}

.category-template-section {
  margin: 0 0 36px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 36px;
}

.category-template-section .results-head {
  margin-top: 0;
}

.about-content {
  max-width: 940px;
  margin-right: auto;
  margin-left: auto;
}

.format-guide {
  max-width: 980px;
  margin: 42px auto 0;
  border-top: 1px solid var(--line);
  padding-top: 30px;
}

.format-guide > h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.format-guide-section {
  display: grid;
  grid-template-columns: minmax(220px, 0.42fr) minmax(0, 0.58fr);
  gap: 8px 28px;
  border-bottom: 1px solid var(--line);
  padding: 26px 0;
}

.format-guide-section h2 {
  grid-row: span 3;
  margin: 0;
  font-size: 1.22rem;
}

.format-guide-section p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.65;
}

.format-guide-section > a {
  width: fit-content;
  color: var(--accent-dark);
  font-weight: 760;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.faq-page {
  max-width: 940px;
  margin: 0 auto;
}

.faq-page section {
  border-top: 1px solid var(--line);
  padding: 28px 0;
}

.faq-page h2 {
  margin: 0 0 14px;
  font-size: clamp(1.35rem, 2.5vw, 1.9rem);
}

.faq-page p {
  max-width: 860px;
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.72;
}

.template-directory {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.directory-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
}

.directory-card h3 {
  margin: 10px 0 8px;
  font-size: 1.08rem;
  letter-spacing: 0;
}

.directory-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.directory-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 8px;
  margin-top: 16px;
}

.directory-actions .button {
  min-width: 0;
  padding-right: 10px;
  padding-left: 10px;
  text-align: center;
  white-space: nowrap;
}

.directory-card .tag-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.template-page-preview {
  scroll-margin-top: 86px;
}

.request-template-list {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.request-template-list .detail-shell {
  margin-top: 0;
}

.request-template-list .letter-preview {
  min-height: auto;
}

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

.hidden {
  display: none;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(360px, calc(100% - 36px));
  transform: translateY(120%);
  border-radius: 8px;
  padding: 13px 15px;
  color: #fff;
  background: var(--accent-dark);
  box-shadow: var(--shadow);
  transition: transform 180ms ease;
}

.toast.show {
  transform: translateY(0);
}

.lead-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(32, 33, 36, 0.48);
  backdrop-filter: blur(8px);
}

.lead-modal.hidden {
  display: none;
}

.editor-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 18px;
  background: rgba(32, 33, 36, 0.68);
  backdrop-filter: blur(10px);
}

.editor-modal.hidden {
  display: none;
}

.editor-shell {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(1180px, 100%);
  height: calc(100vh - 36px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f2ef;
  box-shadow: var(--shadow);
}

.editor-header,
.editor-toolbar,
.editor-footer {
  background: var(--surface);
}

.editor-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  padding: 18px 70px 16px 24px;
  border-bottom: 1px solid var(--line);
}

.editor-header .eyebrow {
  margin-bottom: 3px;
}

.editor-header h2 {
  margin: 0;
  font-size: 1.35rem;
}

.editor-close {
  top: 22px;
  right: 22px;
}

.editor-toolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 18px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
}

.editor-control {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.editor-control > span,
.editor-control legend {
  padding: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  text-transform: uppercase;
}

.editor-control select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 32px 7px 10px;
  background: #fff;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}

.color-swatch.active {
  box-shadow: 0 0 0 2px var(--ink);
}

.editor-layouts {
  flex: 1 1 560px;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  margin-left: auto;
  overflow-x: auto;
  padding: 2px;
}

.style-option {
  display: grid;
  flex: 0 0 76px;
  gap: 4px;
  justify-items: center;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 6px;
  background: #fff;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.style-option + .style-option {
  border-left: 1px solid var(--line);
}

.style-option:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.preset-thumb {
  position: relative;
  display: block;
  width: 34px;
  height: 25px;
  overflow: hidden;
  border: 1px solid #d8d9d5;
  background:
    linear-gradient(#b8bbb6 0 0) 7px 9px / 20px 2px no-repeat,
    linear-gradient(#d4d5d1 0 0) 7px 14px / 16px 2px no-repeat,
    #fff;
}

.style-option.active {
  border-color: var(--accent);
  color: var(--accent-dark);
  background: #e5f0ee;
  box-shadow: 0 0 0 1px var(--accent);
}

.style-option[data-editor-style="classic"] .preset-thumb {
  border-top: 3px solid var(--accent);
}

.style-option[data-editor-style="modern"] .preset-thumb {
  border-left: 4px solid var(--accent);
}

.style-option[data-editor-style="minimal"] .preset-thumb {
  background:
    linear-gradient(#343634 0 0) 7px 6px / 14px 2px no-repeat,
    linear-gradient(#d4d5d1 0 0) 7px 13px / 20px 2px no-repeat,
    #fff;
}

.style-option[data-editor-style="mint"] .preset-thumb {
  background:
    linear-gradient(var(--accent) 0 0) 5px 5px / 24px 3px no-repeat,
    linear-gradient(#c8cac5 0 0) 7px 13px / 20px 2px no-repeat,
    #fff;
}

.style-option[data-editor-style="sky"] .preset-thumb {
  background:
    linear-gradient(#202124 0 0) 7px 6px / 17px 5px no-repeat,
    linear-gradient(#62665f 0 0) 7px 16px / 20px 2px no-repeat,
    #cfe8eb;
}

.style-option[data-editor-style="executive"] .preset-thumb {
  border-left: 7px solid var(--accent);
}

.style-option[data-editor-style="letterhead"] .preset-thumb {
  border-top: 8px solid var(--accent);
}

.style-option[data-editor-style="serif"] .preset-thumb {
  background:
    linear-gradient(#202124 0 0) 5px 5px / 24px 6px no-repeat,
    linear-gradient(#62665f 0 0) 6px 15px / 20px 2px no-repeat,
    #dceeea;
}

.style-option[data-editor-style="geometric"] .preset-thumb {
  background:
    linear-gradient(45deg, transparent 50%, #f0c84a 50%) 18px 0 / 16px 16px no-repeat,
    linear-gradient(45deg, var(--accent) 50%, transparent 50%) 18px 0 / 16px 16px no-repeat,
    linear-gradient(#292929 0 0) 4px 16px / 18px 3px no-repeat,
    #fff;
}

.style-option[data-editor-style="corner"] .preset-thumb {
  background:
    linear-gradient(90deg, #ececec 50%, #d0d0d0 50%) 18px 0 / 16px 8px no-repeat,
    linear-gradient(90deg, #d8d8d8 50%, var(--accent) 50%) 18px 8px / 16px 8px no-repeat,
    linear-gradient(var(--accent) 0 0) 5px 8px / 10px 3px no-repeat,
    #fff;
}

.editor-canvas-wrap {
  overflow: auto;
  padding: 32px;
}

.editor-page {
  --editor-accent: #1f6f68;
  --editor-tint: #dceeea;
  --editor-font: Georgia;
  width: min(760px, 100%);
  min-height: 920px;
  margin: 0 auto;
  border-top: 9px solid var(--editor-accent);
  padding: 58px 64px;
  color: #292929;
  background: #fff;
  box-shadow: 0 10px 30px rgba(32, 33, 36, 0.12);
  font-family: var(--editor-font), serif;
  line-height: 1.65;
}

.editor-page::before {
  pointer-events: none;
}

.editor-page[data-style="modern"] {
  border-top: 0;
  border-left: 12px solid var(--editor-accent);
}

.editor-page[data-style="minimal"] {
  border: 0;
}

.editor-page[data-style="mint"] {
  border: 0;
}

.editor-page[data-style="sky"] {
  border: 0;
  background: var(--editor-tint);
}

.editor-page[data-style="executive"] {
  border-top: 0;
  border-left: 38px solid var(--editor-accent);
}

.editor-page[data-style="letterhead"] {
  border-top: 24px solid var(--editor-accent);
}

.editor-page[data-style="serif"] {
  border: 0;
  background: var(--editor-tint);
}

.editor-page[data-style="geometric"],
.editor-page[data-style="corner"] {
  position: relative;
  overflow: hidden;
  border: 0;
}

.editor-page[data-style="geometric"]::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -42px;
  width: 270px;
  height: 230px;
  transform: rotate(45deg);
  background:
    linear-gradient(var(--editor-accent) 0 0) 0 0 / 88px 88px no-repeat,
    linear-gradient(#f0c84a 0 0) 96px 0 / 88px 88px no-repeat,
    linear-gradient(var(--editor-tint) 0 0) 0 96px / 88px 88px no-repeat,
    linear-gradient(var(--editor-accent) 0 0) 96px 96px / 88px 88px no-repeat;
}

.editor-page[data-style="corner"]::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 190px;
  height: 190px;
  background:
    linear-gradient(90deg, #f0f0f0 50%, #d8d8d8 50%) 0 0 / 94px 94px,
    linear-gradient(90deg, #e8e8e8 50%, var(--editor-tint) 50%) 47px 47px / 94px 94px;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.editor-title {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  margin: 0 0 30px;
  border: 0;
  border-bottom: 1px solid var(--editor-accent);
  border-radius: 0;
  padding: 0 0 15px;
  outline: 0;
  color: var(--editor-accent);
  background: transparent;
  font-family: inherit;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.editor-page[data-style="modern"] .editor-title {
  border-bottom: 0;
}

.editor-page[data-style="minimal"] .editor-title {
  border-bottom-color: var(--line);
  color: #292929;
  font-size: 1.4rem;
}

.editor-page[data-style="mint"] .editor-title {
  border-top: 6px solid var(--editor-accent);
  border-bottom: 0;
  padding-top: 28px;
  color: #292929;
}

.editor-page[data-style="sky"] .editor-title {
  max-width: 540px;
  border: 0;
  color: #202124;
  font-size: clamp(2.5rem, 6vw, 4.25rem);
  line-height: 1.02;
}

.editor-page[data-style="executive"] .editor-title {
  border-bottom: 3px solid var(--editor-accent);
  text-transform: uppercase;
}

.editor-page[data-style="letterhead"] .editor-title {
  border: 0;
  padding: 18px 22px;
  color: #fff;
  background: var(--editor-accent);
}

.editor-page[data-style="serif"] .editor-title {
  max-width: 100%;
  border: 0;
  color: #202124;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 6vw, 4.5rem);
  line-height: 1.02;
}

.editor-page[data-style="geometric"] .editor-title {
  max-width: 72%;
  margin-top: 190px;
  border-bottom: 2px solid var(--editor-accent);
  color: #202124;
  font-size: clamp(2.4rem, 5vw, 3.8rem);
}

.editor-page[data-style="corner"] .editor-title {
  max-width: 68%;
  margin-top: 12px;
  border: 0;
  color: var(--editor-accent);
  font-size: clamp(2rem, 4vw, 3rem);
}

.editor-body {
  position: relative;
  z-index: 1;
  min-height: 650px;
  outline: 0;
}

.editor-body p {
  margin: 0 0 17px;
}

.editor-page:not(.is-finished) .editor-body:focus,
.editor-page:not(.is-finished) .editor-title:focus {
  box-shadow: 0 0 0 3px rgba(31, 111, 104, 0.12);
}

.editor-page.is-finished {
  box-shadow: 0 0 0 3px var(--editor-accent), 0 10px 30px rgba(32, 33, 36, 0.12);
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 24px;
  border-top: 1px solid var(--line);
}

.editor-footer p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.editor-actions {
  display: flex;
  gap: 10px;
}

.lead-panel {
  position: relative;
  width: min(480px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lead-panel h2 {
  margin: 0;
  font-size: clamp(1.55rem, 4vw, 2rem);
}

.modal-copy {
  margin: 10px 0 20px;
  color: var(--muted);
  line-height: 1.55;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
}

.lead-form {
  display: grid;
  gap: 14px;
}

.honeypot {
  display: none;
}

.lead-form .button {
  width: 100%;
  margin-top: 2px;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--rose);
  font-size: 0.88rem;
  font-weight: 700;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(420px, 1.3fr) auto;
  gap: 28px;
  align-items: start;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 28px 0 36px;
  color: var(--muted);
}

.footer-brand {
  width: fit-content;
  color: var(--ink);
}

.site-footer p {
  max-width: 560px;
  margin: 12px 0 0;
  line-height: 1.55;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: flex-end;
  font-weight: 760;
}

.footer-articles {
  min-width: 0;
}

.footer-heading {
  display: block;
  margin-bottom: 12px;
  color: var(--ink);
  font-size: 0.82rem;
  text-transform: uppercase;
}

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

.footer-article-grid a {
  font-size: 0.82rem;
  line-height: 1.35;
}

.footer-article-grid a:hover,
.footer-all-articles:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-all-articles {
  display: inline-flex;
  margin-top: 13px;
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 760;
}

.footer-links a:hover {
  color: var(--accent-dark);
}

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

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

.partner-card,
.blog-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: var(--surface);
}

.blog-card {
  display: flex;
  min-height: 290px;
  flex-direction: column;
  align-items: flex-start;
}

.partner-card h3,
.blog-card h3 {
  margin: 0 0 8px;
}

.partner-card p,
.blog-card p {
  color: var(--muted);
  line-height: 1.55;
}

.blog-card .article-link {
  min-height: 40px;
  margin-top: auto;
  padding: 8px 13px;
  font-size: 0.86rem;
}

@media (max-width: 940px) {
  .hero,
  .toolbar,
  .detail-shell,
  .seo-intent {
    grid-template-columns: 1fr;
  }

  .site-footer {
    grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  }

  .footer-links {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .hero {
    min-height: auto;
  }

  .hero-copy h1 {
    max-width: 620px;
    font-size: clamp(2.3rem, 8vw, 3.8rem);
  }

  .hero-visual {
    min-height: 420px;
  }

  .filter-grid,
  .template-grid,
  .template-directory,
  .seo-copy-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
    gap: 8px 16px;
    justify-content: flex-start;
  }

  .hero-copy h1 {
    font-size: clamp(2rem, 10vw, 3rem);
    line-height: 1.02;
  }

  .hero-visual {
    min-height: 330px;
  }

  .paper-main {
    inset: 8px 0 10px 32px;
  }

  .paper-back {
    inset: 58px 52px 68px 0;
  }

  .paper {
    padding: 30px 24px;
  }

  .filter-grid,
  .template-grid,
  .template-directory,
  .keyword-grid,
  .seo-copy-grid,
  .related-link-grid,
  .partner-list,
  .blog-grid,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .keyword-summary {
    grid-template-columns: 1fr;
  }

  .format-guide-section {
    grid-template-columns: 1fr;
  }

  .format-guide-section h2 {
    grid-row: auto;
  }

  .footer-links {
    grid-column: auto;
    justify-content: flex-start;
  }

  .footer-article-grid {
    grid-template-columns: 1fr;
  }

  .nav-dropdown {
    position: static;
  }

  .nav-menu {
    left: 16px;
    right: 16px;
    min-width: 0;
  }

  .results-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .letter-preview {
    min-height: 420px;
  }

  .editor-modal {
    padding: 0;
  }

  .editor-shell {
    height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .editor-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px;
  }

  .editor-layouts {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .style-option {
    flex: 0 0 76px;
  }

  .editor-canvas-wrap {
    padding: 16px 10px;
  }

  .editor-page {
    min-height: 760px;
    padding: 38px 24px;
  }

  .editor-footer {
    padding: 12px 16px;
  }
}

/* ---------- School requirements pages ---------- */
.article-shell {
  display: flex;
  flex-direction: column;
  gap: 36px;
  max-width: 920px;
  margin: 0 auto 56px;
  padding: 0 20px;
}

.requirements-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.requirements-table th,
.requirements-table td {
  text-align: left;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 0.96rem;
}

.requirements-table tr:last-child th,
.requirements-table tr:last-child td {
  border-bottom: none;
}

.requirements-table th {
  width: 38%;
  color: var(--muted);
  font-weight: 600;
  background: rgba(31, 111, 104, 0.05);
}

.table-note {
  font-size: 0.88rem;
  color: var(--muted);
  margin-top: 10px;
}

.mistake-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.mistake-list li {
  position: relative;
  padding: 12px 16px 12px 38px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--rose);
  border-radius: 10px;
  font-size: 0.96rem;
}

.mistake-list li::before {
  content: "✕";
  position: absolute;
  left: 14px;
  top: 12px;
  color: var(--rose);
  font-weight: 700;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.chip:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
