/* ============================================
   PureTools - Core Stylesheet
   ============================================ */

/* Self-hosted fonts */
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fonts/geist-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fonts/geist-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fonts/geist-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fonts/geist-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('/fonts/geist-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/geist-mono-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/geist-mono-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/geist-mono-symbols.woff2') format('woff2');
  unicode-range: U+2000-2001, U+2004-2008, U+200A, U+23B8-23BD, U+2500-259F;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/geist-mono-vietnamese.woff2') format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/geist-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Geist Mono';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/geist-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/instrument-serif-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* CSS Variables */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --secondary: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --lime: #84cc16;
  --purple: #7c3aed;
  --purple-light: #a78bfa;

  --bg: #ffffff;
  --surface: #f8fafc;
  --border: #e2e8f0;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-muted-rgb: 100, 116, 139;

  --radius: 12px;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --on-primary: #ffffff;
  --on-primary-rgb: 255, 255, 255;
  --primary-rgb: 99, 102, 241;
  --primary-dark-rgb: 79, 70, 229;
  --secondary-rgb: 6, 182, 212;
  --success-rgb: 16, 185, 129;
  --warning-rgb: 245, 158, 11;
  --danger-rgb: 239, 68, 68;
  --lime-rgb: 132, 204, 22;
  --purple-rgb: 124, 58, 237;
  --shadow-color-rgb: 0, 0, 0;
  --strength-weak-bg: #fef2f2;
  --strength-weak-border: #fecaca;
  --strength-fair-bg: #fffbeb;
  --strength-fair-border: #fde68a;
  --strength-good-bg: #f0fdf4;
  --strength-good-border: #bbf7d0;
  --strength-strong-bg: #eff6ff;
  --strength-strong-border: #bfdbfe;
  --search-icon: #888888;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --surface: #1e293b;
  --border: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --text-muted-rgb: 148, 163, 184;
  --search-icon: var(--text-muted);
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[hidden] { display: none !important; }

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: var(--transition);
  min-height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo:hover {
  color: var(--primary-dark);
}

.logo-mark {
  width: 22px;
  height: 22px;
  display: block;
  object-fit: contain;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  transition: var(--transition);
}

.theme-toggle:hover {
  border-color: var(--primary);
  transform: scale(1.1);
}

/* ============================================
   LAYOUT
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  padding: 4rem 0 3rem;
  text-align: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: var(--on-primary);
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   TOOLS GRID
   ============================================ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

/* Tool Card */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.tool-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.tool-card h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.tool-card p {
  color: var(--text-muted);
  flex-grow: 1;
}

.tool-link {
  color: var(--primary);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
}

.tool-card:hover .tool-link {
  color: var(--primary-dark);
}

/* ============================================
   TOOL PAGE
   ============================================ */
.tool-page {
  padding: 3rem 0;
}

.tool-page h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.tool-description {
  color: var(--text-muted);
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

/* ============================================
   FORMS & INPUTS
   ============================================ */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.input-group label {
  font-weight: 600;
  color: var(--text);
}

.input-field {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  transition: var(--transition);
  font-family: inherit;
}

.input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

select.input-field {
  cursor: pointer;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.66rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-size: 0.94rem;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: var(--on-primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* ============================================
   RESULTS
   ============================================ */
.result-box {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: var(--on-primary);
  padding: 1.5rem;
  border-radius: var(--radius);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1rem;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  color: var(--text-muted);
  margin-top: auto;
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ============================================
   SEARCH BAR - Large & Centered
   ============================================ */

.search-wrapper {
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.4rem;
  color: var(--search-icon);
  pointer-events: none;
  z-index: 2;
}

.search-box input {
  width: 100%;
  padding: 20px 22px 20px 62px;
  font-size: 1.15rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
  transform: scale(1.02);
}

/* Dark mode support */
[data-theme="dark"] .search-box input {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

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

  .tool-page h1 {
    font-size: 1.75rem;
  }

  .header-content {
    padding: 0 1rem;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


@keyframes tool-status-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Shared tool status messages ──────────────────────────────────────── */
.tool-status {
  padding: 0.65rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.875rem;
  line-height: 1.45;
  animation: tool-status-in 0.2s ease;
}
.tool-status-error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.25);
}
.tool-status-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.25);
}
.tool-status-info {
  background: rgba(var(--primary-rgb), 0.08);
  color: var(--primary);
  border-color: rgba(var(--primary-rgb), 0.2);
}
.tool-status-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.25);
}

/* ============================================
   SHARED — FAQ, RELATED TOOLS, BACK BUTTON,
   BREADCRUMB, PROSE PAGES
   ============================================ */

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}

.breadcrumb a:hover { text-decoration: underline; }

/* FAQ section */
.tool-faq {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.tool-faq h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

/* ── Homepage FAQ section ─────────────────────────────────────────── */
.home-faq-section {
  padding: 4rem 0;
  margin-top: 3rem;
}

.home-faq-section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  margin-bottom: 2rem;
}

.home-faq-grid {
  display: grid;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .home-faq-grid {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

/* ─────────────────────────────────────────────────────────────────── */

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  overflow: hidden;
  transition: var(--transition);
}

.faq-item summary {
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  user-select: none;
}

.faq-item summary::-webkit-details-marker { display: none; }

.faq-item summary::after {
  content: '+';
  font-size: 1.25rem;
  color: var(--primary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq-item[open] summary::after { content: '−'; }
.faq-item[open] { border-color: var(--primary); }

.faq-item p {
  padding: 0 1.25rem 1rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}

/* Related tools */
.related-tools {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.related-tools h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.related-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  font-size: 0.9rem;
}

.related-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.related-card span:first-child {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.related-card strong {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.related-card span:last-child {
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 860px) {
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .related-tools {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
  }

  .related-tools h2 {
    font-size: 1.25rem;
  }

  .related-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .related-card {
    min-height: 76px;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 0.875rem;
    border-radius: calc(var(--radius) - 2px);
  }

  .related-card:hover {
    transform: none;
  }

  .related-card span:first-child {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: calc(var(--radius) - 4px);
    background: rgba(var(--primary-rgb), 0.08);
    font-size: 1.25rem;
  }

  .related-card div {
    min-width: 0;
  }

  .related-card strong,
  .related-card span:last-child {
    overflow-wrap: anywhere;
  }
}

/* Back to all tools button */
.back-to-tools {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.66rem 1.08rem;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--primary);
  border: 2px solid var(--primary);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.back-btn:hover {
  background: var(--primary);
  color: var(--on-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

/* Tool info sections (SEO content) */
.tool-info {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.tool-info h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.tool-info h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
  color: var(--text);
}

.tool-info p {
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.7;
}

.tool-info ol,
.tool-info ul {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.tool-info li {
  padding: 0.35rem 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.tool-info p strong,
.tool-info li strong,
.tool-faq p strong,
.faq-item p strong {
  color: var(--primary);
  font-weight: 700;
}

.tool-info a {
  color: var(--primary);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}

.tool-info a:hover {
  color: var(--primary-dark);
}

/* Prose pages: About, Privacy Policy */
.prose-page {
  padding: 2rem 0 4rem;
  max-width: 760px;
}

.prose-page h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.prose-page .meta {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 2rem;
}

.prose-page .lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.prose-page h2 {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}

.prose-page p {
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 1rem;
}

.prose-page ul,
.prose-page ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.prose-page li {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 0.4rem;
}

.prose-page a {
  color: var(--primary);
  text-decoration: none;
}

.prose-page a:hover { text-decoration: underline; }

.prose-page code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  font-size: 0.875rem;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  color: var(--primary);
}

.static-back {
  margin-top: 3rem;
}

.footer-links {
  margin-top: 0.5rem;
}

/* btn-sm variant */
.btn-sm {
  padding: 0.4rem 0.9rem;
  font-size: 0.875rem;
}

/* Fade-up animation (shared) */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Share title button ─────────────────────────────────────────────────────── */
.tool-title-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.tool-title-row h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  line-height: 1.2;
}
.share-title-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.share-title-btn:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.06);
}
.share-title-btn svg {
  flex-shrink: 0;
}

/* ============================================
   Premium global layer
   ============================================ */

:root {
  --bg: #f6f7ff;
  --surface: #ffffff;
  --surface-2: #eef1ff;
  --border: rgba(99, 102, 241, 0.18);
  --border-soft: rgba(99, 102, 241, 0.08);
  --text: #171a35;
  --text-muted: #5a628c;
  --text-muted-rgb: 90, 98, 140;
  --shadow: 0 10px 30px rgba(var(--shadow-color-rgb), 0.08);
  --shadow-lg: 0 24px 60px rgba(var(--shadow-color-rgb), 0.12);
  --header-bg: rgba(246, 247, 255, 0.82);
  --card-glow: rgba(var(--primary-rgb), 0.12);
  --transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

[data-theme="dark"] {
  --bg: #0b0d14;
  --surface: #13162a;
  --surface-2: #1a1e38;
  --border: rgba(99, 102, 241, 0.22);
  --border-soft: rgba(99, 102, 241, 0.08);
  --text: #e8eaf6;
  --text-muted: #99a1c7;
  --text-muted-rgb: 153, 161, 199;
  --header-bg: rgba(11, 13, 20, 0.82);
  --card-glow: rgba(var(--primary-rgb), 0.2);
  --shadow-color-rgb: 0, 0, 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 48px 48px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

.site-header {
  background: var(--bg);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-bottom: 1px solid var(--border);
  padding: 0;
}

.header-content {
  min-height: 68px;
  gap: 1rem;
}

.logo {
  color: var(--text);
  font-size: 1.35rem;
  font-weight: 800;
}

.logo-mark {
  filter: drop-shadow(0 0 14px rgba(var(--primary-rgb), 0.35));
}

.logo:hover {
  color: var(--primary);
}

.theme-toggle {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
}

.theme-icon {
  display: block;
  width: 14px;
  height: 14px;
}

.theme-icon-sun {
  display: none;
}

[data-theme="dark"] .theme-icon-sun {
  display: block;
}

[data-theme="dark"] .theme-icon-moon {
  display: none;
}

.theme-toggle:hover {
  background: var(--surface);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.container {
  position: relative;
  z-index: 1;
}

.hero {
  position: relative;
  overflow: hidden;
  background: transparent;
  color: var(--text);
}

.hero h1 {
  color: var(--text);
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tool-page {
  padding: 3rem 0 4rem;
}

.tool-title-row {
  align-items: flex-start;
}

.tool-page h1,
.prose-page h1 {
  font-weight: 800;
  line-height: 1.1;
}

.tool-description,
.prose-page .lead,
.prose-page .meta {
  color: var(--text-muted);
}

.breadcrumb {
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--primary);
}

.btn,
.back-btn,
.share-title-btn,
.input-field,
.related-card,
.faq-item {
  border-radius: var(--radius);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 10px 28px rgba(var(--primary-rgb), 0.22);
}

.btn-primary:hover {
  box-shadow: 0 14px 34px rgba(var(--primary-rgb), 0.28);
}

.btn-secondary,
.back-btn,
.share-title-btn,
.input-field,
.search-box input {
  background: var(--surface);
  border-color: var(--border);
}

.btn-secondary:hover,
.back-btn:hover,
.share-title-btn:hover,
.input-field:focus,
.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.12);
}

.tool-info,
.tool-faq,
.related-tools,
.back-to-tools {
  border-top-color: var(--border);
}

.back-to-tools,
.static-back {
  border-top-color: transparent;
  padding-top: 0;
  justify-content: flex-start;
}

.back-btn {
  border-color: var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 0.62rem 1.02rem;
  font-size: 0.9rem;
}

.back-btn svg {
  flex-shrink: 0;
}

.back-btn:hover {
  border-color: rgba(var(--primary-rgb), 0.48);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: 0 14px 34px rgba(var(--primary-rgb), 0.18);
}

.faq-item,
.related-card,
.tool-card,
.prose-page code {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 1px 0 rgba(var(--on-primary-rgb), 0.03) inset;
}

.faq-item:hover,
.related-card:hover,
.tool-card:hover {
  border-color: rgba(var(--primary-rgb), 0.48);
  box-shadow: var(--shadow), 0 0 0 1px var(--card-glow);
}

.faq-item[open] {
  background: var(--surface);
  box-shadow: var(--shadow);
}

.site-footer {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border-top-color: var(--border);
  margin-top: 5rem;
  padding: 2rem 0;
  text-align: left;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
}

.footer-copy {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-top: 0;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.86rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary);
  text-decoration: none;
}

@media (max-width: 768px) {
  .header-content {
    min-height: 64px;
  }

  .logo {
    font-size: 1.2rem;
  }

  .theme-toggle {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 520px) {
  .header-content {
    padding: 0;
  }

  .tool-title-row {
    position: relative;
    display: block;
    margin-bottom: 0.9rem;
  }

  .tool-title-row h1 {
    width: 100%;
    padding-right: 3.1rem;
  }

  .tool-title-row .share-title-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    min-height: 40px;
    justify-content: center;
    gap: 0;
    padding: 0;
    font-size: 0;
    border-radius: 14px;
  }

  .tool-title-row .share-title-btn svg {
    width: 16px;
    height: 16px;
  }

  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .footer-links {
    gap: 1rem;
    flex-wrap: wrap;
  }
}

