:root {
  --bg: #0e1a17;
  --bg-glow-a: rgba(226, 177, 74, 0.16);
  --bg-glow-b: rgba(70, 140, 120, 0.22);
  --bg-grad-top: #12241f;
  --bg-grad-bottom: #0a1210;
  --surface: rgba(20, 40, 34, 0.62);
  --surface-2: rgba(232, 240, 236, 0.05);
  --ink: #e8f0ec;
  --ink-muted: #9bb0a6;
  --ink-faint: rgba(155, 176, 166, 0.6);
  --accent: #e2b14a;
  --accent-hot: #f0c45a;
  --accent-ink: #1a1408;
  --accent-soft: rgba(226, 177, 74, 0.14);
  --line: rgba(232, 240, 236, 0.12);
  --line-strong: rgba(232, 240, 236, 0.24);
  --human: #6fbf8f;
  --mixed: #e2b14a;
  --ai: #ec8371;
  --danger: #e07a6a;
  --danger-ink: #f3c5bd;
  --track: rgba(232, 240, 236, 0.1);
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 20px 50px -24px rgba(0, 0, 0, 0.6);
  --seg-1: rgba(111, 191, 143, 0.16);
  --seg-2: rgba(232, 240, 236, 0.06);
  --seg-3: rgba(226, 177, 74, 0.24);
  --seg-4: rgba(236, 131, 113, 0.34);
  --noise-opacity: 0.35;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;
  --radius: 14px;
  --radius-sm: 8px;
  --max: 72rem;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f5f2ea;
  --bg-glow-a: rgba(214, 160, 50, 0.18);
  --bg-glow-b: rgba(70, 140, 120, 0.14);
  --bg-grad-top: #f8f5ee;
  --bg-grad-bottom: #ece7db;
  --surface: rgba(255, 253, 248, 0.82);
  --surface-2: rgba(20, 35, 30, 0.04);
  --ink: #14231e;
  --ink-muted: #56685f;
  --ink-faint: rgba(86, 104, 95, 0.65);
  --accent: #b9831a;
  --accent-hot: #a07014;
  --accent-ink: #fffaf0;
  --accent-soft: rgba(185, 131, 26, 0.12);
  --line: rgba(20, 35, 30, 0.1);
  --line-strong: rgba(20, 35, 30, 0.2);
  --human: #2e8a59;
  --mixed: #b9831a;
  --ai: #c4503c;
  --danger: #c4503c;
  --danger-ink: #8a2c1d;
  --track: rgba(20, 35, 30, 0.08);
  --shadow: 0 1px 2px rgba(20, 35, 30, 0.04), 0 18px 40px -26px rgba(20, 35, 30, 0.35);
  --seg-1: rgba(46, 138, 89, 0.13);
  --seg-2: rgba(20, 35, 30, 0.04);
  --seg-3: rgba(214, 160, 50, 0.24);
  --seg-4: rgba(196, 80, 60, 0.22);
  --noise-opacity: 0.18;
  color-scheme: light;
}

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

html {
  font-size: 17px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  position: relative;
  transition: background 0.3s ease, color 0.3s ease;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 55% at 15% -10%, var(--bg-glow-a), transparent 55%),
    radial-gradient(ellipse 70% 50% at 95% 10%, var(--bg-glow-b), transparent 50%),
    linear-gradient(165deg, var(--bg-grad-top) 0%, var(--bg) 45%, var(--bg-grad-bottom) 100%);
  pointer-events: none;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

/* ---------- Header / footer ---------- */

.site-header,
main,
.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.1rem;
  padding-bottom: 0.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--ink);
  text-decoration: none;
}

/* Logo: dark tile, light lens with a gold handle and an AI spark inside */
.logo-mark {
  width: 2.1rem;
  height: 2.1rem;
  flex-shrink: 0;
}
.logo-mark .lm-tile {
  fill: var(--ink);
}
.logo-mark .lm-lens {
  fill: none;
  stroke: var(--bg);
  stroke-width: 2.6;
}
.logo-mark .lm-handle {
  stroke: var(--accent);
  stroke-width: 3.4;
  stroke-linecap: round;
}
.logo-mark .lm-spark {
  fill: var(--accent);
  transform-origin: 14px 14px;
  transition: transform 0.4s ease;
}
.brand:hover .lm-spark {
  transform: rotate(90deg) scale(1.15);
}

.brand-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1;
}
.brand-word b {
  font-weight: inherit;
  color: var(--accent);
}
.brand-word small {
  font-size: 0.62em;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-muted);
  margin-left: 0.05em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.header-nav a:hover {
  color: var(--ink);
}

.icon-btn {
  appearance: none;
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-muted);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}

.icon-btn svg {
  width: 1.05rem;
  height: 1.05rem;
}

#theme-toggle .icon-moon,
:root[data-theme="light"] #theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="light"] #theme-toggle .icon-moon {
  display: block;
}

main {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.site-footer {
  padding-bottom: 2.5rem;
  color: var(--ink-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}

.site-footer p {
  margin: 0 0 0.3rem;
}

.footer-meta {
  color: var(--ink-faint);
}
.footer-meta a {
  color: var(--ink-muted);
}

/* ---------- Shared ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.card h2,
.how h2,
.history h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  margin: 0;
}

.card-note,
.section-note {
  color: var(--ink-muted);
  font-size: 0.9rem;
  margin: 0.35rem 0 0;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.btn-primary,
.btn-secondary {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0.75rem 1.4rem;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.2s ease, opacity 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.btn-primary svg,
.btn-secondary svg {
  width: 1.1rem;
  height: 1.1rem;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  box-shadow: 0 8px 22px -10px var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hot);
  transform: translateY(-1px);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary.is-loading {
  cursor: wait;
  opacity: 0.8;
}

.btn-primary.is-loading svg {
  display: none;
}

.btn-primary.is-loading::after {
  content: "";
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
}

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

.btn-secondary:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.link-btn {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-hot);
  cursor: pointer;
}

.link-btn:hover {
  text-decoration: underline;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.75em;
  padding: 0.1em 0.45em;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  background: var(--surface-2);
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger-ink);
  font-size: 0.95rem;
}

.alert small {
  display: block;
  margin-top: 0.35rem;
  opacity: 0.8;
}

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

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Home ---------- */

.home {
  display: grid;
  gap: 1.5rem;
}

.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 3rem;
  align-items: center;
  animation: rise 0.7s ease-out both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 1.1rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.live-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--human);
  box-shadow: 0 0 0 0 var(--human);
  animation: ping 2s ease-out infinite;
}

.hero-copy h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 4.4vw, 3.2rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin: 0;
}

.hero-copy h1 em {
  font-style: normal;
  font-weight: 700;
  color: var(--accent);
  position: relative;
}

.lede {
  margin: 1rem 0 0;
  color: var(--ink-muted);
  max-width: 44ch;
  font-size: 1.08rem;
}

.feature-list {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.feature-list li {
  display: grid;
  grid-template-columns: 3.8rem 1fr;
  align-items: baseline;
  gap: 0.75rem;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.feature-list strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--ink);
  font-weight: 700;
}

.detect-card {
  padding: 1.25rem;
  display: grid;
  gap: 1rem;
}

.tabs {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  justify-self: start;
}

.tab {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 0;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.tab svg {
  width: 1rem;
  height: 1rem;
}

.tab.is-active {
  background: var(--accent-soft);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent);
}

.panel {
  display: grid;
  gap: 0.75rem;
  animation: fade 0.25s ease both;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.toolbar-label {
  color: var(--ink-faint);
  font-size: 0.85rem;
  margin-left: 0.15rem;
}

.toolbar-sep {
  width: 1px;
  height: 1.2rem;
  background: var(--line);
  margin: 0 0.25rem;
}

.chip-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.chip-btn svg {
  width: 0.95rem;
  height: 0.95rem;
}

.chip-btn:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.chip-ghost {
  margin-left: auto;
  background: transparent;
  color: var(--ink-muted);
}

.detect-card textarea {
  width: 100%;
  resize: vertical;
  min-height: 8.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  color: var(--ink);
  font: inherit;
  line-height: 1.6;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Desktop: room for a longer text; phones keep the short field so the button stays on screen */
@media (min-width: 901px) {
  .detect-card textarea {
    min-height: 21rem;
  }
}

.detect-card textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.detect-card textarea::placeholder {
  color: var(--ink-faint);
}

.editor-stats {
  display: grid;
  gap: 0.45rem;
}

.stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.stats-row b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stat-hint {
  margin-left: auto;
  color: var(--ink-faint);
}

.stat-hint.is-warn {
  color: var(--accent-hot);
}

.stat-hint.is-ok {
  color: var(--human);
}

.stat-hint.is-over {
  color: var(--danger);
}

.meter {
  position: relative;
  height: 4px;
  border-radius: 999px;
  background: var(--track);
}

.meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.25s ease, background 0.25s ease;
}

.meter.is-ok i {
  background: var(--human);
}

.meter.is-over i {
  background: var(--danger);
}

.meter-mark {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 10px;
  border-radius: 1px;
  background: var(--line-strong);
}

.dropzone {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 3.25rem 1rem;
  text-align: center;
  cursor: pointer;
  background: var(--surface-2);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.dropzone:hover,
.dropzone:focus-visible,
.dropzone.is-dragover,
.detect-card.is-dragover .dropzone {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.dropzone.is-dragover {
  transform: scale(1.01);
}

.dropzone-icon {
  width: 2.4rem;
  height: 2.4rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.dropzone-title {
  margin: 0;
  font-weight: 600;
  font-size: 1.05rem;
}

.dropzone-hint {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.file-chip {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  animation: fade 0.25s ease both;
}

.file-ext {
  display: grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-hot);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
}

.file-meta {
  display: grid;
  min-width: 0;
  flex: 1;
}

.file-meta b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta small {
  color: var(--ink-muted);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.25rem;
}

.form-note {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.how {
  display: grid;
  gap: 1.5rem;
  scroll-margin-top: 2rem;
}

.how-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.how-steps li {
  padding: 1.25rem 1.25rem 1.4rem;
  border-top: 2px solid var(--line-strong);
}

.how-num {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.how-steps h3 {
  margin: 0.4rem 0 0.35rem;
  font-size: 1.05rem;
}

.how-steps p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.93rem;
}

.history {
  scroll-margin-top: 2rem;
}
.how-more-link {
  text-decoration: none;
}

/* How it works + blog posts side by side under the form, so they show without scrolling */
.home-more {
  display: grid;
  gap: 2.5rem;
}
@media (min-width: 1000px) {
  .home-more {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
  }
  .home-more .how {
    gap: 0.75rem;
  }
  .home-more .how h2,
  .home-more .blog-teaser h2 {
    font-size: 1.35rem;
  }
  .home-more .how-steps {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .home-more .how-steps li {
    display: grid;
    grid-template-columns: 2.2rem minmax(0, 1fr);
    column-gap: 0.5rem;
    padding: 0.45rem 0;
    border-top: 1px solid var(--line);
  }
  .home-more .how-num {
    grid-row: span 2;
    padding-top: 0.15rem;
  }
  .home-more .how-steps h3 {
    margin: 0 0 0.15rem;
    font-size: 1rem;
  }
  .home-more .how-steps p {
    font-size: 0.88rem;
    line-height: 1.45;
  }
  .home-more .blog-teaser {
    margin-top: 0;
  }
  .home-more .blog-teaser .section-head {
    margin-bottom: 0.75rem;
  }
  .home-more .blog-teaser .article-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }
  .home-more .blog-teaser .article-card {
    padding: 0.8rem 1.1rem 0.7rem;
    gap: 0.25rem;
  }
  .home-more .blog-teaser .article-card p {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.9rem;
  }
  .home-more .blog-teaser .article-meta {
    padding-top: 0.2rem;
    font-size: 0.82rem;
  }
}

.history-list {
  list-style: none;
  margin: 1.1rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.75rem;
}

.history-list a {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.9rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.history-list a:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.history-score {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
  background: conic-gradient(var(--tone) calc(var(--p) * 1%), var(--track) 0);
  position: relative;
}

.history-score::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--bg);
}

.history-score span {
  position: relative;
}

.history-snippet {
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-meta {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

/* ---------- History page (/historia) ---------- */

.history-page {
  display: grid;
  gap: 1.5rem;
  max-width: 52rem;
}
.history-page-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.history-item {
  display: grid;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
}
.history-open {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.3rem 0.9rem;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}
a.history-open:hover .history-snippet {
  color: var(--accent-hot);
}
.history-open.is-gone {
  opacity: 0.55;
}
.history-item-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}
.history-expiry {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-muted);
}
.history-expiry b {
  color: var(--ink);
}
.history-expiry small {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--ink-faint);
}
.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.history-actions .chip-ghost {
  margin-left: 0;
}
.chip-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  border-color: var(--line);
  background: var(--surface-2);
}
.chip-danger {
  color: var(--ai, #b4442b);
}
.chip-danger:hover {
  border-color: currentColor;
  background: transparent;
}
.history-empty {
  display: grid;
  gap: 0.6rem;
  justify-items: start;
  padding: 1.5rem;
}
.history-empty h2,
.history-empty p {
  margin: 0;
}
.history-page-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.history-page-foot .section-note {
  margin: 0;
  max-width: 60ch;
}

/* ---------- Result ---------- */

.result-page {
  display: grid;
  gap: 1.5rem;
  max-width: 62rem;
  margin: 0 auto;
  animation: rise 0.55s ease-out both;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.9rem;
}

.back-link svg {
  width: 1rem;
  height: 1rem;
}

.back-link:hover {
  color: var(--ink);
}

.result-header h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.15;
}

.result-header .lede {
  margin-top: 0.4rem;
  max-width: none;
}

.progress-card {
  padding: 1.25rem 1.4rem;
  display: grid;
  gap: 1rem;
}

.progress-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
}

.progress-pct {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.progress-summary {
  color: var(--ink-muted);
  font-size: 0.92rem;
}

.progress-time {
  margin-left: auto;
  color: var(--ink-muted);
}

.progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}

.progress-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--human), var(--accent));
  background-size: 200% 100%;
  animation: shimmer 2s linear infinite;
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem 2rem;
  align-items: start;
}

.progress-card.is-queued .progress-track i {
  width: 30% !important;
  animation: queue-slide 1.6s ease-in-out infinite;
  background: var(--accent);
}

@keyframes queue-slide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(340%); }
}

.progress-card.is-finished .progress-track i {
  animation: none;
  background: var(--human);
}

.progress-card.is-finished .progress-pct {
  font-size: 1.1rem;
  color: var(--human);
}

.progress-card.is-finished.is-collapsed .progress-body,
.progress-card.is-finished.is-collapsed .progress-track {
  display: none;
}

.progress-card.is-finished {
  order: 5;
}

.progress-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.15rem;
  counter-reset: step;
}

.progress-steps li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--ink-muted);
  font-size: 0.95rem;
  opacity: 0.5;
  transition: opacity 0.35s ease, color 0.35s ease, background 0.35s ease;
}

.progress-steps li.is-active,
.progress-steps li.is-done {
  opacity: 1;
  color: var(--ink);
}

.progress-steps li.is-active {
  background: var(--accent-soft);
}

.step-icon {
  display: grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  flex-shrink: 0;
}

.step-icon svg {
  width: 0.85rem;
  height: 0.85rem;
  stroke-width: 2.6;
}

.progress-steps li.is-done .step-icon {
  background: var(--human);
  border-color: var(--human);
  color: var(--bg);
}

.progress-steps li.is-active .step-icon {
  border-color: var(--accent);
  border-right-color: transparent;
  animation: spin 0.9s linear infinite;
}

.progress-steps li.is-active .step-icon span {
  animation: spin 0.9s linear infinite reverse;
}

.step-count {
  margin-left: auto;
  font-size: 0.75rem;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.tech-checks {
  list-style: none;
  margin: 0;
  padding: 0.25rem 0;
  display: grid;
  gap: 0.35rem;
  max-height: 22rem;
  overflow-y: auto;
  scrollbar-width: thin;
  mask-image: linear-gradient(transparent, #000 1.5rem, #000 calc(100% - 1.5rem), transparent);
}

.progress-card.is-finished .tech-checks {
  max-height: none;
  mask-image: none;
}

.tech-checks li {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.84rem;
  color: var(--ink-muted);
  opacity: 0.35;
  transition: opacity 0.25s ease, color 0.25s ease;
}

.tech-checks li.is-active,
.tech-checks li.is-done {
  opacity: 1;
}

.tech-checks li.is-active {
  color: var(--accent-hot);
}

.tech-checks li.is-done {
  color: var(--ink);
}

.tech-checks .dot {
  width: 0.4rem;
  height: 0.4rem;
  margin-top: 0.45rem;
  border-radius: 50%;
  border: 1px solid currentColor;
  flex-shrink: 0;
}

.tech-checks li.is-active .dot {
  background: var(--accent);
  border-color: var(--accent);
  animation: pulse 0.9s ease-in-out infinite;
}

.tech-checks li.is-done .dot {
  background: var(--human);
  border-color: var(--human);
}

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 1.25rem;
  animation: rise 0.5s ease-out both;
}

.verdict-card,
.signals-card,
.heatmap-card {
  padding: 1.5rem;
}

.verdict-card {
  --tone: var(--mixed);
  display: grid;
  justify-items: center;
  text-align: center;
  align-content: start;
}

.verdict-card[data-tone="human"] {
  --tone: var(--human);
}

.verdict-card[data-tone="ai"] {
  --tone: var(--ai);
}

.gauge {
  position: relative;
  width: min(100%, 17rem);
}

.gauge svg {
  display: block;
  width: 100%;
}

.gauge-track,
.gauge-fill {
  stroke-width: 14;
  stroke-linecap: round;
}

.gauge-track {
  stroke: var(--track);
}

.gauge-fill {
  stroke: var(--tone);
  stroke-dasharray: 0 100;
  transition: stroke-dasharray 1.2s cubic-bezier(0.22, 1, 0.36, 1), stroke 0.3s ease;
  filter: drop-shadow(0 0 8px color-mix(in srgb, var(--tone) 45%, transparent));
}

.gauge-value {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.4rem;
  font-family: var(--font-display);
  font-size: 3.6rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.gauge-value small {
  font-size: 0.4em;
  color: var(--ink-muted);
  margin-left: 0.05em;
}

.gauge-scale {
  display: flex;
  justify-content: space-between;
  padding: 0.35rem 0.4rem 0;
  font-size: 0.75rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.verdict-badge {
  margin: 1.1rem 0 0;
  padding: 0.35rem 0.95rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent);
}

.verdict-desc {
  margin: 0.8rem 0 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
  max-width: 32ch;
}

.verdict-meta {
  width: 100%;
  margin: 1.4rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.verdict-meta div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.verdict-meta dt {
  color: var(--ink-muted);
}

.verdict-meta dd {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.mini-meter {
  width: 5rem;
  height: 5px;
  border-radius: 999px;
  background: var(--track);
  overflow: hidden;
}

.mini-meter i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink-muted);
  border-radius: inherit;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.signals {
  display: grid;
  gap: 1.15rem;
  margin-top: 1.25rem;
}

.signal-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.98rem;
  margin-bottom: 0.4rem;
  font-weight: 600;
}

.signal-head b {
  font-variant-numeric: tabular-nums;
}

.signal-bar {
  position: relative;
  height: 0.5rem;
  background: var(--track);
  border-radius: 999px;
  overflow: hidden;
}

.signal-bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--human), var(--mixed) 55%, var(--ai));
  background-size: var(--bar-bg, 100%) 100%;
  border-radius: inherit;
  transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.signal-desc {
  margin: 0.35rem 0 0;
  font-size: 0.83rem;
  color: var(--ink-faint);
}

.metric-grid {
  margin: 1.4rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem 1rem;
}

.metric-grid div {
  display: grid;
  gap: 0.05rem;
}

.metric-grid dt {
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.metric-grid dd {
  margin: 0;
  font-size: 1rem;
  color: var(--ink);
}

.metric-grid small {
  font-size: 0.72rem;
  color: var(--ink-faint);
}

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

.warnings {
  margin: 1.4rem 0 0;
  padding: 1rem 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.88rem;
  display: grid;
  gap: 0.5rem;
}

.warnings li {
  display: flex;
  gap: 0.55rem;
}

.warnings li::before {
  content: "!";
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.12rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-hot);
  font-size: 0.72rem;
  font-weight: 700;
}

.verdict-chip {
  --tone: var(--mixed);
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: 0.1em;
  color: var(--tone);
  background: color-mix(in srgb, var(--tone) 14%, transparent);
}

.verdict-chip[data-tone="human"] { --tone: var(--human); }
.verdict-chip[data-tone="ai"] { --tone: var(--ai); }

.signal-meta {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.signal.is-error {
  opacity: 0.55;
}

.insights-card {
  grid-column: 1 / -1;
  padding: 1.5rem;
  display: grid;
  gap: 1.1rem;
}

.insights-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.insights-h {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ai);
}

.insights-h[data-kind="human"] {
  color: var(--human);
}

.insights {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.insights li {
  padding-left: 0.85rem;
  border-left: 2px solid var(--line-strong);
}

.insights section:first-child li,
.insights-cols section:first-child .insights li {
  border-left-color: color-mix(in srgb, var(--ai) 55%, transparent);
}

.insights-cols section:last-child .insights li {
  border-left-color: color-mix(in srgb, var(--human) 55%, transparent);
}

.insight-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.insight-model {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--ink-faint);
  white-space: nowrap;
}

.insights p {
  margin: 0.25rem 0 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.insights blockquote {
  margin: 0.5rem 0 0;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.88rem;
  font-style: italic;
}

.insights blockquote::before { content: "„"; }
.insights blockquote::after { content: "”"; }

.insights blockquote.is-linked {
  cursor: pointer;
  transition: background 0.2s ease;
}

.insights blockquote.is-linked:hover,
.insights blockquote.is-linked:focus-visible {
  background: var(--accent-soft);
}

.heatmap-text mark.is-flagged {
  text-decoration: underline dotted color-mix(in srgb, var(--ai) 70%, transparent);
  text-underline-offset: 0.25em;
}

@media (max-width: 720px) {
  .insights-cols {
    grid-template-columns: 1fr;
  }
}

.heatmap-card {
  grid-column: 1 / -1;
  display: grid;
  gap: 1rem;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.9rem;
  font-size: 0.8rem;
  color: var(--ink-muted);
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.seg-swatch {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 3px;
  border: 1px solid var(--line);
}

.seg-1 { background: var(--seg-1); }
.seg-2 { background: var(--seg-2); }
.seg-3 { background: var(--seg-3); }
.seg-4 { background: var(--seg-4); }

.segment-strip {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 4.5rem;
  padding: 0 0 0.25rem;
  border-bottom: 1px solid var(--line);
}

.segment-strip button {
  appearance: none;
  flex: 1 1 0;
  min-width: 4px;
  max-width: 2.5rem;
  border: 0;
  padding: 0;
  border-radius: 3px 3px 1px 1px;
  background: var(--tone, var(--mixed));
  opacity: 0.75;
  cursor: pointer;
  height: 0;
  transition: height 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.segment-strip button:hover,
.segment-strip button.is-hover {
  opacity: 1;
}

.heatmap-text {
  white-space: pre-wrap;
  line-height: 1.95;
  font-size: 1.02rem;
  max-height: 32rem;
  overflow-y: auto;
  padding: 0.25rem 0.5rem 0.25rem 0;
  scrollbar-width: thin;
}

.heatmap-text mark {
  color: inherit;
  padding: 0.12em 0.1em;
  border-radius: 4px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  cursor: help;
  transition: box-shadow 0.2s ease;
}

.heatmap-text mark.seg-1 { background: var(--seg-1); }
.heatmap-text mark.seg-2 { background: var(--seg-2); }
.heatmap-text mark.seg-3 { background: var(--seg-3); }
.heatmap-text mark.seg-4 { background: var(--seg-4); }

.heatmap-text mark.is-hover,
.heatmap-text mark:hover {
  box-shadow: 0 0 0 1.5px var(--accent);
}

.result-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.result-actions .btn-primary {
  margin-left: auto;
}

.error-panel {
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
  justify-items: start;
}

.error-panel p {
  margin: 0;
  color: var(--danger-ink);
}

.error-page {
  min-height: 60vh;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 1rem;
}

.error-code {
  margin: 0;
  font-size: 1rem;
  color: var(--accent);
}

.error-page h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 1rem);
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- Animations ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--human) 60%, transparent); }
  100% { box-shadow: 0 0 0 8px transparent; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .home-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    gap: 2rem;
    padding-top: 1rem;
  }

  .feature-list {
    display: none;
  }

  .result-grid,
  .progress-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .site-header,
  main,
  .site-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .header-nav a {
    display: none;
  }

  .how-steps {
    grid-template-columns: 1fr;
  }

  .detect-card {
    padding: 1rem;
  }

  .stat-hint {
    margin-left: 0;
    width: 100%;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .result-actions .btn-primary {
    margin-left: 0;
    width: 100%;
  }
}

/* ---------- Print ---------- */

@media print {
  :root {
    --bg: #fff;
    --ink: #111;
    --ink-muted: #444;
    --surface: #fff;
    --line: #ddd;
  }

  .atmosphere,
  .site-header,
  .back-link,
  .result-actions,
  .progress-card,
  .toast {
    display: none !important;
  }

  .card {
    box-shadow: none;
    backdrop-filter: none;
    break-inside: avoid;
  }

  .heatmap-text {
    display: none !important;
  }
  /* Higher specificity: the base .heatmap-excerpt rule comes later in the file */
  .heatmap-card .heatmap-excerpt {
    display: block;
  }
  .segment-strip {
    overflow: visible;
  }
  .segment-strip button {
    flex-shrink: 1;
    min-width: 1px;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ---------- Slow analysis notice ---------- */

.slow-notice {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-top: 1.1rem;
  padding: 1.15rem 1.3rem;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, var(--surface));
  animation: slow-in 0.4s ease-out;
}
.slow-notice[hidden] { display: none; }
.slow-notice strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  line-height: 1.3;
}
.slow-notice p { margin: 0.3rem 0 0; color: var(--ink-muted); }
.spinner {
  flex: none;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 4px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes slow-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2.5s; }
  .slow-notice { animation: none; }
}

/* ---------- Long texts: keep the heatmap inside its card ---------- */

.result-grid > *,
.heatmap-card > * {
  min-width: 0;
}
.segment-strip {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}
.segment-strip button {
  flex-shrink: 0;
}
.heatmap-text {
  max-height: min(32rem, 60vh);
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
}

/* ---------- Print / PDF excerpt ---------- */

.heatmap-excerpt {
  display: none;
  white-space: pre-wrap;
  line-height: 1.95;
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}
.excerpt-note {
  display: block;
  margin-top: 0.75rem;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--ink-muted);
}
.is-exporting .heatmap-text,
.is-exporting .back-link,
.is-exporting .result-actions,
.is-exporting .progress-card {
  display: none !important;
}
.is-exporting .heatmap-excerpt {
  display: block;
}
.is-exporting .segment-strip {
  overflow: visible;
}
.is-exporting .segment-strip button {
  flex-shrink: 1;
  min-width: 1px;
}
.is-exporting .card {
  backdrop-filter: none;
  box-shadow: none;
}

/* ---------- Locked observations (free preview) ---------- */

.insights li.is-locked {
  filter: blur(5px);
  opacity: 0.7;
  user-select: none;
  pointer-events: none;
}
.insights li.insights-more {
  border-left: 0;
  padding-left: 0;
  margin-top: -0.25rem;
}
.insights-more a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
}
.insights-more a::before {
  content: "";
  width: 0.7rem;
  height: 0.7rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='10' width='16' height='11' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3' fill='none' stroke='black' stroke-width='2.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='10' width='16' height='11' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3' fill='none' stroke='black' stroke-width='2.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.insights li.insights-empty {
  border-left-style: dashed;
}

/* ---------- Locked middle of the heatmap (free preview) ---------- */

.segment-strip button.is-locked {
  background: var(--line-strong);
  opacity: 0.45;
  filter: blur(1.5px);
  cursor: default;
  pointer-events: none;
}
.locked-block {
  position: relative;
  display: block;
  margin: 0.6rem 0;
}
.locked-text {
  display: block;
  filter: blur(5px);
  opacity: 0.6;
  user-select: none;
  pointer-events: none;
  max-height: 14rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 60%, transparent);
  mask-image: linear-gradient(#000 60%, transparent);
}
.locked-pill {
  position: absolute;
  z-index: 1;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink-muted);
  line-height: 1.4;
}
.locked-pill::before {
  content: "";
  width: 0.75rem;
  height: 0.75rem;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='10' width='16' height='11' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3' fill='none' stroke='black' stroke-width='2.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='4' y='10' width='16' height='11' rx='2'/%3E%3Cpath d='M8 10V7a4 4 0 0 1 8 0v3' fill='none' stroke='black' stroke-width='2.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.excerpt-note .locked-pill {
  position: static;
  transform: none;
  box-shadow: none;
  margin: 0 0.4rem;
}

/* ---------- History on the result page ---------- */

.result-page .history {
  margin-top: 2.5rem;
}
.is-exporting .history,
.is-exporting .blog-teaser {
  display: none !important;
}
@media print {
  .history,
  .blog-teaser {
    display: none !important;
  }
}

/* ---------- Blog posts teased on the home and result pages ---------- */

.blog-teaser {
  margin-top: 2.5rem;
}
.blog-teaser .section-head {
  margin-bottom: 1rem;
}
.blog-teaser h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
}
.blog-teaser .link-btn {
  text-decoration: none;
}

/* ---------- Locked extra signals (free preview) ---------- */

.signals-locked {
  position: relative;
  display: grid;
  gap: inherit;
}
.signal.is-locked {
  filter: blur(5px);
  opacity: 0.55;
  user-select: none;
  pointer-events: none;
}
.signals-locked .locked-pill {
  top: 50%;
  transform: translate(-50%, -50%);
}

/* Text longer than the analysed part: red banner above the result */
.truncated-notice {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--danger);
  border-radius: 12px;
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger-ink);
}

.truncated-notice[hidden] {
  display: none;
}

.truncated-notice svg {
  flex-shrink: 0;
  width: 1.3rem;
  height: 1.3rem;
  margin-top: 0.05rem;
  fill: none;
  stroke: var(--danger);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.truncated-notice p {
  margin: 0;
}

/* ---------- Links to the paid full report ---------- */

a.locked-pill,
.insights-more a {
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
a.locked-pill:hover,
.insights-more a:hover,
[data-upsell]:hover > a.locked-pill {
  color: var(--accent-hot);
  border-color: var(--accent);
  background: var(--surface);
}
.locked-block,
.signals-locked {
  cursor: pointer;
}
.truncated-notice a {
  color: inherit;
  font-weight: 600;
  text-underline-offset: 0.18em;
}

/* ---------- Full report offer (modal) ---------- */

.upsell {
  width: min(34rem, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--bg-grad-top);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.45);
  overflow: auto;
}
.upsell[open] {
  animation: upsell-in 0.28s ease-out both;
}
.upsell::backdrop {
  background: rgba(10, 18, 16, 0.5);
  backdrop-filter: blur(4px);
}
@keyframes upsell-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}
.upsell-inner {
  position: relative;
  padding: 2rem 1.75rem 1.5rem;
  background:
    radial-gradient(28rem 12rem at 85% -10%, var(--bg-glow-a), transparent 70%),
    radial-gradient(22rem 10rem at 0% 0%, var(--bg-glow-b), transparent 70%);
}
.upsell-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-muted);
  cursor: pointer;
}
.upsell-close:hover {
  color: var(--ink);
}
.upsell svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.upsell-close svg {
  width: 1.1rem;
  height: 1.1rem;
}
.upsell-head h2 {
  margin: 0.8rem 0 0.4rem;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.upsell-head p {
  margin: 0;
  color: var(--ink-muted);
}
.upsell-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.upsell-badge svg {
  width: 0.95rem;
  height: 0.95rem;
}
.upsell-perks {
  list-style: none;
  margin: 1.4rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}
.upsell-perks li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}
.upsell-perks li.is-focus {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.upsell-perks li > svg {
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0.2rem;
  border-radius: 50%;
  background: var(--human);
  color: #fff;
  stroke-width: 3;
  margin-top: 0.1rem;
}
.upsell-perks b {
  display: block;
  font-weight: 600;
}
.upsell-perks span {
  display: block;
  color: var(--ink-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}
.upsell-gift {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
}
.upsell-gift svg {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
  color: var(--accent);
  fill: var(--accent);
}
.upsell-gift p {
  margin: 0;
  font-size: 0.93rem;
}
.upsell-buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.4rem;
}
.upsell-price {
  margin: 0;
  display: grid;
}
.upsell-price b {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1;
}
.upsell-price span {
  color: var(--ink-muted);
  font-size: 0.85rem;
}
.upsell-price .upsell-promo {
  order: -1;
  margin-bottom: 0.2rem;
  color: var(--ai);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
}
.upsell-promo s {
  color: var(--ink-muted);
  font-weight: 500;
  text-transform: none;
  margin-right: 0.3rem;
}
.upsell-price .upsell-omnibus {
  font-size: 0.75rem;
  color: var(--ink-faint);
}
.upsell-cta {
  flex: 1 1 14rem;
  justify-content: center;
  font-size: 1.05rem;
  padding: 0.95rem 1.4rem;
}
.upsell-cta svg {
  width: 1.15rem;
  height: 1.15rem;
  transition: transform 0.2s;
}
.upsell-cta:hover svg {
  transform: translateX(3px);
}
.upsell-soon {
  margin: 0.9rem 0 0;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: var(--surface-2);
  font-weight: 600;
  text-align: center;
}
.upsell-fine {
  margin: 0.8rem 0 0;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.82rem;
}

/* ---------- Report header in print and PDF ---------- */

.report-brand {
  display: none;
  align-items: center;
  gap: 0.55rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}
.report-brand-meta {
  margin-left: auto;
  color: var(--ink-muted);
  font-size: 0.9rem;
}
.is-exporting .report-brand {
  display: flex;
}
@media print {
  .report-brand {
    display: flex;
  }
  .upsell {
    display: none !important;
  }
}
/* The buy row stays in view while the perks scroll on small screens */
@media (max-width: 640px) {
  .upsell-inner {
    padding: 1.6rem 1.15rem 1.2rem;
  }
  .upsell-buy {
    position: sticky;
    bottom: -1.2rem;
    margin: 1.2rem -1.15rem -1.2rem;
    padding: 0.9rem 1.15rem 1.1rem;
    background: var(--bg-grad-top);
    border-top: 1px solid var(--line);
  }
  .upsell-price b {
    font-size: 1.6rem;
  }
  .upsell-cta {
    flex-basis: 10rem;
    padding: 0.75rem 1.2rem;
  }
  .upsell-ctas {
    gap: 0.45rem;
  }
}

/* PDF export: one fixed layout whatever the window (EXPORT_WIDTH in app.js) */
.is-exporting .result-page {
  width: 1000px;
  max-width: none;
  animation: none;
}
.is-exporting main {
  max-width: none;
  overflow: hidden;
}

/* ---------- Content pages: guide, articles, legal ---------- */

.how-more {
  margin: 0;
}
.how-more a,
.prose a {
  color: var(--accent-hot);
  text-underline-offset: 0.18em;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  margin: 0.9rem 0 0.6rem;
  font-size: 0.92rem;
}
.footer-links a {
  color: var(--ink-muted);
  text-decoration: none;
}
.footer-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.guide,
.article,
.legal {
  max-width: 46rem;
  margin: 0 auto;
  display: grid;
  gap: 2rem;
  animation: rise 0.5s ease-out both;
}
.guide {
  max-width: 62rem;
}
.page-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: -0.025em;
  line-height: 1.1;
}
.page-head .lede {
  max-width: 52ch;
}
.article-meta {
  margin: 0.8rem 0 0;
  color: var(--ink-faint);
  font-size: 0.88rem;
}

.article-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.article-list.is-compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.article-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  height: 100%;
  padding: 1.4rem 1.4rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.article-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.article-card h2,
.article-card h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.25;
}
.article-card h3 {
  font-size: 1.05rem;
}
.article-card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}
.article-card .article-meta {
  margin-top: auto;
  padding-top: 0.4rem;
  color: var(--accent-hot);
  font-weight: 600;
}
.article-num {
  color: var(--ink-faint);
  font-size: 0.85rem;
}

.guide-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1.5rem 1.75rem;
}
.guide-cta h2 {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}
.guide-cta p {
  margin: 0;
  color: var(--ink-muted);
  max-width: 48ch;
}
.related h2 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

/* Long-form text */
.prose {
  font-size: 1.06rem;
  line-height: 1.7;
}
.prose > :first-child {
  margin-top: 0;
}
.prose h1 {
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.prose h2 {
  margin: 2.2rem 0 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.45rem;
  line-height: 1.25;
}
.prose h3 {
  margin: 1.5rem 0 0.4rem;
  font-size: 1.08rem;
}
.prose p,
.prose ul,
.prose ol,
.prose table {
  margin: 0 0 1rem;
}
.prose ul,
.prose ol {
  padding-left: 1.4rem;
}
.prose li {
  margin-bottom: 0.4rem;
}
.prose li > ol {
  margin-top: 0.4rem;
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--surface-2);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
  line-height: 1.5;
  display: block;
  overflow-x: auto;
}
.prose th,
.prose td {
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.prose th {
  color: var(--ink-muted);
  font-weight: 600;
}
.article-note,
.legal-callout {
  padding: 1rem 1.2rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft);
}
.legal-callout {
  margin: 0 0 1rem;
}
.legal-callout p {
  margin: 0;
}
.legal-form {
  margin: 0 0 1rem;
  padding: 1rem 1.2rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-sm);
}
.legal-form p {
  margin: 0 0 0.6rem;
  overflow-wrap: anywhere;
}
.legal-form p:last-child {
  margin: 0;
}
.legal-date {
  color: var(--ink-faint);
  font-size: 0.92rem;
}

.legal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.legal-nav a {
  padding: 0.35rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.legal-nav a[aria-current="page"] {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 600;
}

@media (max-width: 720px) {
  .article-list,
  .article-list.is-compact {
    grid-template-columns: minmax(0, 1fr);
  }
  .prose {
    font-size: 1rem;
  }
}
/* Grid items default to min-width: auto, so a wide table would stretch the column */
.guide > *,
.article > *,
.legal > * {
  min-width: 0;
}

/* ---------- Paid report: order form, voucher, payment pages ---------- */

.signals-full {
  display: grid;
  gap: inherit;
}
.signals-full[hidden],
.signals-locked[hidden] {
  display: none;
}
.upsell-form {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.2rem;
}
.upsell-field {
  display: grid;
  gap: 0.3rem;
  font-weight: 600;
  font-size: 0.92rem;
}
.upsell-field input,
.upsell-voucher input {
  width: 100%;
  min-width: 0;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-weight: 400;
}
.upsell-field input:focus,
.upsell-voucher input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.upsell-check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.55rem;
  align-items: start;
  font-size: 0.85rem;
  color: var(--ink-muted);
}
.upsell-check input {
  margin-top: 0.2rem;
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--accent);
}
.upsell-check a {
  color: inherit;
}
.upsell-form .upsell-buy {
  margin-top: 0.4rem;
}
.upsell-ctas {
  flex: 1 1 15rem;
  display: grid;
  gap: 0.6rem;
}
/* Same size as the pay button, the ink colour instead of gold */
.btn-primary.upsell-cta-code {
  background: var(--ink);
  color: var(--bg, #fff);
  box-shadow: 0 8px 22px -12px var(--ink);
}
.btn-primary.upsell-cta-code:hover {
  background: var(--human);
  color: #fff;
}
.upsell-step[hidden],
.upsell-voucher[hidden] {
  display: none;
}
.upsell-voucher {
  display: grid;
  gap: 0.7rem;
  margin-top: 1.2rem;
}
.upsell-voucher h3 {
  margin: 0;
  font-size: 1.15rem;
}
.upsell-voucher p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.92rem;
}
.upsell-back {
  appearance: none;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem 0.35rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-muted);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.upsell-back:hover {
  color: var(--ink);
  border-color: var(--ink-muted);
}
.upsell-back svg {
  width: 1.05rem;
  height: 1.05rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.upsell-voucher-form {
  display: grid;
  gap: 0.6rem;
}
.upsell-code-error {
  margin: -0.2rem 0 0;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  background: rgba(200, 60, 50, 0.1);
  color: var(--danger-ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}
.upsell-code-error[hidden] {
  display: none;
}
.upsell-voucher-form input[aria-invalid="true"] {
  border-color: var(--danger);
}
.upsell-voucher-form input {
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  font-size: 1.1rem;
}
.purchase-code {
  grid-column: 1 / -1;
  padding: 1rem 1.2rem;
  border: 1px dashed var(--accent);
  border-radius: 14px;
  background: var(--accent-soft);
}
.purchase-code p {
  margin: 0;
}
.purchase-code-label {
  font-weight: 600;
}
.purchase-code-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin: 0.5rem 0 !important;
}
.purchase-code code {
  font-family: var(--font-mono, monospace);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  user-select: all;
}
.purchase-code-note {
  color: var(--ink-muted);
  font-size: 0.9rem;
}
.purchase-code-note b {
  color: var(--ink);
}
.upsell-field em {
  font-style: normal;
  font-weight: 400;
  color: var(--ink-muted);
}
.upsell-check[hidden] {
  display: none;
}
.upsell-check.is-attention {
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--ink);
  animation: rise 0.3s ease-out both;
}
@media print {
  .purchase-code {
    display: none;
  }
}
.is-exporting .purchase-code {
  display: none;
}
.full-report-banner {
  align-items: center;
  color: var(--ink);
  border-color: var(--human);
  background: var(--seg-1);
}
.full-report-banner p {
  margin: 0;
}
.payment-page .lede {
  margin: 0;
  color: var(--ink-muted);
  max-width: 36rem;
}
.payment-page form {
  margin: 0;
}

/* ---------- Blog ---------- */

.blog-empty {
  padding: 1.5rem 1.35rem;
  display: grid;
  gap: 0.75rem;
}

.blog-empty h2 {
  margin: 0;
  font-family: var(--font-display, "Fraunces", Georgia, serif);
  font-size: 1.35rem;
  font-weight: 500;
}

.blog-empty p {
  margin: 0;
  color: var(--ink-muted);
}

.blog-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.35rem !important;
}

.blog-list .blog-card {
  display: grid;
  gap: 0.85rem;
}

.blog-card-media {
  display: block;
  border-radius: var(--radius, 4px);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: rgba(0, 0, 0, 0.06);
}

.blog-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-card-body {
  display: grid;
  gap: 0.35rem;
}

.blog-hero {
  margin: 0 0 1.5rem;
  border-radius: var(--radius, 4px);
  overflow: hidden;
}

.blog-hero img {
  width: 100%;
  height: auto;
  display: block;
}

/* Breadcrumbs + FAQ */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  align-items: center;
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}
.breadcrumbs a {
  color: var(--ink-muted);
  text-decoration: none;
}
.breadcrumbs a:hover {
  color: var(--accent-hot);
}
.breadcrumbs span:last-child {
  color: var(--ink-muted);
  max-width: 40ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0 0 2rem;
}
.faq-item {
  border: 1px solid var(--line, rgba(0,0,0,.08));
  border-radius: 10px;
  background: var(--surface, #fff);
  padding: 0.15rem 1rem 0.15rem;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.85rem 0;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--ink-faint);
  font-weight: 500;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item p {
  margin: 0 0 1rem;
  color: var(--ink-muted);
  max-width: 65ch;
}

/* ---------- Promotion bar (layout.php, Promo::current) ---------- */

.promo-bar {
  position: relative;
  z-index: 30;
  background: linear-gradient(90deg, #d7341f, #f0631c 55%, #f39a1d);
  color: #fff;
  cursor: default;
  outline: none;
}
.promo-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.3rem 0.7rem;
  margin: 0;
  padding: 0.42rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}
.promo-line b {
  font-weight: 800;
  letter-spacing: 0.04em;
}
.promo-bar code {
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.05rem 0.4rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.22);
  user-select: all;
}
.promo-pill {
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: #fff;
  color: #d7341f;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  animation: promo-pulse 1.6s ease-in-out infinite;
}
@keyframes promo-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
  50% { box-shadow: 0 0 0 5px rgba(255, 255, 255, 0); }
}
.promo-more {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.9;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
.promo-more svg {
  width: 0.9rem;
  height: 0.9rem;
  stroke: currentColor;
  stroke-width: 2.4;
  transition: transform 0.2s;
}
.promo-details {
  position: absolute;
  top: 100%;
  left: 50%;
  width: min(30rem, calc(100vw - 2rem));
  transform: translate(-50%, -4px);
  padding: 1rem 1.15rem 0.9rem;
  border-radius: 0 0 14px 14px;
  border: 1px solid var(--line);
  border-top: 3px solid #f0631c;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.45);
  font-size: 0.9rem;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}
.promo-bar:hover .promo-details,
.promo-bar:focus-within .promo-details {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
.promo-bar:hover .promo-more svg,
.promo-bar:focus-within .promo-more svg {
  transform: rotate(180deg);
}
.promo-details p,
.promo-details ol {
  margin: 0 0 0.55rem;
}
.promo-details ol {
  padding-left: 1.2rem;
}
.promo-details li {
  margin: 0.15rem 0;
}
.promo-details code {
  background: var(--accent-soft);
  color: var(--ink);
}
.promo-details a {
  color: inherit;
}
.promo-fine {
  color: var(--ink-muted);
  font-size: 0.8rem;
  margin-bottom: 0 !important;
}
@media (prefers-reduced-motion: reduce) {
  .promo-pill {
    animation: none;
  }
}
@media print {
  .promo-bar {
    display: none;
  }
}
.is-exporting .promo-bar {
  display: none;
}

/* ---------- Image analyses ---------- */

.tab-new {
  margin-left: 0.15rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
@media (max-width: 520px) {
  .tabs {
    justify-self: stretch;
  }
  .tab {
    flex: 1 1 0;
    justify-content: center;
    padding: 0.45rem 0.55rem;
    font-size: 0.85rem;
  }
  .tab svg,
  .tab-new {
    display: none;
  }
}

.image-chip {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  animation: fade 0.25s ease both;
}
#image-preview {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: 8px;
  background: var(--accent-soft);
  flex: none;
}
.panel-note {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.history-thumb {
  width: 1.6rem;
  height: 1.6rem;
  object-fit: cover;
  border-radius: 4px;
  margin-right: 0.45rem;
  vertical-align: middle;
}

.image-card,
.meta-card {
  grid-column: 1 / -1;
  padding: 1.5rem;
  display: grid;
  gap: 1rem;
}
.image-stage {
  margin: 0;
  display: grid;
  justify-items: center;
  gap: 0.6rem;
}
.image-frame {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}
#image-view {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  height: auto;
}
.image-boxes {
  position: absolute;
  inset: 0;
}
.image-box {
  --box: var(--ai);
  position: absolute;
  padding: 0;
  border: 2px solid var(--box);
  border-radius: 6px;
  background: color-mix(in srgb, var(--box) 10%, transparent);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.image-box.is-human {
  --box: var(--human);
}
.image-box:hover,
.image-box:focus-visible,
.image-box.is-focus {
  background: color-mix(in srgb, var(--box) 26%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--box) 45%, transparent);
  outline: none;
}
.image-box.is-focus {
  animation: box-pulse 0.7s ease 3;
}
@keyframes box-pulse {
  50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--box) 35%, transparent); }
}
.box-num {
  display: inline-grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font: 700 0.75rem/1 var(--font-body);
  font-style: normal;
}
.image-box .box-num {
  position: absolute;
  top: 2px;
  left: 2px;
  background: var(--box);
  color: #fff;
}
.box-swatch {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 3px;
  border: 2px solid var(--ai);
}
.box-swatch.is-human {
  border-color: var(--human);
}
.image-locked {
  margin: 0;
  text-align: center;
}
.image-locked .locked-pill {
  position: static;
  transform: none;
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
.insights blockquote.insight-region {
  font-style: normal;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.insights blockquote.insight-region::before,
.insights blockquote.insight-region::after {
  content: none;
}
.insights blockquote.is-hover {
  background: var(--accent-soft);
}
.signal.is-na b {
  color: var(--ink-faint);
  font-weight: 500;
}

.meta-flags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.meta-flag {
  --flag: var(--ink-muted);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--flag);
  background: color-mix(in srgb, var(--flag) 9%, transparent);
  font-size: 0.92rem;
}
.meta-flag.is-ai { --flag: var(--ai); font-weight: 600; }
.meta-flag.is-mixed { --flag: var(--mixed); }
.meta-flag.is-human { --flag: var(--human); }
.meta-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 0.8rem 1rem;
}
.meta-grid div {
  display: grid;
  gap: 0.1rem;
}
.meta-grid dt {
  font-size: 0.78rem;
  color: var(--ink-muted);
}
.meta-grid dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* ---------- Ads (AdSense auto ads) ---------- */

.footer-links .footer-privacy {
  font: inherit;
  font-weight: inherit;
  color: var(--ink-muted);
  cursor: pointer;
}
.footer-links .footer-privacy:hover {
  color: var(--ink);
  text-decoration: underline;
}
/* Reports are printed and exported without ads */
@media print {
  ins.adsbygoogle,
  .google-auto-placed,
  .adsbygoogle {
    display: none !important;
  }
}
.is-exporting ins.adsbygoogle,
.is-exporting .google-auto-placed {
  display: none !important;
}
.link-btn.inline-link {
  font-size: inherit;
  font-weight: inherit;
  text-decoration: underline;
}
