/* LiteBox — light, airy design system */

:root {
  --bg: #f7f9fc;
  --bg-elevated: #ffffff;
  --bg-sidebar: #ffffff;
  --bg-hover: #eef4fb;
  --text: #1a2332;
  --text-muted: #64748b;
  --text-soft: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #4f9cf9;
  --accent-soft: #e8f2fe;
  --accent-hover: #3b82f6;
  --accent-warm: #ff9b71;
  --accent-warm-soft: #fff0ea;
  --success: #22c55e;
  --error: #ef4444;
  --error-bg: #fef2f2;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sidebar-w: 240px;
  --header-h: 64px;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #0f1419;
  --bg-elevated: #1a222d;
  --bg-sidebar: #151b24;
  --bg-hover: #1e2836;
  --text: #e8edf4;
  --text-muted: #94a3b8;
  --text-soft: #64748b;
  --border: #2a3444;
  --border-strong: #3d4f66;
  --accent: #60a5fa;
  --accent-soft: #1e3a5f;
  --accent-hover: #93c5fd;
  --accent-warm: #fb923c;
  --accent-warm-soft: #3d2817;
  --error-bg: #3f1d1d;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(ellipse 80% 50% at 100% -10%, rgba(79, 156, 249, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 0% 100%, rgba(255, 155, 113, 0.06), transparent);
}

a {
  color: var(--accent);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

.visually-hidden {
  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;
  top: -100%;
  left: 1rem;
  z-index: 999;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-xs);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

/* Layout */
.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.25rem 1rem;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin-bottom: 1.5rem;
  text-decoration: none;
  color: inherit;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-name {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tool-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.tool-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.tool-nav-btn:hover {
  background: var(--bg-hover);
}

.tool-nav-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

html[data-theme="dark"] .tool-nav-btn.is-active {
  color: var(--accent);
}

.tool-nav-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg);
  font-size: 1.1rem;
}

.tool-nav-btn.is-active .tool-nav-icon {
  background: var(--accent);
  color: #fff;
}

.tool-nav-label {
  font-weight: 600;
  font-size: 0.9rem;
}

.tool-nav-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 0.1rem;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.lang-select {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-elevated);
  font-size: 0.85rem;
}

.theme-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-elevated);
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.theme-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.theme-btn svg {
  width: 18px;
  height: 18px;
}

.theme-btn .icon-moon {
  display: none;
}

html[data-theme="dark"] .theme-btn .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-btn .icon-moon {
  display: block;
}

/* Main content */
.main-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.main-content {
  flex: 1;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
}

.page-header {
  margin-bottom: 1rem;
}

.page-header-tag {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.page-header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-header p,
.page-header-lead {
  margin: 0;
  max-width: 42rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.tool-intro {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
}

.tool-intro ul {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.tool-intro li+li {
  margin-top: 0.4rem;
}

.tool-intro li strong {
  color: var(--text);
  font-weight: 600;
}

.tool-panel[hidden] {
  display: none !important;
}

/* Cards & panels */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.card-title {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* Dropzone */
.dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 160px;
  padding: 2rem 1.5rem;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone-icon {
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.dropzone-title {
  margin: 0;
  font-weight: 600;
  font-size: 1rem;
}

.dropzone-hint,
.dropzone-formats {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.file-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* Form controls */
.form-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 540px) {
  .form-grid--2 {
    grid-template-columns: 1fr 1fr;
  }
}

.form-field label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.form-field input[type="text"],
.form-field input[type="number"],
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-elevated);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.form-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.quality-value {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--accent);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.checkbox-row input {
  accent-color: var(--accent);
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

/* Buttons */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: var(--radius-xs);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 0.4rem 0.6rem;
}

.btn-ghost:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

/* Sub tabs */
.sub-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}

.sub-tab {
  flex: 1;
  padding: 0.65rem 0.5rem;
  border: none;
  background: transparent;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.sub-tab:hover {
  color: var(--text);
}

.sub-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Color preview */
.color-preview {
  width: 100%;
  height: 100px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
  transition: background-color 0.15s;
}

.color-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0.5rem 0;
}

.color-field-head h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

.color-field+.color-field {
  margin-top: 1.25rem;
}

/* Textarea & code */
.textarea {
  width: 100%;
  min-height: 120px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-elevated);
  font-family: var(--mono);
  font-size: 0.85rem;
  line-height: 1.5;
  resize: vertical;
}

.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.code-block {
  margin: 0.5rem 0;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

.note {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  background: var(--accent-warm-soft);
  border-radius: var(--radius-xs);
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Error */
.error-msg {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  background: var(--error-bg);
  border: 1px solid color-mix(in srgb, var(--error) 30%, transparent);
  border-radius: var(--radius-xs);
  color: var(--error);
  font-size: 0.875rem;
}

/* Results */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.file-item {
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.file-name {
  font-weight: 600;
  font-size: 0.9rem;
  word-break: break-all;
}

.file-meta {
  margin: 0.25rem 0 0.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

.preview-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.file-preview {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.decode-preview {
  max-width: 100%;
  max-height: 240px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.decode-meta {
  margin: 0.75rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--mono);
}

/* Site footer */
.site-footer {
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.5rem 1.5rem;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-soft);
  border-top: 1px solid var(--border);
}

/* Mobile nav */
.mobile-nav {
  display: none;
}

@media (max-width: 768px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 0.75rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .brand {
    margin-bottom: 0;
    flex: 1;
  }

  .tool-nav {
    display: none;
  }

  .sidebar-footer {
    border-top: none;
    padding-top: 0;
  }

  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border);
    padding: 0.35rem 0.5rem calc(0.35rem + env(safe-area-inset-bottom));
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-nav .tool-nav-btn {
    flex: 0 0 auto;
    min-width: 4.25rem;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.5rem 0.25rem;
  }

  .mobile-nav .tool-nav-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .mobile-nav .tool-nav-desc {
    display: none;
  }

  .mobile-nav .tool-nav-label {
    font-size: 0.7rem;
  }

  .main-content {
    padding: 1.25rem 1rem 5rem;
  }

  .page-header h1 {
    font-size: 1.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* Sidebar sections & content nav */
.sidebar-section-label {
  margin: 0 0 0.5rem;
  padding: 0 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.content-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 1rem;
}

.content-nav-btn {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-xs);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.content-nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.content-nav-btn.is-active {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

html[data-theme="dark"] .content-nav-btn.is-active {
  color: var(--accent);
}

.content-nav-btn--donate {
  margin-top: 0.25rem;
  color: var(--accent-warm);
}

.content-nav-btn--donate:hover {
  background: var(--accent-warm-soft);
  color: var(--accent-warm);
}

a.tool-nav-link {
  text-decoration: none;
  color: inherit;
}

.tool-nav--links .tool-nav-btn {
  cursor: pointer;
}

.mobile-content-nav {
  display: none;
}

/* Doc article (inside main-content) */
.page-doc .article {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.page-doc .article-hero {
  margin-bottom: 0;
}

.page-doc .article-hero h1 {
  margin: 0 0 0.35rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.page-doc .article-lead {
  margin: 0;
  max-width: 42rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.page-doc .article-toc {
  margin-bottom: 0;
}

.page-doc .toc-title {
  margin: 0 0 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.page-doc .article-toc ol {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.page-doc .article-toc a {
  color: var(--accent);
}

.page-doc .article-section {
  margin-bottom: 0;
}

.page-doc .article-section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.page-doc .article-section h3 {
  margin: 1rem 0 0.5rem;
  font-size: 0.95rem;
}

.page-doc .article-section p,
.page-doc .article-section li {
  color: var(--text-muted);
  line-height: 1.65;
}

.page-doc .article-section ul {
  padding-left: 1.25rem;
}

.page-doc .article-callout {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: var(--accent-soft);
  border-radius: var(--radius-xs);
  font-size: 0.9rem;
  color: var(--text);
}

.page-doc .code-caption {
  margin: 1rem 0 0.35rem;
  font-size: 0.8rem;
  color: var(--text-soft);
}

.page-doc .code-block--article {
  font-size: 0.8rem;
}

.ad-slot {
  overflow: hidden;
}

.ad-slot.card:not(:has(iframe)) {
  min-height: 0 !important;
  height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  .content-nav {
    display: none;
  }

  .sidebar-section-label {
    display: none;
  }

  .tool-nav--links {
    display: none;
  }

  .mobile-content-nav {
    display: flex;
    gap: 0.35rem;
    overflow-x: auto;
    max-width: 820px;
    width: 100%;
    margin: 0 auto;
    padding: 0.75rem 1rem 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mobile-content-nav::-webkit-scrollbar {
    display: none;
  }

  .mobile-content-nav .content-nav-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
  }

  .mobile-content-nav .content-nav-btn.is-active {
    border-color: var(--accent);
  }
}

.site-extra {
  margin-top: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.info-section h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.info-grid {
  display: grid;
  gap: 0.75rem;
  align-items: stretch;
}

@media (min-width: 640px) {
  .info-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.info-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 9.5rem;
}

.info-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.info-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.faq-note {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.knowledge-base-lead {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.knowledge-base h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 600;
}

.knowledge-base p {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.knowledge-base code {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--surface-2);
}

.knowledge-faq {
  margin: 0.75rem 0 0;
}

.knowledge-faq dt {
  margin-top: 1rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
}

.knowledge-faq dt:first-child {
  margin-top: 0;
}

.knowledge-faq dd {
  margin: 0.35rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.knowledge-faq a {
  color: var(--accent);
}

.site-footer-copy {
  margin: 0 0 0.35rem;
  font-weight: 500;
  color: var(--text-soft);
}

.donation-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}

.donation-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.don-banner__inner {
  text-align: center;
  padding: 0.5rem 0;
}

.don-banner__icon {
  font-size: 1.75rem;
  color: var(--accent-warm);
  margin-bottom: 0.5rem;
}

.donation-outro {
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.don-banner__title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
}

.don-banner__sub {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.don-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  justify-content: center;
  align-items: center;
  margin-bottom: 0.75rem;
}

#donation-pay-row>script[data-name="bmc-button"] {
  display: none;
}

#donation-pay-row #pay-banner-actions {
  order: 1;
  display: inline-flex;
  align-items: center;
}

#donation-pay-row #bmc-wbtn {
  order: 2;
  display: inline-flex !important;
  align-items: center !important;
  vertical-align: middle;
}

.don-banner__stripe-slot {
  display: inline-flex;
  align-items: center;
}

.don-banner__legal {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.donation-section h2 {
  margin: 0 0 1rem;
  font-size: 1.08rem;
}

.donation-section--why p {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.donation-section--why p:last-of-type {
  margin-bottom: 0;
}

.donation-section--principles .don-grid {
  margin-top: 0;
}

.don-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

@media (min-width: 640px) {
  .don-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.don-grid--features {
  margin-top: 0;
}

.don-card {
  padding: 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.don-card--feat {
  padding: 1.15rem 1.1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.don-card--feat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.don-card h3,
.don-card--feat h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.don-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.don-feat-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.65rem;
  color: #fff;
}

.don-feat-icon svg {
  display: block;
}

.don-feat-icon--green {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
}

.don-feat-icon--dollar .don-feat-dollar {
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  font-family: var(--font);
}

.don-feat-icon--blue {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.don-feat-icon--orange {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
}

.don-pay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 58px;
  height: 58px;
  padding: 0 1.5rem;
  font-size: 2.0rem;
  font-weight: 950;
  letter-spacing: 0.02em;
  border-radius: 10px;
  line-height: 1.1;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(70, 226, 161, 0.36);
  background: linear-gradient(180deg, #49c29a 0%, #47e295 42%, #3bce89 100%);
  box-shadow: 0 3px 14px rgba(70, 226, 161, 0.42);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

a.don-pay-btn:hover:not(.don-pay-btn--disabled),
button.don-pay-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(252, 252, 253, 0.45);
}

.don-pay-btn--disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-top: 0.75rem;
}

.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-nav a:hover {
  color: var(--accent);
}

/* Cookie consent banner */
.consent-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 1000;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.consent-banner--hide {
  opacity: 0;
  transform: translateY(12px);
}

.consent-banner__inner {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1rem 1.15rem;
  pointer-events: auto;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}

.consent-banner__title {
  margin: 0 0 0.35rem;
  font-weight: 600;
  font-size: 0.95rem;
}

.consent-banner__body {
  margin: 0 0 0.85rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.55;
}

.consent-banner__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
}

.consent-banner__link {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
}

.consent-banner__link:hover {
  color: var(--accent);
}

@media (max-width: 520px) {
  .consent-banner__link {
    margin-left: 0;
    width: 100%;
  }
}

/* 404 — split layout (illustration + copy) */
.error-page {
  --error-bg: #f8fafc;
  --error-accent: #0052d9;
  --error-title: #0f172a;
  --error-muted: #475569;
  --error-link: #64748b;
  --error-ring: #e2e8f0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--error-bg);
  background-image: none;
}

html[data-theme="dark"] .error-page {
  --error-bg: #0b0f19;
  --error-accent: #3b82f6;
  --error-title: #f8fafc;
  --error-muted: #94a3b8;
  --error-link: #94a3b8;
  --error-ring: #1e293b;
}

.error-page__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.5rem;
}

.error-page__container {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: min(720px, 100%);
  margin: 0 auto;
}

.error-page__figure {
  margin: 0 0 1.5rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.error-page__figure svg {
  width: 100% !important;
  max-width: 320px !important;
  height: auto !important;
  display: block !important;
}

.error-page__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.error-page__title {
  margin: 0 0 0.85rem 0;
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--error-title);
  letter-spacing: -0.02em;
}

.error-page__lead {
  margin: 0 auto 2.5rem auto;
  font-size: clamp(0.875rem, 2.5vw, 0.95rem);
  line-height: 1.6;
  color: var(--error-muted);
  max-width: 34rem;
}

.error-page__actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.error-page__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.8rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  white-space: nowrap;
}

.error-page__btn--primary {
  background: var(--error-accent);
  color: #ffffff !important;
  border: 1px solid transparent;
}

.error-page__btn--primary:hover {
  background: #0044b3;
  box-shadow: 0 4px 12px rgba(0, 82, 217, 0.2);
  transform: translateY(-1px);
}

html[data-theme="dark"] .error-page__btn--primary:hover {
  background: #2563eb;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.error-page__btn--secondary {
  background: #ffffff;
  color: #475569 !important;
  border: 1px solid #e2e8f0;
}

.error-page__btn--secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a !important;
  transform: translateY(-1px);
}

html[data-theme="dark"] .error-page__btn--secondary {
  background: #1e293b;
  color: #e2e8f0 !important;
  border-color: #334155;
}

html[data-theme="dark"] .error-page__btn--secondary:hover {
  background: #334155;
  border-color: #475569;
  color: #ffffff !important;
}

/* 404 space SVG interactive floating animations */
@media (max-width: 640px) {
  .error-page__actions {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    max-width: 20rem;
  }

  .error-page__btn {
    width: 100%;
  }
}

.site-footer--error {
  margin-top: auto;
  padding: 1rem 1.5rem 1.5rem;
  border-top: none;
  background: transparent;
}

.icon-size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
}

.icon-size-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.icon-size-thumb {
  object-fit: contain;
  image-rendering: pixelated;
  background: repeating-conic-gradient(#ccc 0% 25%, transparent 0% 50%) 50% / 12px 12px;
  border-radius: 6px;
}

[data-theme="dark"] .icon-size-thumb {
  background: repeating-conic-gradient(#444 0% 25%, transparent 0% 50%) 50% / 12px 12px;
}

.icon-size-label {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.card-subtitle {
  margin: 1rem 0 0.5rem;
  font-size: 0.92rem;
}

.aidetect-verdict {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
  font-weight: 700;
}

.aidetect-verdict--likely {
  color: #dc2626;
}

.aidetect-verdict--possible {
  color: #d97706;
}

.aidetect-verdict--unlikely {
  color: var(--text-muted);
}

.aidetect-verdict--unknown {
  color: #16a34a;
}

.aidetect-signals {
  margin: 0 0 1rem;
  padding-left: 1.15rem;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.aidetect-signals li+li {
  margin-top: 0.35rem;
}

/* Site extra / info / donation */

/* ============================================================
   HOME HUB — Hero + Tool Cards
   ============================================================ */

.home-hero {
  position: relative;
  padding: 3rem 0 2.5rem;
  text-align: center;
  overflow: hidden;
}

.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% -10%, rgba(79, 156, 249, 0.14), transparent),
    radial-gradient(ellipse 50% 40% at 80% 110%, rgba(255, 155, 113, 0.10), transparent);
  pointer-events: none;
}

.home-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
  padding: 0.35rem 0.9rem;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--accent);
}

.home-hero-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.75); }
}

.home-hero h1 {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-hero-lead {
  margin: 0 auto 2rem;
  max-width: 36rem;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.home-hero-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  margin-top: 1.5rem;
}

.home-hero-feature {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.home-hero-feature svg {
  color: var(--success);
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Tool card grid */
.tools-grid-section {
  margin-bottom: 2rem;
}

.tools-grid-section h2 {
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.78rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 680px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 440px) {
  .tools-grid {
    grid-template-columns: 1fr;
  }
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.35rem 1.25rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.tool-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent-soft), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 32px rgba(79, 156, 249, 0.14);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.tool-card:hover::after {
  opacity: 1;
}

.tool-card-icon {
  font-size: 1.85rem;
  line-height: 1;
  margin-bottom: 0.25rem;
  display: block;
  position: relative;
  z-index: 1;
}

.tool-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}

.tool-card-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

.tool-card-tag {
  display: inline-flex;
  align-items: center;
  margin-top: auto;
  padding-top: 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--accent);
  position: relative;
  z-index: 1;
}

.tool-card-tag svg {
  width: 12px;
  height: 12px;
  margin-left: 0.25rem;
  transition: transform 0.2s ease;
}

.tool-card:hover .tool-card-tag svg {
  transform: translateX(3px);
}

/* ============================================================
   TOOL PAGE — Breadcrumb + enhanced header
   ============================================================ */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb-sep {
  opacity: 0.4;
  font-size: 0.7rem;
}

.breadcrumb-current {
  color: var(--text);
  font-weight: 500;
}

/* Tool page header with icon */
.tool-page-header {
  margin-bottom: 1.5rem;
}

.tool-page-header-inner {
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
}

.tool-page-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: var(--accent-soft);
  font-size: 1.75rem;
  line-height: 1;
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

.tool-page-tag {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.tool-page-header h1 {
  margin: 0 0 0.4rem;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.tool-page-lead {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 40rem;
}

/* ============================================================
   TOOL PAGE — How It Works + FAQ
   ============================================================ */

.tool-content-section {
  margin-top: 2rem;
}

.tool-content-section h2 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tool-content-section h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.tool-content-section p {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.tool-content-section p:last-child {
  margin-bottom: 0;
}

.tool-content-section ul,
.tool-content-section ol {
  margin: 0 0 0.85rem;
  padding-left: 1.25rem;
}

.tool-content-section li {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 0.35rem;
}

.tool-content-section strong {
  color: var(--text);
  font-weight: 600;
}

/* Steps list */
.steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.steps-list li {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.step-num {
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.05rem;
}

/* FAQ accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
  border-bottom: none;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.15rem;
  background: transparent;
  border: none;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
  gap: 0.75rem;
}

.faq-question:hover {
  background: var(--bg-hover);
}

.faq-question svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.faq-item.is-open .faq-question svg {
  transform: rotate(180deg);
}

.faq-item.is-open .faq-question {
  color: var(--accent);
}

.faq-answer {
  display: none;
  padding: 0 1.15rem 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.65;
}

.faq-item.is-open .faq-answer {
  display: block;
}

/* Stats bar */
.tool-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
}

.tool-stat {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.tool-stat-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.tool-stat-value {
  font-weight: 700;
  color: var(--text);
  font-size: 0.9rem;
}