/* ===========================================================
   textfilegenerator.com - design system v2
   Editorial-modern SaaS look: wide, spacious, flat surfaces,
   one accent color, monospace headings, subtle depth via
   soft shadows instead of heavy borders everywhere.
   =========================================================== */

:root {
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface-tint: #F4F5FA;
  --ink: #16181D;
  --ink-muted: #565A66;
  --ink-soft: #6E7280; /* passes WCAG AA (4.5:1) on --bg for small text */
  --accent: #2F54EB;
  --accent-dark: #1E3FC4;
  --accent-tint: #EEF1FE;
  --border: #E4E4E7;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(22, 24, 29, 0.05);
  --shadow-md: 0 8px 24px rgba(22, 24, 29, 0.07);
  --shadow-lg: 0 20px 48px rgba(22, 24, 29, 0.10);
  --font-head: 'IBM Plex Mono', 'Courier New', monospace;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --wrap: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.6em;
  color: var(--ink);
}

/* Fluid all the way down to 320px, not just flat below ~845px */
h1 { font-size: clamp(1.35rem, 1rem + 1.6vw, 2.15rem); }
h2 { font-size: clamp(1.2rem, 1rem + 0.85vw, 1.65rem); }
h3 { font-size: 1.05rem; }

p {
  margin: 0 0 1em;
  color: var(--ink);
}

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

a:hover {
  text-decoration: underline;
}

ul, ol {
  margin: 0;
  padding: 0;
}

img {
  max-width: 100%;
  display: block;
}

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 32px;
}

/* Focus states */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== Eyebrow (replaces the old per-section gutter numbers) ===== */

.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

.section-head {
  max-width: 720px;
  margin: 0 auto 40px;
  text-align: center;
}

.section-head p {
  color: var(--ink-muted);
  font-size: 0.94rem;
  margin: 0;
}

/* ===== Header ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 250, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.logo__icon {
  width: 30px;
  height: 3ch;
  flex-shrink: 0;
}

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

.site-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.site-nav a {
  color: var(--ink);
  font-weight: 500;
  font-size: 0.95rem;
  position: relative;
}

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

/* ---- Mobile nav toggle (hidden on desktop, shown under 700px) ---- */

.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle__bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== Sections ===== */

section {
  padding: 88px 0;
}

section.tinted {
  background: var(--surface-tint);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ===== Hero ===== */

.hero {
  padding: 24px 0 72px;
  text-align: center;
}

.hero h1 {
  max-width: 900px;
  margin: 0 auto 14px;
}

.hero__lede {
  max-width: 640px;
  margin: 0 auto;
  color: var(--ink-muted);
  font-size: 0.96rem;
}

/* ===== Tool ===== */

.tool {
  margin: 40px auto 0;
  max-width: 960px;
  text-align: left;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.tool__editor {
  position: relative;
  display: flex;
  height: 380px;
}

.tool__paste-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none; /* let clicks reach the textarea underneath except on the buttons themselves */
}

.tool__paste-overlay.is-hidden {
  display: none;
}

.tool__paste-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.tool__paste-btn {
  pointer-events: auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 32px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--accent);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.tool__paste-btn:hover {
  border-color: var(--accent);
  background: var(--accent-tint);
}

.tool__paste-hint {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* ---- Loading overlay (shown while a chosen file is being read/applied,
   so the tab never looks frozen on a big file) ---- */

.tool__loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(250, 250, 250, 0.9);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
}

.tool__loading-overlay.is-hidden {
  display: none;
}

.tool__spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: tool-spin 0.7s linear infinite;
}

@keyframes tool-spin {
  to {
    transform: rotate(360deg);
  }
}

.tool__gutter {
  flex: 0 0 auto;
  width: 48px;
  padding: 18px 10px;
  text-align: right;
  font-family: var(--font-head);
  font-size: 0.85rem;
  line-height: 1.6;
  color: #B3B6C0;
  background: var(--surface-tint);
  border-right: 1px solid var(--border);
  overflow: hidden;
  white-space: pre;
  user-select: none;
}

.tool__textarea {
  flex: 1 1 auto;
  border: none;
  resize: none;
  padding: 18px 20px;
  font-family: var(--font-head);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  width: 100%;
}

.tool__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-tint);
  font-family: var(--font-head);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.save-status {
  opacity: 0;
  color: var(--accent);
  font-weight: 600;
  transition: opacity 0.2s ease;
}

.save-status.is-visible {
  opacity: 1;
}

.tool__controls {
  padding: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.tool__filename-label {
  font-family: var(--font-head);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.tool__filename {
  flex: 1 1 340px;
  min-width: 240px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--surface);
  transition: border-color 0.15s ease;
}

.tool__filename:focus-visible {
  border-color: var(--accent);
}

.tool__buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
}

/* ---- Text Tools dropdown ---- */

.tool__menu-wrap {
  position: relative;
}

.tool__menu {
  /* position: fixed (not absolute) on purpose - .tool has overflow:hidden
     to clip its own rounded corners, which would also clip an absolutely
     positioned dropdown any time it opened near the card's edge. Fixed
     positioning escapes that clipping entirely; top/left are set inline by
     JS (positionTextToolsMenu in tool.js) right before it's shown. */
  position: fixed;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  min-width: 220px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

/* The [hidden] attribute normally sets display:none via the browser's own
   stylesheet, but our own "display: flex" above has equal specificity and
   author styles always beat the browser default - so without this rule,
   the dropdown stays visually open no matter what JS sets .hidden to. */
.tool__menu[hidden] {
  display: none;
}

.tool__menu-label {
  padding: 8px 10px 4px;
  font-family: var(--font-head);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.tool__menu-item {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
}

.tool__menu-item:hover {
  background: var(--accent-tint);
  color: var(--accent);
}

/* ---- Find & Replace ---- */

.tool__find-replace {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Same fix as .tool__menu above - restore [hidden]'s default behavior. */
.tool__find-replace[hidden] {
  display: none;
}

.tool__find-replace .tool__filename {
  flex: 1 1 180px;
  min-width: 140px;
}

.tool__find-status {
  font-family: var(--font-head);
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* ---- Desktop sidebar (Text Tools + Find & Replace, always visible - no
   dropdown/toggle needed once there's room for a permanent column) ---- */

.tool__sidebar {
  display: none; /* shown at the >=1024px breakpoint below */
}

.tool__sidebar-section + .tool__sidebar-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.tool__sidebar-heading {
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.tool__sidebar-group + .tool__sidebar-group {
  margin-top: 6px;
}

.tool__sidebar-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tool__sidebar-group .tool__menu-label {
  flex: 1 0 100%;
  padding-left: 0;
}

.tool__sidebar-group .tool__menu-item {
  display: block;
  width: auto;
  flex: 0 0 auto;
  white-space: nowrap;
  padding: 7px 10px;
  border: 1px solid var(--border);
  font-size: 0.84rem;
}

.tool__sidebar-group .tool__menu-item:hover {
  border-color: var(--accent);
}

.tool__sidebar-input {
  display: block;
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-head);
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--ink);
}

.tool__sidebar-btn {
  width: 100%;
}

/* ===== Buttons ===== */

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.94rem;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(47, 84, 235, 0.28);
}

.btn--primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  text-decoration: none;
}

.btn--outline {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

.btn--outline.is-confirmed {
  border-color: var(--accent);
  color: var(--accent);
}

.btn--lg {
  padding: 14px 28px;
  font-size: 1rem;
}

/* ===== How it works ===== */

.steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.steps__item {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.steps__item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.steps__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-tint);
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.how__figure {
  max-width: 900px;
  margin: 40px auto 0;
}

.how__figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

.how__figure figcaption {
  margin-top: 12px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

/* ===== Why / benefits ===== */

.benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.benefit {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 26px 22px;
  background: var(--surface);
  transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.benefit:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--accent);
}

.benefit__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-tint);
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--accent);
  font-size: 1.05rem;
  margin-bottom: 16px;
}

.benefit h3 {
  margin-bottom: 6px;
}

.benefit p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.96rem;
}

/* ===== About copy ===== */

.about-copy {
  max-width: 940px;
  margin: 0 auto;
  text-align: center;
}

.about-copy p {
  color: var(--ink-muted);
  text-align: left;
  max-width: 68ch;
  margin-left: auto;
  margin-right: auto;
}

.about-copy strong {
  color: var(--ink);
}

/* ===== FAQ / accordion ===== */

.faq-wrap {
  max-width: 860px;
  margin: 0 auto;
}

.accordion__item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  margin-bottom: 12px;
  overflow: hidden;
}

.accordion__heading {
  margin: 0;
}

.accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
}

.accordion__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-tint);
  font-family: var(--font-head);
  color: var(--accent);
  font-size: 1.05rem;
  line-height: 1;
  transition: transform 0.15s ease;
}

.accordion__trigger[aria-expanded="true"] .accordion__icon {
  transform: rotate(45deg);
}

.accordion__panel {
  padding: 0 22px 20px;
}

.accordion__panel p {
  color: var(--ink-muted);
  margin: 0;
}

/* ===== CTA band ===== */

.cta-band {
  text-align: center;
  padding: 72px 0;
}

.cta-band__inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 40px;
  border-radius: var(--radius-lg);
  background: var(--ink);
  color: #fff;
}

.cta-band__inner h2 {
  color: #fff;
  margin-bottom: 12px;
}

.cta-band__inner p {
  color: #C7C9D4;
  margin-bottom: 28px;
}

/* ===== Footer ===== */

.site-footer {
  border-top: 1px solid var(--border);
  padding-top: 56px;
  background: var(--surface-tint);
}

/* Extra specificity so padding-bottom survives the shared .wrap padding
   rule at mobile widths (this element carries both classes) */
.site-footer .site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 32px;
}

.site-footer__brand p {
  color: var(--ink-muted);
  font-size: 0.9rem;
  max-width: 32ch;
  margin: 10px 0 0;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 28px;
  align-content: flex-start;
}

.site-footer__links a {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 500;
}

.site-footer__links a:hover {
  color: var(--accent);
}

/* Extra specificity so this always wins over the shared .wrap padding rule
   (this element carries both classes: <div class="wrap site-footer__legal">) */
.site-footer .site-footer__legal {
  border-top: 1px solid var(--border);
  padding: 18px 32px;
}

.site-footer__legal p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

/* ===== Static content pages (about/privacy/terms/contact) ===== */

.page-hero {
  text-align: center;
  padding: 52px 0 40px;
}

.page-hero h1 {
  margin-bottom: 10px;
}

.page-hero__lede {
  max-width: 620px;
  margin: 0 auto;
  color: var(--ink-muted);
  font-size: 0.96rem;
}

.page-content {
  padding: 8px 0 80px;
}

.page-content__inner {
  max-width: 900px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 64px;
  box-shadow: var(--shadow-sm);
}

.page-content h2 {
  margin-top: 1.6em;
}

.page-content h2:first-child {
  margin-top: 0;
}

.page-content p,
.page-content li {
  color: var(--ink-muted);
  max-width: 68ch;
}

.page-content ul,
.page-content ol {
  margin: 0 0 1em 1.2em;
}

.page-content li {
  margin-bottom: 0.4em;
}

.page-meta {
  font-family: var(--font-head);
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-bottom: 1.5em;
}

.contact-info {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  background: var(--surface-tint);
}

.contact-info dt {
  font-family: var(--font-head);
  font-size: 0.78rem;
  color: var(--ink-muted);
  margin-top: 12px;
}

.contact-info dt:first-child {
  margin-top: 0;
}

.contact-info dd {
  margin: 2px 0 0;
  font-size: 0.98rem;
}

.cta-box {
  margin-top: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  background: var(--accent-tint);
  text-align: center;
}

.cta-box h3 {
  margin-bottom: 8px;
}

.cta-box p {
  margin-bottom: 18px;
  color: var(--ink-muted);
}

.contact-note {
  margin-top: 24px;
  color: var(--ink-muted);
}

/* ===== 404 page ===== */

.error-page__body {
  text-align: center;
}

.error-page__body .cta-box {
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.error-page__links {
  margin-top: 24px;
  color: var(--ink-muted);
}

/* ===== Blog ===== */

.blog-list {
  list-style: none;
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.blog-list__item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.blog-list__item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.blog-list__date {
  display: block;
  font-family: var(--font-head);
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 8px;
}

.blog-list__item h2 {
  font-size: 1.35rem;
  margin-bottom: 10px;
}

.blog-list__item h2 a {
  color: var(--ink);
}

.blog-list__item h2 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.blog-list__excerpt {
  color: var(--ink-muted);
  margin-bottom: 10px;
  flex: 1 1 auto;
}

.blog-post .page-meta {
  margin-bottom: 0.5em;
}

.blog-post h2 {
  margin-top: 1.6em;
}

.blog-post p,
.blog-post li {
  color: var(--ink-muted);
  max-width: 68ch;
}

.blog-post ul,
.blog-post ol {
  margin: 0 0 1em 1.2em;
}

.blog-post code {
  font-family: var(--font-head);
  font-size: 0.88em;
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  color: var(--ink);
}

.blog-post pre {
  background: var(--surface-tint);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0 0 1.2em;
}

.blog-post pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.6;
}

.blog-post table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.3em;
  font-size: 0.94rem;
  display: block;
  overflow-x: auto;
}

.blog-post th,
.blog-post td {
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--border);
}

.blog-post th {
  font-family: var(--font-head);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  background: var(--surface-tint);
}

/* ===== Responsive ===== */

@media (max-width: 900px) {
  .steps {
    grid-template-columns: 1fr;
  }

  .benefits {
    grid-template-columns: repeat(2, 1fr);
  }

  .blog-list {
    grid-template-columns: 1fr;
  }

  .page-content__inner {
    padding: 36px 28px;
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: flex;
  }

  .site-header__inner {
    position: relative;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transition: max-height 0.25s ease;
  }

  .site-nav.is-open {
    max-height: 220px;
  }

  .site-nav a {
    padding: 14px 20px;
    border-top: 1px solid var(--border);
  }

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

  .tool__editor {
    height: 320px;
  }

  .tool__gutter {
    width: 34px;
    font-size: 0.78rem;
  }

  .tool__textarea {
    font-size: 0.82rem;
  }

  .tool__controls {
    flex-direction: column;
    align-items: stretch;
  }

  /* .tool__filename's "flex: 1 1 340px" is a row-layout width hint - once
     .tool__controls switches to a column above, that same flex-basis
     applies to the column's main axis (height) instead, making the input
     340px tall. Reset it back to a normal auto-height block field. */
  .tool__filename {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
  }

  .tool__menu {
    left: 16px !important;
    right: 16px;
    min-width: 0;
    width: auto;
  }

  .blog-list__item {
    padding: 22px 20px;
  }

  section {
    padding: 56px 0;
  }

  .hero {
    padding: 72px 0 48px;
  }

  .tool {
    margin-top: 20px;
  }

  .cta-band__inner {
    padding: 36px 24px;
  }

  .page-content__inner {
    padding: 28px 20px;
  }

  .wrap {
    padding: 0 20px;
  }
}

/* ---- Desktop: swap the mobile dropdown/toggle controls for an always-
   visible sidebar, so using a Text Tool or Find & Replace doesn't need any
   scrolling or extra clicks to open first. ---- */

@media (min-width: 1024px) {
  .tool {
    display: flex;
    align-items: stretch;
    max-width: 1140px;
  }

  .tool__main {
    flex: 1 1 auto;
    min-width: 0;
  }

  .tool__mobile-only {
    display: none;
  }

  .tool__sidebar {
    display: flex;
    flex-direction: column;
    width: 280px;
    flex-shrink: 0;
    padding: 24px 22px;
    border-left: 1px solid var(--border);
    background: var(--surface-tint);
    overflow-y: auto;
  }
}
