/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Tokens ────────────────────────────────────────────────── */
:root {
  --primary:     #0f766e;
  --primary-lt:  #14b8a6;
  --primary-xlt: #f0fdfa;
  --primary-glow:rgba(15,118,110,.12);
  --accent:      #f59e0b;
  --bg:          #f8fafc;
  --surface:     #ffffff;
  --surface2:    #f1f5f9;
  --border:      #e2e8f0;
  --border-focus:#14b8a6;
  --text:        #0f172a;
  --text2:       #334155;
  --muted:       #64748b;
  --success:     #16a34a;
  --danger:      #dc2626;
  --chip-bg:     #ccfbf1;
  --chip-text:   #0f766e;
  --radius:      16px;
  --shadow-sm:   0 1px 3px rgba(15,118,110,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 4px 16px rgba(15,118,110,.09), 0 2px 6px rgba(0,0,0,.05);
  --shadow-lg:   0 8px 32px rgba(15,118,110,.13), 0 4px 12px rgba(0,0,0,.06);
}

/* ── Base ──────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

/* ── Top accent bar ────────────────────────────────────────── */
.top-bar {
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #0f766e, #14b8a6, #f59e0b);
  flex-shrink: 0;
}

/* ── Site header ───────────────────────────────────────────── */
.site-header {
  width: 100%;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo-link {
  display: flex;
  align-items: baseline;
  gap: 1px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.5px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.logo-link .tld { color: var(--primary); font-weight: 700; font-size: 17px; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 8px;
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: var(--primary-xlt);
  text-decoration: none;
}

/* ── Ad slots ──────────────────────────────────────────────── */
.ad-slot {
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .05em;
}
.ad-top  { margin: 16px auto 0; }
.ad-mid  { margin: 8px auto; }
.ad-bottom { margin: 0 auto 28px; }
body.ads-enabled .ad-slot { display: flex; }

/* ── Page wrapper ──────────────────────────────────────────── */
.page {
  flex: 1;
  width: 100%;
  max-width: 960px;
  padding: 48px 24px 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}
.page.wide { max-width: 1100px; }

/* ── Breadcrumb ────────────────────────────────────────────── */
.breadcrumb {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); text-decoration: none; }
.breadcrumb span { color: var(--text2); font-weight: 500; }
.bc-sep { color: var(--border); }

/* ── Tool hero ─────────────────────────────────────────────── */
.tool-hero {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tool-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .05em;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  width: fit-content;
}
.tool-hero h1 {
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.1;
  color: var(--text);
}
.tool-hero h1 em { font-style: normal; color: var(--primary); }
.tool-hero p {
  font-size: 16px;
  color: var(--text2);
  line-height: 1.65;
  max-width: 620px;
}

/* ── Tool card (the main interface) ───────────────────────── */
.tool-card {
  width: 100%;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: border-color .2s;
}
.tool-card:focus-within { border-color: var(--border-focus); }

.tool-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}
.tool-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text2);
}
.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all .15s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover { background: #0d6b63; border-color: #0d6b63; }
.btn-outline {
  background: var(--surface);
  color: var(--text2);
  border-color: var(--border);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-xlt);
}
.btn-sm { padding: 6px 14px; font-size: 12px; border-radius: 8px; }
.btn-success { color: var(--success) !important; border-color: rgba(22,163,74,.3) !important; background: rgba(22,163,74,.06) !important; }

/* Textareas */
.ta-wrap { position: relative; }
textarea, .output-area {
  width: 100%;
  min-height: 220px;
  padding: 18px 20px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--surface);
  border: none;
  outline: none;
  resize: vertical;
  caret-color: var(--primary);
}
textarea::placeholder { color: #cbd5e1; }
.output-area {
  min-height: 220px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text2);
  cursor: text;
  user-select: text;
}

.io-divider {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}
.io-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.output-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}

/* Options row */
.options-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.opt-btn {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  transition: all .15s;
}
.opt-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-xlt); }
.opt-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Char count badge */
.char-count {
  font-size: 12px;
  color: var(--muted);
}

/* ── Steps / How-to ────────────────────────────────────────── */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  width: 100%;
}
.step-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 22px 18px;
  box-shadow: var(--shadow-sm);
}
.step-num {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 14px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.step-card h3 { font-size: 14px; font-weight: 800; margin-bottom: 6px; }
.step-card p  { font-size: 13px; color: var(--muted); line-height: 1.55; }

/* ── Section heading ───────────────────────────────────────── */
.section-head {
  width: 100%;
}
.section-head h2 {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -.4px;
  color: var(--text);
  margin-bottom: 6px;
}
.section-head p {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.65;
}

/* ── Prose section ─────────────────────────────────────────── */
.prose {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 30px;
  box-shadow: var(--shadow-sm);
}
.prose h2 {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: -.3px;
  margin-bottom: 14px;
}
.prose p {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.75;
  margin-bottom: 13px;
}
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--text); }
.prose ul { padding-left: 20px; margin-bottom: 13px; }
.prose li { font-size: 15px; color: var(--text2); line-height: 1.75; margin-bottom: 4px; }

/* ── FAQ ───────────────────────────────────────────────────── */
.faq-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
details {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
details:hover { border-color: #a7f3d0; }
details[open] { border-color: var(--border-focus); box-shadow: var(--shadow-sm); }
summary {
  padding: 17px 20px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  color: var(--text);
}
summary:hover { color: var(--primary); }
summary::after { content: "+"; font-size: 20px; color: var(--muted); flex-shrink: 0; margin-left: 10px; }
details[open] summary::after { content: "−"; color: var(--primary); }
.ans { padding: 0 20px 18px; font-size: 14px; color: var(--text2); line-height: 1.7; }

/* ── More tools grid ───────────────────────────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}
.tool-tile {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .1s;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.tool-tile:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}
.tool-tile-icon { font-size: 28px; }
.tool-tile h3 { font-size: 14px; font-weight: 800; color: var(--text); }
.tool-tile p { font-size: 13px; color: var(--muted); line-height: 1.5; }
.tool-tile-arrow { font-size: 13px; color: var(--primary); margin-top: auto; font-weight: 700; }

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  width: 100%;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 28px 24px 36px;
  margin-top: auto;
}
.site-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  font-size: 13px;
}
.footer-links a { color: var(--muted); transition: color .15s; }
.footer-links a:hover { color: var(--primary); text-decoration: none; }
.footer-copy { font-size: 12px; color: #94a3b8; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 700px) {
  .site-nav .nav-link { display: none; }
  .site-nav .nav-link.home-link { display: flex; }
  .page { padding: 32px 16px 56px; gap: 26px; }
  .tool-hero h1 { font-size: 26px; }
  .steps-grid { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .prose { padding: 22px 18px; }
  .options-row { padding: 12px 16px; }
  textarea, .output-area { padding: 14px 16px; }
}
@media (max-width: 420px) {
  .tools-grid { grid-template-columns: 1fr; }
  .tool-hero h1 { font-size: 22px; }
}
