/* ==========================================================================
   AI Image Converter — shared stylesheet
   Lightweight, system-font, mobile-first. No external dependencies.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --brand: #0f766e;          /* teal-700 */
  --brand-strong: #115e59;   /* teal-800 */
  --brand-mid: #0d9488;      /* teal-600 */
  --brand-soft: #ccfbf1;     /* teal-100 */
  --brand-tint: #f0fdfa;     /* teal-50 */

  --ink: #0f172a;            /* slate-900 */
  --body: #334155;           /* slate-700 */
  --muted: #64748b;          /* slate-500 */
  --border: #e2e8f0;         /* slate-200 */

  --bg: #ffffff;
  --bg-alt: #f8fafc;         /* slate-50 */

  --ok: #15803d;             /* green-700 */
  --ok-soft: #f0fdf4;
  --err: #b91c1c;            /* red-700 */
  --err-soft: #fef2f2;
  --warn: #92400e;           /* amber-800 */
  --warn-soft: #fffbeb;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 2px 4px rgba(15, 23, 42, 0.04), 0 12px 32px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 4px 8px rgba(15, 23, 42, 0.05), 0 24px 56px rgba(15, 23, 42, 0.13);
  --shadow-brand: 0 2px 4px rgba(15, 23, 42, 0.06), 0 6px 18px rgba(15, 118, 110, 0.24);
  --container: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--body);
  background: var(--bg);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

main { flex: 1 0 auto; }

img, svg { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  color: var(--ink);
  line-height: 1.25;
  margin: 0 0 0.6em;
  font-weight: 700;
  overflow-wrap: break-word;
}

h1 { font-size: clamp(1.9rem, 4.5vw, 2.75rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); letter-spacing: -0.015em; }
h3 { font-size: clamp(1.12rem, 2vw, 1.3rem); }
h4 { font-size: 1.02rem; }

p { margin: 0 0 1em; }

a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--brand-strong); }

ul, ol { padding-left: 1.35em; }
li { margin-bottom: 0.4em; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1em 0.35em;
}

:focus-visible {
  outline: 2px solid var(--brand-mid);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--brand-soft); color: var(--ink); }

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

.skip-link {
  position: absolute; left: 0.75rem; top: -3rem;
  background: var(--ink); color: #fff;
  padding: 0.55rem 1rem; border-radius: 0 0 8px 8px;
  z-index: 100; text-decoration: none; transition: top 0.15s ease;
}
.skip-link:focus { top: 0; color: #fff; }

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

.section { padding: 3.25rem 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }

.section-head { max-width: 46rem; margin: 0 auto 2.25rem; text-align: center; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin-bottom: 0; }

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

@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .section { padding: 2.5rem 0; }
}

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 12px rgba(15, 23, 42, 0.04);
}

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 64px;
}

.brand {
  display: inline-flex; align-items: center; gap: 0.55rem;
  text-decoration: none; font-weight: 700; color: var(--ink);
  font-size: 1.05rem; letter-spacing: -0.01em;
}
.brand:hover { color: var(--brand-strong); }
.brand-mark { width: 30px; height: 30px; flex: 0 0 auto; }

@media (min-width: 1024px) {
  .brand-name { white-space: nowrap; }
}
@media (max-width: 1160px) and (min-width: 1024px) {
  .brand { font-size: 0.92rem; }
  .nav-list { gap: 0; }
}

.site-nav { display: block; }

.nav-list {
  display: flex; align-items: center; gap: 0.15rem;
  list-style: none; margin: 0; padding: 0;
}

.nav-list a {
  display: block; padding: 0.5rem 0.62rem;
  color: var(--body); text-decoration: none;
  font-size: 0.9rem; font-weight: 500; border-radius: 8px;
  white-space: nowrap;
}
.nav-list a:hover { color: var(--brand-strong); background: var(--brand-tint); }
.nav-list a[aria-current="page"] { color: var(--brand-strong); font-weight: 600; background: var(--brand-soft); }

.header-actions { display: flex; align-items: center; gap: 0.6rem; }

.nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 44px; height: 44px;
  background: none; border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; color: var(--ink);
}
.nav-toggle:hover { background: var(--bg-alt); }
.nav-toggle svg { width: 22px; height: 22px; }

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

  .site-nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }
  .site-nav.open { display: block; }

  .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding: 0.6rem 1rem 1rem; }
  .nav-list li + li { border-top: 1px solid var(--bg-alt); }
  .nav-list a { padding: 0.85rem 0.75rem; font-size: 1rem; border-radius: 10px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.72rem 1.35rem;
  font-family: var(--font); font-size: 0.97rem; font-weight: 600;
  line-height: 1.2; text-decoration: none; text-align: center;
  white-space: nowrap;
  border-radius: 10px; border: 1px solid transparent;
  cursor: pointer; transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
  -webkit-user-select: none; user-select: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-brand); }
.btn-primary:hover { background: var(--brand-strong); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 8px rgba(15, 23, 42, 0.06), 0 10px 26px rgba(15, 118, 110, 0.3); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary { background: #fff; color: var(--brand-strong); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn-secondary:hover { border-color: var(--brand-mid); background: var(--brand-tint); }

.btn-ghost { background: transparent; color: var(--brand-strong); }
.btn-ghost:hover { background: var(--brand-tint); }

.btn-sm { padding: 0.5rem 0.9rem; font-size: 0.88rem; }
.btn-lg { padding: 0.9rem 1.7rem; font-size: 1.03rem; }
.btn-block { width: 100%; }

@media (max-width: 420px) {
  .btn { white-space: normal; }
  .nav-cta { white-space: nowrap; padding: 0.45rem 0.7rem; font-size: 0.82rem; }
  .btn-row .btn { flex: 1 1 100%; }
  .btn-lg { padding: 0.85rem 1.2rem; }
}
@media (max-width: 359px) {
  .nav-cta { display: none; }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumb-wrap { border-bottom: 1px solid var(--border); background: var(--bg-alt); }
.breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem;
  list-style: none; margin: 0; padding: 0.65rem 0;
  font-size: 0.85rem; color: var(--muted);
}
.breadcrumb li { display: flex; align-items: center; gap: 0.35rem; margin: 0; }
.breadcrumb li + li::before { content: "/"; color: var(--border); margin-right: 0.35rem; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand-strong); text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--body); font-weight: 500; }

/* ---------- Hero ---------- */
.hero {
  padding: 3.5rem 0 3.25rem;
  text-align: center;
  background:
    radial-gradient(44rem 22rem at 50% -6rem, rgba(15, 118, 110, 0.09), transparent 70%),
    linear-gradient(180deg, #f7fdfc 0%, #ffffff 92%);
}
.hero-inner { display: grid; gap: 2.5rem; align-items: center; }
.hero-copy { max-width: 46rem; margin-inline: auto; }
.hero .btn-row,
.hero .trust-list { justify-content: center; }

@media (min-width: 1024px) {
  .hero { padding: 4.25rem 0 3.75rem; text-align: left; }
  .hero-inner { grid-template-columns: 1.06fr 0.94fr; gap: 3.5rem; }
  .hero-copy { margin-inline: 0; }
  .hero .lead { margin-inline: 0; }
  .hero .btn-row,
  .hero .trust-list { justify-content: flex-start; }
}

/* ---------- Hero conversion visual (decorative, CSS-only animation) ---------- */
.hero-visual { position: relative; display: flex; justify-content: center; min-width: 0; }
.flow-scene {
  position: relative;
  width: min(400px, 100%);
  padding: 1.9rem 1.6rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, #ffffff 0%, var(--brand-tint) 100%);
  border: 1px solid var(--brand-soft);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
@media (min-width: 1024px) {
  .flow-scene { transform: perspective(1100px) rotateX(5deg) rotateY(-5deg); }
}
.flow-glow {
  position: absolute; right: -3.25rem; bottom: -3.25rem;
  width: 14rem; height: 14rem; border-radius: 50%;
  background: radial-gradient(circle, rgba(20, 184, 166, 0.3), transparent 65%);
  animation: hv-glow 5.5s ease-in-out infinite;
  pointer-events: none;
}
.file-card {
  position: relative;
  display: flex; align-items: center; gap: 0.8rem;
  background: #fff; border: 1px solid var(--border);
  border-radius: 14px; padding: 0.8rem 0.95rem;
  box-shadow: var(--shadow-md);
}
.file-card--in { animation: hv-float 6s ease-in-out infinite; }
.file-card--out { animation: hv-float 7s ease-in-out 0.9s infinite; border-color: var(--brand-soft); }
.fc-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 10px; flex: 0 0 auto;
  background: var(--brand-tint); color: var(--brand-strong);
}
.file-card--out .fc-icon { background: var(--brand-soft); }
.fc-icon svg { width: 1.25rem; height: 1.25rem; }
.fc-name {
  display: block; font-weight: 600; color: var(--ink);
  font-size: 0.93rem; line-height: 1.3;
  overflow-wrap: anywhere; text-align: left;
}
.fc-sub {
  display: block; font-size: 0.78rem; color: var(--muted);
  text-align: left; line-height: 1.35;
}
.fc-ext {
  margin-left: auto; flex: 0 0 auto;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.07em;
  color: #fff; border-radius: 6px; padding: 0.28rem 0.5rem;
}
.fc-ext--in { background: #b45309; }   /* amber-700: source file */
.fc-ext--out { background: var(--brand); } /* teal-700: converted output */

.flow-connector {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  height: 3.3rem; margin: 0.3rem 0;
}
.flow-line {
  position: absolute; left: 50%; top: 0; bottom: 0;
  width: 2px; transform: translateX(-50%);
  background: repeating-linear-gradient(180deg, var(--brand-soft) 0 6px, transparent 6px 12px);
}
.flow-dot {
  position: absolute; left: 50%; top: 0;
  width: 8px; height: 8px; margin-left: -4px; border-radius: 50%;
  background: var(--brand-mid);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.18);
  animation: hv-travel 2.4s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
.flow-node {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.7rem; height: 2.7rem; border-radius: 50%;
  background: #fff; border: 1px solid var(--brand-soft);
  color: var(--brand-strong); box-shadow: var(--shadow-md);
}
.flow-node svg { width: 1.15rem; height: 1.15rem; animation: hv-spin 8s linear infinite; }

.status-chip {
  position: absolute; top: -0.75rem; right: 0.85rem;
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--ok); color: #fff;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em;
  padding: 0.26rem 0.62rem; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.32);
  animation: hv-chip 4.5s ease-in-out infinite;
}
.status-chip svg { width: 12px; height: 12px; }

@keyframes hv-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes hv-travel {
  0% { transform: translateY(0); opacity: 0; }
  12% { opacity: 1; }
  88% { opacity: 1; }
  100% { transform: translateY(calc(3.3rem - 8px)); opacity: 0; }
}
@keyframes hv-spin { to { transform: rotate(360deg); } }
@keyframes hv-glow { 0%, 100% { opacity: 0.55; } 50% { opacity: 0.95; } }
@keyframes hv-chip { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

.eyebrow {
  display: inline-block;
  background: var(--brand-tint); color: var(--brand-strong);
  border: 1px solid var(--brand-soft);
  box-shadow: var(--shadow-sm);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem; border-radius: 999px;
  margin-bottom: 1.1rem;
}

.hero .lead { font-size: clamp(1rem, 1.5vw, 1.15rem); color: var(--body); max-width: 42rem; margin-inline: auto; }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.trust-list {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem;
  list-style: none; margin: 1.5rem 0 0; padding: 0;
  font-size: 0.9rem; color: var(--muted); font-weight: 500;
}
.trust-list li { display: flex; align-items: center; gap: 0.4rem; margin: 0; }
.trust-list svg { width: 16px; height: 16px; color: var(--ok); flex: 0 0 auto; }

@media (max-width: 600px) {
  .hero { padding: 2.25rem 0 2rem; }
  .flow-scene { padding: 1.5rem 1.1rem; }
}

/* ---------- Converter CTA card (home) ---------- */
.cta-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-md);
  padding: 2.25rem 1.5rem; text-align: center;
  max-width: 46rem; margin-inline: auto;
}
.cta-card h2 { margin-bottom: 0.4rem; }
.cta-card p { color: var(--body); max-width: 34rem; margin: 0 auto 1.35rem; }
.cta-card .btn-row { justify-content: center; margin-top: 0; }
@media (max-width: 600px) { .cta-card { padding: 1.6rem 1.1rem; } }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.card:hover { border-color: var(--brand-mid); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card h3 { margin-bottom: 0.4rem; }
.card p { margin-bottom: 0; color: var(--body); font-size: 0.95rem; }
.card p + p { margin-top: 0.6em; }

.card-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--brand-tint); color: var(--brand-strong);
  margin-bottom: 0.9rem;
}
.card-icon svg { width: 22px; height: 22px; }

.card-link { display: inline-block; margin-top: 0.85rem; font-weight: 600; font-size: 0.92rem; }

/* ---------- Steps ---------- */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 1.25rem; }
.steps li {
  counter-increment: step;
  position: relative; padding-left: 3.6rem; margin: 0;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 2.6rem; height: 2.6rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand); color: #fff;
  border-radius: 999px; font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 0 0 4px var(--brand-tint), 0 2px 6px rgba(15, 118, 110, 0.22);
}
.steps h3 { margin-bottom: 0.25rem; }
.steps p { margin-bottom: 0; color: var(--body); font-size: 0.96rem; }

/* ---------- Data tables ---------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 560px; }
.data-table caption {
  text-align: left; font-weight: 600; color: var(--ink);
  padding: 0.9rem 1rem 0.4rem; caption-side: top; font-size: 0.95rem;
}
.data-table th, .data-table td {
  text-align: left; padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border); vertical-align: top;
}
.data-table thead th { background: var(--bg-alt); color: var(--ink); font-weight: 600; white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--bg-alt); }

/* ---------- Badges ---------- */
.badge {
  display: inline-block; padding: 0.22rem 0.65rem;
  border-radius: 999px; font-size: 0.76rem; font-weight: 600;
  letter-spacing: 0.02em; white-space: nowrap;
}
.badge-green { background: var(--ok-soft); color: var(--ok); border: 1px solid #bbf7d0; }
.badge-soft { background: var(--brand-tint); color: var(--brand-strong); border: 1px solid var(--brand-soft); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #fde68a; }

/* ---------- FAQ (details/summary) ---------- */
.faq-list { display: grid; gap: 0.75rem; max-width: 52rem; margin-inline: auto; }
.faq-item {
  background: #fff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden;
}
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.15rem; cursor: pointer;
  font-weight: 600; color: var(--ink); font-size: 0.99rem;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; flex: 0 0 auto;
  width: 9px; height: 9px; margin-right: 4px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform 0.15s ease;
}
.faq-item[open] summary::after { transform: rotate(225deg); }
.faq-item[open] summary { border-bottom: 1px solid var(--border); }
.faq-item .faq-a { padding: 0.4rem 1.15rem 1.1rem; }
.faq-item .faq-a p { margin-bottom: 0.6em; }
.faq-item .faq-a p:last-child { margin-bottom: 0; }

/* ---------- Alerts ---------- */
.alert {
  display: flex; gap: 0.7rem; align-items: flex-start;
  border-radius: var(--radius-sm); padding: 0.9rem 1.05rem;
  font-size: 0.94rem; border: 1px solid;
}
.alert svg { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 1px; }
.alert > div { min-width: 0; flex: 1 1 auto; }
.alert p { margin: 0; }
.alert p + p { margin-top: 0.5em; }
.alert strong { color: inherit; }

.alert-error { background: var(--err-soft); border-color: #fecaca; color: var(--err); }
.alert-success { background: var(--ok-soft); border-color: #bbf7d0; color: var(--ok); }
.alert-info { background: var(--brand-tint); border-color: var(--brand-soft); color: var(--brand-strong); }
.alert-warn { background: var(--warn-soft); border-color: #fde68a; color: var(--warn); }

/* ---------- Check list / icon list ---------- */
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.65rem; }
.check-list li { display: flex; gap: 0.6rem; align-items: flex-start; margin: 0; }
.check-list svg { width: 19px; height: 19px; color: var(--ok); flex: 0 0 auto; margin-top: 3px; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--brand-strong) 0%, var(--brand) 100%);
  color: #fff;
  border-radius: 16px; padding: 2.25rem 1.5rem; text-align: center;
  box-shadow: var(--shadow-lg);
}
.cta-band h2 { color: #fff; margin-bottom: 0.4rem; }
.cta-band p { color: #ccfbf1; max-width: 38rem; margin: 0 auto 1.4rem; }
.cta-band .btn { background: #fff; color: var(--brand-strong); box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18); }
.cta-band .btn:hover { background: var(--brand-soft); }

/* ---------- Prose (article / content areas) ---------- */
.prose { max-width: 46rem; margin-inline: auto; }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { margin-bottom: 1em; }

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  background: #0f172a; color: #cbd5e1;
  padding: 3rem 0 1.5rem;
  font-size: 0.92rem;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem; padding-bottom: 2rem;
  border-bottom: 1px solid #1e293b;
}
@media (max-width: 960px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; gap: 1.75rem; } }

.footer-brand .brand { color: #fff; margin-bottom: 0.75rem; }
.footer-brand p { color: #94a3b8; max-width: 20rem; margin-bottom: 0.9rem; }

.footer-heading {
  color: #fff; font-size: 0.85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  margin: 0 0 0.9rem;
}
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: 0.55rem; }
.footer-links a { color: #cbd5e1; text-decoration: none; }
.footer-links a:hover { color: #5eead4; text-decoration: underline; }

.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem;
  padding-top: 1.4rem; color: #94a3b8; font-size: 0.85rem;
}
.footer-bottom p { margin: 0; }
.footer-note { flex-basis: 100%; }

/* ---------- Converter tool ---------- */
.tool-card {
  background: #fff; border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-md);
  padding: 1.75rem; max-width: 46rem; margin-inline: auto;
}
@media (max-width: 600px) { .tool-card { padding: 1.15rem; border-radius: 14px; } }

.dropzone {
  border: 2px dashed #cbd5e1; border-radius: 14px;
  background: var(--bg-alt);
  padding: 2.75rem 1.25rem; text-align: center;
  cursor: pointer; transition: border-color 0.15s ease, background-color 0.15s ease;
}
.dropzone:hover, .dropzone.is-dragover {
  border-color: var(--brand-mid); background: var(--brand-tint);
}
.dropzone:focus-visible { outline: 2px solid var(--brand-mid); outline-offset: 2px; }

.dz-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 18px;
  background: var(--brand-soft); color: var(--brand-strong);
  margin-bottom: 1rem;
}
.dz-icon svg { width: 30px; height: 30px; }

.dz-title { font-weight: 700; color: var(--ink); font-size: 1.18rem; margin-bottom: 0.25rem; }
.dz-sub { font-size: 0.97rem; color: var(--body); margin: 0 0 1.1rem; }
.dz-sub .pick { color: var(--brand); text-decoration: underline; font-weight: 600; }
.dz-hint { font-size: 0.86rem; color: var(--muted); margin: 0.9rem 0 0; }

.fmt-chips {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 0.4rem; max-width: 24rem; margin-inline: auto;
}
.fmt-chip {
  font-size: 0.76rem; font-weight: 600; letter-spacing: 0.02em;
  background: #fff; color: var(--body);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 0.24rem 0.62rem;
}

.sample-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 0.5rem; margin-top: 1.1rem; font-size: 0.88rem; color: var(--muted);
}
.sample-row button {
  font-family: var(--font); font-size: 0.83rem; font-weight: 600;
  background: #fff; color: var(--brand-strong);
  border: 1px solid var(--border); border-radius: 999px;
  padding: 0.4rem 0.85rem; cursor: pointer;
}
.sample-row button:hover { border-color: var(--brand-mid); background: var(--brand-tint); }

.tool-divider { border: 0; border-top: 1px solid var(--border); margin: 1.5rem 0; }

.preview-box {
  display: flex; gap: 1.1rem; align-items: flex-start;
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 1rem;
}
.preview-thumb {
  width: 96px; height: 96px; flex: 0 0 auto;
  border-radius: 10px; border: 1px solid var(--border);
  object-fit: contain; background: #fff;
  background-image: linear-gradient(45deg, #f1f5f9 25%, transparent 25%, transparent 75%, #f1f5f9 75%),
                    linear-gradient(45deg, #f1f5f9 25%, transparent 25%, transparent 75%, #f1f5f9 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px;
}
@media (max-width: 480px) { .preview-box { flex-direction: column; } }

.file-meta { min-width: 0; }
.file-meta .file-name {
  font-weight: 600; color: var(--ink); margin: 0 0 0.35rem;
  overflow-wrap: anywhere;
}
.meta-dl {
  display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.9rem;
  margin: 0; font-size: 0.86rem;
}
.meta-dl dt { color: var(--muted); }
.meta-dl dd { margin: 0; color: var(--body); font-weight: 500; }

fieldset.seg-fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; }
fieldset.seg-fieldset legend {
  font-weight: 600; color: var(--ink); padding: 0; margin-bottom: 0.6rem; font-size: 0.97rem;
}

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.seg-option { position: relative; margin: 0; }
.seg-option input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg-option span {
  display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 0.6rem 0.5rem; cursor: pointer;
  font-weight: 600; color: var(--body); font-size: 0.95rem;
  background: #fff; transition: border-color 0.15s ease, background-color 0.15s ease;
}
.seg-option small { font-weight: 400; font-size: 0.72rem; color: var(--muted); }
.seg-option span:hover { border-color: var(--brand-mid); }
.seg-option input:checked + span { border-color: var(--brand); background: var(--brand-tint); color: var(--brand-strong); }
.seg-option input:focus-visible + span { outline: 2px solid var(--brand-mid); outline-offset: 2px; }

@media (max-width: 380px) {
  .seg { grid-template-columns: 1fr; }
  .seg-option span { flex-direction: row; justify-content: center; gap: 0.55rem; }
}

.option-row { display: grid; gap: 0.45rem; margin-bottom: 1.25rem; }
.option-row > label, .option-row > .option-label {
  font-weight: 600; color: var(--ink); font-size: 0.97rem;
}
.option-help { font-size: 0.83rem; color: var(--muted); margin: 0; }

.select-wrap { position: relative; }
.select-wrap select {
  width: 100%; appearance: none;
  font-family: var(--font); font-size: 0.95rem; color: var(--ink);
  padding: 0.65rem 2.4rem 0.65rem 0.85rem;
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
  cursor: pointer;
}
.select-wrap::after {
  content: ""; position: absolute; right: 1rem; top: 50%;
  width: 8px; height: 8px; margin-top: -6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); pointer-events: none;
}

.range-wrap { display: flex; align-items: center; gap: 0.9rem; }
.range-wrap input[type="range"] { flex: 1; accent-color: var(--brand); height: 2rem; cursor: pointer; }
.range-wrap output {
  min-width: 3.4rem; text-align: center;
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.3rem 0.4rem;
  font-weight: 600; font-size: 0.88rem; color: var(--ink);
}

.actions-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.4rem; }
.actions-row .btn { flex: 1 1 auto; }

.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.result-box { text-align: center; }
.result-thumb {
  display: block;
  max-width: 240px; max-height: 200px; margin: 1rem auto;
  border-radius: 12px; border: 1px solid var(--border);
  background-image: linear-gradient(45deg, #f1f5f9 25%, transparent 25%, transparent 75%, #f1f5f9 75%),
                    linear-gradient(45deg, #f1f5f9 25%, transparent 25%, transparent 75%, #f1f5f9 75%);
  background-size: 16px 16px; background-position: 0 0, 8px 8px;
  object-fit: contain;
}
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 1.25rem; }

.hidden { display: none !important; }

/* ---------- Form inputs (contact page) ---------- */
.input-text {
  width: 100%;
  font-family: var(--font);
  font-size: 0.97rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 0.85rem;
}
.input-text:hover { border-color: #cbd5e1; }
.input-text:focus { outline: 2px solid var(--brand-mid); outline-offset: 1px; border-color: var(--brand-mid); }
textarea.input-text { resize: vertical; min-height: 8rem; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.75rem; }
.justify-center { justify-content: center; }
.meta-dl-inline { display: inline-grid; }
.narrow { max-width: 40rem; margin-inline: auto; }
.narrow-text { max-width: 36rem; margin-inline: auto; }
.h-sm { font-size: 1.15rem; }
.list-block { display: inline-block; text-align: left; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  /* Static hero composition without the traveling conversion dot */
  .flow-dot, .flow-glow { display: none; }
  .flow-scene { transform: none; }
  .status-chip { transform: none; }
}
