@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Design tokens (matches Next.js globals.css) ──────── */
:root {
  --bg:           #f4f7fb;
  --surface:      #ffffff;
  --border:       #dbe3ee;
  --input-border: #ccd7e5;
  --text:         #10213f;
  --muted:        #64748b;
  --primary:      #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light:#eaf1ff;
  --secondary:    #eaf1ff;
  --radius:       0.75rem;
  --shadow:       0 1px 3px rgba(16,33,63,0.07), 0 1px 2px rgba(16,33,63,0.05);
  --shadow-md:    0 14px 34px rgba(30,55,90,0.07);
  --shadow-hover: 0 16px 36px rgba(30,64,175,0.13), 0 2px 8px rgba(30,64,175,0.07);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* ── Header ───────────────────────────────────────────── */
header.site {
  background: rgba(255,255,255,0.92);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
}
header.site .bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 62px; max-width: 1100px; margin: 0 auto;
}
header.site .brand {
  display: flex; align-items: center;
  color: var(--text); text-decoration: none; flex: none;
}
header.site .brand:hover { text-decoration: none; }
header.site .brand picture { display: flex; line-height: 0; }
.brand-logo {
  display: block; width: auto; height: 38px;
  max-width: min(200px, 38vw); object-fit: contain;
}
/* Keep the primary blue/red brand logo visible in both themes. */
.brand-logo-dark  { display: none; }
.brand-logo-light { display: block; }
html.dark .brand-logo-light { display: block; }
html.dark .brand-logo-dark  { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .brand-logo-light { display: block; }
  html:not([data-theme="light"]) .brand-logo-dark  { display: none; }
}

/* Theme toggle button */
.theme-toggle {
  display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); cursor: pointer; margin-left: 4px;
  transition: background 150ms, border-color 150ms, color 150ms;
  flex: none;
}
.theme-toggle:hover { background: var(--bg); color: var(--text); border-color: var(--primary); }
/* Sun shown only in dark mode, moon only in light mode */
.icon-sun  { display: none; }
.icon-moon { display: block; }
html.dark .icon-sun  { display: block; }
html.dark .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .icon-sun  { display: block; }
  html:not([data-theme="light"]) .icon-moon { display: none; }
}
header.site nav { display: flex; align-items: center; gap: 4px; }
header.site nav a {
  color: var(--muted); font-size: 0.875rem; font-weight: 500;
  padding: 6px 10px; border-radius: 8px;
  transition: color 120ms, background 120ms;
}
header.site nav a:hover { color: var(--text); background: var(--bg); text-decoration: none; }
header.site .btn-nav-login {
  background: var(--primary); color: #fff !important;
  padding: 7px 16px; border-radius: 8px; font-weight: 600; font-size: 0.875rem;
  margin-left: 6px; transition: background 150ms, box-shadow 150ms;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}
header.site .btn-nav-login:hover { background: var(--primary-dark); text-decoration: none; }
header.site select.locale {
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px;
  background: var(--surface); color: var(--text); font-size: 0.85rem; cursor: pointer; margin-left: 6px;
}

/* ── Hero ─────────────────────────────────────────────── */
.hero-band {
  position: relative; overflow: hidden;
  border-bottom: 1px solid rgba(99,102,241,0.12);
  background:
    radial-gradient(50rem 28rem at 10% -5%, rgba(96,165,250,0.25) 0%, transparent 60%),
    radial-gradient(40rem 22rem at 94% 2%, rgba(167,139,250,0.22) 0%, transparent 62%),
    linear-gradient(180deg, #eef4ff 0%, #f6f8ff 55%, var(--bg) 100%);
  padding: 80px 0 64px;
  text-align: center;
}
.hero-orb {
  position: absolute; border-radius: 999px; filter: blur(50px);
  opacity: 0.45; pointer-events: none;
  animation: hero-float 9s ease-in-out infinite;
}
.hero-orb-1 { top: -5rem; left: -2rem; width: 18rem; height: 18rem; background: #93c5fd; }
.hero-orb-2 { top: 1rem; right: -3rem; width: 22rem; height: 22rem; background: #c4b5fd; animation-delay: -3s; }
@keyframes hero-float {
  0%,100% { transform: translate3d(0,0,0) scale(1); }
  50% { transform: translate3d(0,-1.2rem,0) scale(1.04); }
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid rgba(79,70,229,0.2);
  border-radius: 999px;
  background: rgba(255,255,255,0.8);
  box-shadow: 0 8px 24px rgba(67,56,202,0.10);
  backdrop-filter: blur(8px);
  padding: 5px 14px 5px 10px;
  font-size: 0.78rem; font-weight: 800; color: #4338ca;
  letter-spacing: 0.05em; text-transform: uppercase;
  margin-bottom: 24px;
}
.hero-kicker-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #6d28d9);
}
.hero-band h1 {
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  font-weight: 900; letter-spacing: -0.03em; line-height: 1.06;
  margin: 0 auto 18px; max-width: 760px;
}
.hero-gradient-text {
  background: linear-gradient(92deg, #2563eb 0%, #6d28d9 52%, #e11d48 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub {
  color: var(--muted); font-size: 1.1rem;
  max-width: 560px; margin: 0 auto 36px; line-height: 1.75;
}
.hero-actions {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-bottom: 44px;
}
.btn-hero-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--primary); color: #fff; font-weight: 700; font-size: 0.95rem;
  padding: 13px 26px; border-radius: 10px;
  box-shadow: 0 6px 18px rgba(37,99,235,0.38);
  transition: background 150ms, transform 150ms, box-shadow 150ms;
}
.btn-hero-primary:hover {
  background: var(--primary-dark); transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(37,99,235,0.45); text-decoration: none; color: #fff;
}
.btn-hero-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.9); color: var(--text); font-weight: 600; font-size: 0.95rem;
  padding: 13px 26px; border-radius: 10px; border: 1.5px solid var(--border);
  box-shadow: 0 10px 24px rgba(30,64,175,0.07);
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.btn-hero-secondary:hover {
  border-color: #818cf8; box-shadow: 0 6px 18px rgba(99,102,241,0.15);
  transform: translateY(-2px); text-decoration: none; color: var(--text);
}
.trust-bar {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 28px;
  color: var(--muted); font-size: 0.83rem;
}
.trust-bar span { display: flex; align-items: center; gap: 6px; }
.trust-bar svg { color: #16a34a; flex: none; }

/* ── Tool grid (home page) ────────────────────────────── */
main.page { padding: 40px 0 80px; }

.category-label {
  text-transform: uppercase; letter-spacing: 0.09em;
  font-size: 0.7rem; font-weight: 800; color: var(--muted);
  margin: 48px 0 14px;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px; margin-bottom: 8px;
}
.tool-card {
  display: flex; align-items: flex-start; gap: 14px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
  color: var(--text); text-decoration: none;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
  position: relative;
}
.tool-card:hover {
  border-color: #60a5fa; box-shadow: var(--shadow-hover);
  transform: translateY(-2px); text-decoration: none;
}
.tool-card .tool-icon {
  flex: none; width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
}
.tool-svg-icon { width: 22px; height: 22px; display: block; }
.tool-card-body { flex: 1; min-width: 0; }
.tool-card-body h3 { margin: 0 0 4px; font-size: 0.95rem; font-weight: 800; line-height: 1.25; }
.tool-card-body p  { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.55; }
.tool-card-arrow {
  flex: none; color: var(--border); margin-top: 2px;
  transition: color 150ms, transform 150ms;
}
.tool-card:hover .tool-card-arrow { color: var(--primary); transform: translateX(3px); }

/* ── Shared buttons ───────────────────────────────────── */
.btn {
  display: inline-block; padding: 10px 18px; border-radius: 8px;
  background: var(--primary); color: #fff; border: none;
  font-size: 0.93rem; font-weight: 600; cursor: pointer; transition: background 150ms;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn.secondary { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: var(--bg); }

/* ── Tool page ────────────────────────────────────────── */
.tool-hero-block {
  display: flex; align-items: center; gap: 20px; margin-bottom: 32px;
}
.tool-hero-icon {
  flex: none; width: 58px; height: 58px; border-radius: 16px;
  display: grid; place-items: center;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
}
.tool-hero-icon .tool-svg-icon { width: 30px; height: 30px; }
.tool-hero-block h1 { font-size: 1.85rem; margin: 0 0 6px; font-weight: 800; letter-spacing: -0.02em; }
.tool-hero-block p  { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.6; }

.tool-form-card {
  background: rgba(255,255,255,0.93);
  border: 1px solid var(--border); border-radius: 1rem;
  box-shadow: var(--shadow-md); padding: 32px;
  max-width: 680px; margin: 0 auto 40px;
}
.tool-form-card.has-page-workspace { max-width: 980px; }

/* Dropzone */
.dropzone-area {
  border: 2px dashed #c7d2fe; border-radius: 12px;
  background: #f8faff; margin-bottom: 24px;
  transition: border-color 150ms, background 150ms; overflow: hidden;
}
.dropzone-area.drag-over { border-color: var(--primary); background: var(--primary-light); }
.dropzone-inner {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 44px 20px; text-align: center; gap: 10px;
}
.dropzone-icon { color: #818cf8; margin-bottom: 4px; }
.dropzone-title { font-weight: 700; font-size: 1rem; margin: 0; color: var(--text); }
.dropzone-sub   { font-size: 0.82rem; color: var(--muted); margin: 0; }
.btn-upload {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 6px;
  padding: 10px 20px; background: var(--primary); color: #fff; border-radius: 8px;
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 12px rgba(37,99,235,0.28); transition: background 150ms, transform 150ms;
}
.btn-upload:hover { background: var(--primary-dark); transform: translateY(-1px); }
.file-input-hidden { display: none; }
.dropzone-filelist { padding: 0 16px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.dz-file-row {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; min-width: 0; max-width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; font-size: 0.85rem;
}
.dz-file-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-file-row small { color: var(--muted); flex: none; }
.dz-file-row svg { color: #818cf8; flex: none; }

/* Page workspace */
.page-workspace {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  margin: 0 0 24px;
  overflow: hidden;
}
.page-workspace.is-hidden { display: none; }
.page-workspace-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding: 16px 18px;
  border-bottom: 1px solid var(--border);
}
.page-workspace-head h2 {
  margin: 0 0 4px; font-size: 1rem; line-height: 1.3; font-weight: 800;
}
.page-workspace-head p {
  margin: 0; color: var(--muted); font-size: 0.84rem; line-height: 1.55;
}
.page-workspace-reset {
  flex: none; padding: 8px 12px; font-size: 0.82rem;
}
.page-workspace-status {
  padding: 12px 18px 0;
  color: var(--muted); font-size: 0.84rem;
}
.page-workspace-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  padding: 14px 18px 18px;
}
.page-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f8faff;
  padding: 8px;
  cursor: grab;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.page-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 10px 24px rgba(30,64,175,0.11);
}
.page-card.is-dragging {
  cursor: grabbing;
  opacity: 0.58;
  transform: scale(0.98);
}
.page-card-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 7px;
}
.page-card-top span {
  display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 7px;
  background: var(--primary); color: #fff;
  font-size: 0.76rem; font-weight: 800;
}
.page-card-top small {
  color: var(--muted); font-size: 0.76rem; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
}
.page-card-preview {
  display: grid; place-items: center;
  height: 150px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(45deg, #eef2f7 25%, transparent 25%),
    linear-gradient(-45deg, #eef2f7 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef2f7 75%),
    linear-gradient(-45deg, transparent 75%, #eef2f7 75%);
  background-color: #ffffff;
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  overflow: hidden;
}
.page-card-preview img {
  display: block;
  max-width: 86%;
  max-height: 86%;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(15,23,42,0.22);
  transition: transform 150ms;
}
.page-card-name {
  margin: 7px 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.page-card-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
.page-action-btn {
  display: grid; place-items: center;
  width: 100%; height: 30px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.page-action-btn:hover:not(:disabled) {
  color: var(--text);
  border-color: #93c5fd;
  background: #eef4ff;
}
.page-action-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}
.page-action-btn svg { width: 15px; height: 15px; }

/* Options */
.tool-options { margin-bottom: 24px; display: grid; gap: 4px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: 0.875rem; margin-bottom: 6px; color: var(--text); }
.field input[type=text], .field input[type=password], .field input[type=number],
.field select, .field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--input-border); border-radius: 0.75rem;
  font-size: 0.875rem; background: var(--surface); color: var(--text);
  transition: border-color 150ms, box-shadow 150ms; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96,165,250,0.24);
}
.field .hint { color: var(--muted); font-size: 0.8rem; margin-top: 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

/* Submit */
.btn-submit {
  display: block; width: 100%; padding: 14px;
  background: var(--primary); color: #fff; border: none; border-radius: 10px;
  font-size: 1rem; font-weight: 700; cursor: pointer;
  box-shadow: 0 6px 18px rgba(37,99,235,0.32);
  transition: background 150ms, transform 150ms, box-shadow 150ms;
}
.btn-submit:hover {
  background: var(--primary-dark); transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37,99,235,0.42);
}

.error-banner {
  background: #fef2f2; color: #991b1b; border: 1px solid #fecaca;
  border-radius: 8px; padding: 10px 14px; margin-bottom: 18px; font-size: 0.88rem;
}

/* Tool about section */
.tool-about-section { max-width: 680px; margin: 0 auto 40px; }
.tool-about-section .section-heading { text-align: left; }
.tool-about-text {
  color: var(--muted); font-size: 0.95rem; line-height: 1.75;
  margin: 0; padding: 20px 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px;
}

/* Home why-section */
.home-why-section {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 56px 0;
}
.home-why-title {
  font-size: 1.75rem; font-weight: 900; text-align: center;
  letter-spacing: -0.03em; margin: 0 0 10px;
}
.home-why-sub {
  text-align: center; color: var(--muted); font-size: 0.95rem;
  max-width: 520px; margin: 0 auto 40px;
}
.home-why-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.home-why-card {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px 22px;
}
.home-why-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, #2563eb22, #6366f122);
  color: #2563eb; display: grid; place-items: center;
  margin-bottom: 14px;
}
html.dark .home-why-icon { color: #60a5fa; }
.home-why-card h3 { font-size: 0.95rem; font-weight: 800; margin: 0 0 6px; }
.home-why-card p  { font-size: 0.85rem; color: var(--muted); margin: 0; line-height: 1.6; }
@media (max-width: 860px) { .home-why-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px)  { .home-why-grid { grid-template-columns: 1fr; } }

/* Steps & FAQ */
.section-heading { font-size: 1.2rem; font-weight: 800; margin: 0 0 20px; text-align: center; letter-spacing: -0.01em; }
.steps-section, .faq-section { max-width: 680px; margin: 0 auto 40px; }
.steps { display: grid; gap: 18px; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step .num {
  flex: none; width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #6366f1);
  color: #fff; display: grid; place-items: center;
  font-weight: 800; font-size: 0.88rem; box-shadow: 0 4px 10px rgba(37,99,235,0.3);
}
.step h4 { margin: 0 0 4px; font-size: 0.95rem; font-weight: 700; }
.step p  { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.6; }
.faq { max-width: 680px; margin: 0 auto; }
.faq details { border-bottom: 1px solid var(--border); padding: 14px 0; }
.faq summary { font-weight: 700; cursor: pointer; font-size: 0.95rem; }
.faq p { color: var(--muted); margin: 8px 0 0; font-size: 0.9rem; line-height: 1.65; }

/* ── Auth pages ───────────────────────────────────────── */
.auth-box {
  max-width: 460px; margin: 48px auto;
  border-radius: 1.6rem;
  background:
    radial-gradient(28rem 16rem at 8% -10%, rgba(186,230,253,0.45) 0%, transparent 60%),
    radial-gradient(22rem 12rem at 100% 0%, rgba(196,181,253,0.25) 0%, transparent 62%),
    linear-gradient(180deg, #f8fbff 0%, #ffffff 28%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.auth-topband {
  height: 4px;
  background: linear-gradient(90deg, #2563eb 0%, #6366f1 50%, #8b5cf6 100%);
}
.auth-header {
  padding: 28px 32px 20px; text-align: center;
}
.auth-header h1 { margin: 0 0 6px; font-size: 1.6rem; font-weight: 900; letter-spacing: -0.02em; }
.auth-header p  { margin: 0; color: var(--muted); font-size: 0.9rem; }
.auth-form { padding: 4px 32px 32px; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 6px; }
.auth-field input {
  width: 100%; padding: 11px 13px;
  border: 1px solid var(--input-border); border-radius: 0.75rem;
  font-size: 0.93rem; background: var(--surface); color: var(--text); outline: none;
  transition: border-color 150ms, box-shadow 150ms;
}
.auth-field input:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(96,165,250,0.24); }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
  padding: 11px; border: 1.5px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font-weight: 600; font-size: 0.93rem;
  cursor: pointer; text-decoration: none;
  box-shadow: 0 2px 8px rgba(16,33,63,0.07);
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.btn-google:hover {
  border-color: #4285F4; box-shadow: 0 4px 14px rgba(66,133,244,0.18);
  transform: translateY(-1px); text-decoration: none;
}
.auth-divider {
  display: flex; align-items: center; gap: 12px; margin: 20px 0 4px;
  color: var(--muted); font-size: 0.8rem;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-switch { text-align: center; margin-top: 20px; font-size: 0.88rem; color: var(--muted); }

/* ── Content pages (about, faq) ───────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 0.88rem; margin: 0 0 28px;
}
.breadcrumb a { color: var(--muted); font-weight: 600; }
.breadcrumb span:last-child { color: var(--text); font-weight: 600; }
.content-hero {
  max-width: 760px; margin: 0 auto 36px; text-align: center;
}
.content-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem); line-height: 1.08; letter-spacing: -0.02em; margin: 0 0 16px;
}
.content-hero p:last-child { color: var(--muted); font-size: 1.08rem; line-height: 1.75; margin: 0; }
.info-section, .faq-panel-block {
  max-width: 820px; margin: 18px auto;
  background: rgba(255,255,255,0.93); border: 1px solid var(--border);
  border-radius: 1rem; box-shadow: var(--shadow-md); padding: 28px;
}
.info-section h2, .faq-panel-block h2 { margin: 0 0 8px; font-size: 1.35rem; font-weight: 800; }
.info-section > p { color: var(--muted); margin: 0 0 18px; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.check-list li { position: relative; padding-left: 30px; color: var(--text); }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 0.32em;
  width: 20px; height: 20px; border-radius: 50%;
  background: #dcfce7; box-shadow: inset 0 0 0 6px #15803d;
}
.faq-category-row {
  max-width: 960px; margin: 0 auto 28px;
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px;
}
.faq-category {
  background: rgba(255,255,255,0.93); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow);
  color: var(--text); text-decoration: none;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.faq-category:hover {
  border-color: #60a5fa; box-shadow: var(--shadow-hover);
  transform: translateY(-1px); text-decoration: none;
}
.faq-category strong { display: block; color: var(--text); font-weight: 700; margin-bottom: 6px; }
.faq-category span   { display: block; color: var(--muted); font-size: 0.86rem; line-height: 1.45; }
.faq-panel-head { margin-bottom: 12px; }
.faq-panel-kicker {
  margin: 0 0 4px; color: var(--primary);
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; font-size: 0.75rem;
}
.faq-panel-copy { margin: 0; color: var(--muted); }
.faq-panel-block .faq { max-width: none; margin: 0; }
.tool-faq-heading { margin: 24px 0 4px; font-size: 1.05rem; }
.tool-faq-heading:first-child { margin-top: 0; }

/* ── Footer ───────────────────────────────────────────── */
footer.site {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 52px 0 28px; font-size: 0.88rem;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 44px; margin-bottom: 44px; }
.footer-brand p { color: var(--muted); margin: 12px 0 0; max-width: 260px; line-height: 1.65; font-size: 0.88rem; }
.footer-logo { display: flex; align-items: center; line-height: 0; }
.footer-brand-logo { display: block; width: auto; height: 36px; max-width: 220px; object-fit: contain; }
.footer-links { display: flex; flex-direction: column; gap: 10px; }
.footer-links strong {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text); font-weight: 800; margin-bottom: 2px;
}
.footer-links a { color: var(--muted); font-size: 0.875rem; transition: color 120ms; }
.footer-links a:hover { color: var(--text); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--border); padding-top: 22px;
  color: var(--muted); font-size: 0.82rem; text-align: center;
}
.footer-bottom p {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 0.35rem 0.55rem;
  margin: 0 auto; line-height: 1.7;
}
.footer-bottom a { color: var(--muted); font-weight: 600; }
.footer-bottom a:hover { color: var(--text); text-decoration: none; }
.site-footer-flag { margin-inline: 0.05rem; margin-bottom: 0.15rem; }
.fr-flag {
  display: inline-block; flex: none;
  width: 30px; height: 30px;
  object-fit: contain; vertical-align: middle;
}

/* ── Dark mode (html.dark class, mirrors next-themes) ─── */
html.dark {
  --bg:           #1e1b2e;
  --surface:      #2a2640;
  --border:       #3d3857;
  --input-border: #4a4568;
  --text:         #f1edf5;
  --muted:        #b8b0cc;
  --primary:      #818cf8;
  --primary-dark: #6366f1;
  --primary-light:rgba(129,140,248,0.15);
  --shadow:       0 1px 3px rgba(0,0,0,0.35);
  --shadow-md:    0 14px 34px rgba(0,0,0,0.35);
  --shadow-hover: 0 16px 40px rgba(0,0,0,0.5);
  color-scheme: dark;
}
html.dark body { background: var(--bg); color: var(--text); }
html.dark header.site {
  background: rgba(226,232,240,0.96);
  border-bottom-color: rgba(100,116,139,0.28);
  box-shadow: 0 10px 28px rgba(0,0,0,0.26);
}
html.dark header.site nav a { color: #334155; }
html.dark header.site nav a:hover {
  color: #0f172a;
  background: rgba(37,99,235,0.10);
}
html.dark header.site select.locale,
html.dark .theme-toggle {
  background: #f8fafc;
  border-color: rgba(100,116,139,0.34);
  color: #10213f;
}
html.dark .theme-toggle:hover {
  background: #dbeafe;
  border-color: rgba(37,99,235,0.55);
  color: #1d4ed8;
}
html.dark .hero-band {
  background:
    radial-gradient(50rem 28rem at 10% -5%, rgba(129,140,248,0.18) 0%, transparent 60%),
    radial-gradient(40rem 22rem at 94% 2%, rgba(167,139,250,0.15) 0%, transparent 62%),
    linear-gradient(180deg, #1a1730 0%, #1e1b2e 100%);
}
html.dark .hero-kicker { background: rgba(30,27,46,0.8); color: #a5b4fc; border-color: rgba(129,140,248,0.3); }
html.dark .hero-gradient-text { background: linear-gradient(92deg, #818cf8 0%, #c084fc 52%, #f472b6 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
html.dark .tool-card { background: var(--surface); }
html.dark .tool-form-card { background: var(--surface); }
html.dark .page-workspace { background: rgba(255,255,255,0.03); }
html.dark .page-card { background: rgba(255,255,255,0.04); }
html.dark .page-card-preview {
  background:
    linear-gradient(45deg, rgba(255,255,255,0.05) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.05) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.05) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.05) 75%);
  background-color: #1f1b30;
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
html.dark .page-action-btn:hover:not(:disabled) { background: rgba(129,140,248,0.16); border-color: #818cf8; }
html.dark .info-section, html.dark .faq-panel-block, html.dark .faq-category { background: var(--surface); }
html.dark .dropzone-area { background: rgba(255,255,255,0.04); border-color: var(--border); }
html.dark .auth-box { background: var(--surface); }
html.dark .auth-topband { background: linear-gradient(90deg, #818cf8, #a78bfa, #c084fc); }
html.dark footer.site { background: var(--surface); }
html.dark .btn-hero-secondary { background: var(--surface); }

/* Also respect system preference when no explicit choice is stored */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg:           #1e1b2e;
    --surface:      #2a2640;
    --border:       #3d3857;
    --input-border: #4a4568;
    --text:         #f1edf5;
    --muted:        #b8b0cc;
    --primary:      #818cf8;
    --primary-dark: #6366f1;
    --primary-light:rgba(129,140,248,0.15);
    --shadow:       0 1px 3px rgba(0,0,0,0.35);
    --shadow-md:    0 14px 34px rgba(0,0,0,0.35);
    --shadow-hover: 0 16px 40px rgba(0,0,0,0.5);
    color-scheme: dark;
  }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-band { padding: 56px 0 48px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  header.site .bar { padding: 0 16px; }
  .brand-logo { height: 34px; }
  .faq-category-row { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .info-section, .faq-panel-block { padding: 22px; }
  .tool-form-card { padding: 22px; }
  .page-workspace-head { flex-direction: column; }
  .page-workspace-reset { width: 100%; }
  .page-workspace-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); padding: 12px; }
  .page-card-preview { height: 136px; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; align-items: center; }
  .trust-bar { gap: 16px; }
  .brand-logo { height: 30px; max-width: 140px; }
  .footer-brand-logo { height: 32px; max-width: 180px; }
  .faq-category-row { grid-template-columns: 1fr; }
  .auth-box { margin: 24px auto; border-radius: 1rem; }
  .auth-form, .auth-header { padding-left: 20px; padding-right: 20px; }
  .tool-form-card { padding: 16px; }
  .page-workspace-head, .page-workspace-status { padding-left: 12px; padding-right: 12px; }
}

/* ── RTL ──────────────────────────────────────────────── */
[dir="rtl"] header.site .bar { flex-direction: row-reverse; }
[dir="rtl"] .step { flex-direction: row-reverse; }
[dir="rtl"] .tool-card { flex-direction: row-reverse; }
[dir="rtl"] .tool-card-arrow { transform: rotate(180deg); }
[dir="rtl"] .tool-card:hover .tool-card-arrow { transform: rotate(180deg) translateX(-2px); }
[dir="rtl"] .check-list li { padding-left: 0; padding-right: 30px; }
[dir="rtl"] .check-list li::before { left: auto; right: 0; }
