@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/sora-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/sora-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/sora-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/sora-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro-latin-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro-vietnamese-400.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro-vietnamese-500.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro-vietnamese-600.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro-latin-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Be Vietnam Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/static/fonts/be-vietnam-pro-vietnamese-700.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}


@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-vietnamese-400.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-vietnamese-500.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/ibm-plex-mono-vietnamese-600.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}


:root {
  --brand: #1e293b;
  --accent: #a3e635;
  --brand-dark: #0b1120;
  --brand-tint: #eef2f7;
  --brand-on-dark: #a3e635;
  --ok: #7ae0a8;
  --ink: #0f172a;
  --body: #334155;
  --muted: #64748b;
  --panel: #f5f7fa;
  --placeholder: #e2e8f0;
  --surface: #ffffff;
  --line: rgba(15, 23, 42, 0.14);
  --line-soft: rgba(15, 23, 42, 0.09);
  --line-on-brand: rgba(255, 255, 255, 0.16);
  --danger: #b3261e;
  --font: "Sora", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --radius-card: 20px;
  --radius-panel: 16px;
  --radius-field: 14px;
  --radius-row: 12px;
  --radius-chip: 10px;
  --radius-pill: 999px;
  --shadow-card: 0 18px 44px rgba(15, 23, 42, 0.14);
  --col-tool: 780px;
  --col-prose: 720px;
  --radius: 12px;
}

html:lang(vi) {
  --font: "Be Vietnam Pro", system-ui, -apple-system, sans-serif;
}

[lang="vi"]:not(html) {
  font-family: "Be Vietnam Pro", system-ui, -apple-system, sans-serif;
}

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

html {
  font-family: var(--font);
  background: var(--surface);
  color: var(--ink);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--brand);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--brand);
  border-bottom: 1px solid var(--line-on-brand);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 30px;
  padding: 18px 44px;
  max-width: calc(var(--col-tool) + 88px);
  margin: 0 auto;
  width: 100%;
}

.wordmark {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.02em;
}

.wordmark {
  display: inline-flex;
  /* The logo has dark lettering, so it sits on a white pill over the red header band. */
  background: #fff;
  border-radius: 8px;
  padding: 4px 10px;
  margin-block: -4px;
  overflow: hidden;
}

.wordmark__logo {
  display: block;
  height: 24px;
  width: auto;
  /* Pull the image into the 16px line box the text wordmark used, so the header keeps its height. */
  margin-block: -4px;
  /* logo.png keeps empty space after the lettering; trim it so the pill hugs the wordmark. */
  margin-right: -40px;
}

.wordmark__tld {
  color: var(--brand-on-dark);
  font-weight: 700;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 24px;
  flex: 1 1 auto;
}

.site-nav__link {
  display: inline-flex;
  flex-direction: column;
  color: rgba(255, 255, 255, 0.95);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  line-height: 1;
  /* Reserve the active underline on every link so switching pages never moves anything. */
  border-bottom: 2px solid transparent;
  padding-bottom: 3px;
  /* Mirror the underline space above so the label's optical center matches the logo and badge. */
  padding-top: 5px;
  margin-block: -3px;
}

/* Hidden bold copy of the label reserves the active (600) width at all times. */
.site-nav__link::after {
  content: attr(data-label);
  font-weight: 600;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

.site-nav a[aria-current="page"],
.site-nav__link[aria-current="page"] {
  color: #fff;
  font-weight: 600;
  border-bottom-color: #fff;
}

.health-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
  font-size: 12px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.95);
}

.health-badge__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  display: inline-block;
}

.health-badge--ok .health-badge__dot {
  background: var(--ok);
}

.health-badge--unknown .health-badge__dot {
  background: rgba(255, 255, 255, 0.4);
}

.hero {
  background: var(--brand);
  color: #fff;
}

.hero__inner {
  max-width: var(--col-tool);
  margin: 0 auto;
  padding: 54px 20px 76px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 14px;
  font-weight: 600;
  font-size: 46px;
  line-height: 1.05;
  letter-spacing: -0.035em;
  color: #fff;
}

.hero__lede {
  margin: 0 auto 30px;
  max-width: 52ch;
  font-weight: 400;
  font-size: 15.5px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.95);
}

.hero .eyebrow {
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 12px;
}

.hero--compact .hero__inner {
  max-width: var(--col-prose);
  padding: 46px 20px 40px;
  text-align: left;
}

.hero--compact h1 {
  margin-bottom: 12px;
  font-size: 42px;
}

.hero--compact .eyebrow {
  font-weight: 500;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}

.hero--compact .hero__lede {
  margin: 0;
  max-width: none;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.pill {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11.5px;
  line-height: 1;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-pill);
  padding: 8px 12px;
}

.content-col {
  max-width: var(--col-tool);
  margin: 0 auto;
  width: 100%;
  padding: 32px 20px 56px;
}

.content-col--prose {
  max-width: var(--col-prose);
}

.panel {
  background: var(--panel);
  border-radius: var(--radius-panel);
  padding: 24px 26px;
}

.eyebrow {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  font-weight: 500;
  font-size: 13px;
  line-height: 1;
  color: var(--brand);
  background: var(--brand-tint);
  border-radius: var(--radius-chip);
  padding: 11px 14px;
  text-decoration: none;
}

.legal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  background: var(--panel);
  border-radius: 14px;
  padding: 14px 18px;
  font-weight: 400;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
}

.legal-meta p {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

.legal-meta__date {
  font-family: var(--font-mono);
  color: var(--ink);
}

.legal-translation-note {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}

.legal-index {
  margin: 22px 0 8px;
}

.legal-section {
  margin-top: 34px;
  scroll-margin-top: 88px;
}

/* Beats `.content-col--prose p`, which would otherwise restyle the label as body text. */
.content-col--prose .eyebrow,
.legal-section .eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.legal-section h2 {
  margin: 0 0 12px;
  font-weight: 600;
  font-size: 22px;
  line-height: 1.3;
}

.content-col--prose p,
.legal-section p {
  margin: 0 0 12px;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.75;
  color: var(--body);
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}

.legal-list li {
  position: relative;
  padding-left: 22px;
  margin: 0 0 8px;
  font-weight: 400;
  font-size: 15px;
  line-height: 1.75;
  color: var(--body);
}

.legal-list li:last-child {
  margin-bottom: 0;
}

.legal-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--brand);
}

.legal-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 24px 26px;
}

.legal-card .chip-row {
  margin-top: 16px;
}

.overlap-card {
  position: relative;
  z-index: 1;
  margin-top: 18px;
  scroll-margin-top: 88px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  background: var(--surface);
}

.ph {
  background-color: var(--placeholder);
  background-image: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 8px,
    rgba(15, 23, 42, 0.04) 8px,
    rgba(15, 23, 42, 0.04) 16px
  );
}

.site-main {
  flex: 1;
  padding: 20px;
}

.site-main--tool {
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.site-main--tool .flash,
.site-main--prose .flash {
  max-width: var(--col-tool);
  margin: 0 auto;
  padding: 12px 20px;
}

/* Prose pages (legal, errors) also open with a full-bleed hero band, so the
   main element stays full width and .content-col--prose sets the column. */
.site-main--prose {
  max-width: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

h1 {
  font-size: 32px;
  line-height: 1.2;
  margin: 0 0 16px;
}

.lede {
  font-size: 18px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 16px;
}

.flash:empty {
  display: none;
}

.flash {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.hero-form {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: stretch;
  gap: 10px;
  max-width: 640px;
  height: 58px;
  margin: 0 auto;
}

.hero-form__field {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.hero-form__input {
  display: block;
  width: 100%;
  height: 58px;
  padding: 0 88px 0 18px;
  border: 0;
  border-radius: var(--radius-field);
  background: #fff;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}

.hero-form__paste {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--brand-tint);
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}

.hero-form__submit {
  flex: 0 0 auto;
  height: 58px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-field);
  background: var(--brand-dark);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}

.hero-form__submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.hero-form .extract-status {
  position: absolute;
  left: 50%;
  top: calc(100% + 14px);
  transform: translateX(-50%);
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
}

.extract-status__dots {
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
  height: 14px;
}

.extract-status__dots i {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: extract-bounce 0.9s infinite ease-in-out;
}

.extract-status__dots i:nth-child(2) {
  animation-delay: 0.15s;
}

.extract-status__dots i:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes extract-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  40% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator,
.extract-status.extract-status--active {
  display: block;
}

/* Staged loader. data-step on #extract-status names the running step; the
   steps before it read as done, the ones after it as pending. */
.extract-status {
  margin: 16px 0 0;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  text-align: left;
}

.extract-status__bar {
  height: 4px;
  background: var(--placeholder);
}

.extract-status__bar span {
  display: block;
  height: 100%;
  width: 8%;
  background: var(--brand);
  transition: width 0.4s ease-out;
}

.extract-status[data-step="fetching"] .extract-status__bar span {
  animation: extract-bar 6s ease-out forwards;
}

.extract-status[data-step="listing"] .extract-status__bar span {
  width: 94%;
}

.extract-status__steps {
  list-style: none;
  margin: 0;
  padding: 20px 22px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.extract-status__step {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.extract-status__icon {
  flex: none;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--placeholder);
}

.extract-status__path {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
}

/* pending: everything after the running step */
.extract-status[data-step="recognised"] [data-step-name="fetching"],
.extract-status[data-step="recognised"] [data-step-name="listing"],
.extract-status[data-step="fetching"] [data-step-name="listing"] {
  opacity: 0.45;
}

/* running */
.extract-status[data-step="recognised"] [data-step-name="recognised"] .extract-status__icon,
.extract-status[data-step="fetching"] [data-step-name="fetching"] .extract-status__icon,
.extract-status[data-step="listing"] [data-step-name="listing"] .extract-status__icon {
  border-top-color: var(--brand);
  animation: extract-spin 0.8s linear infinite;
}

/* done */
.extract-status[data-step="fetching"] [data-step-name="recognised"] .extract-status__icon,
.extract-status[data-step="listing"] [data-step-name="recognised"] .extract-status__icon,
.extract-status[data-step="listing"] [data-step-name="fetching"] .extract-status__icon {
  border: 0;
  background: #16a34a;
}

.extract-status[data-step="fetching"] [data-step-name="recognised"] .extract-status__icon::after,
.extract-status[data-step="listing"] [data-step-name="recognised"] .extract-status__icon::after,
.extract-status[data-step="listing"] [data-step-name="fetching"] .extract-status__icon::after {
  content: "";
  display: block;
  width: 5px;
  height: 9px;
  margin: 3px 0 0 6.5px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.extract-status__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 22px 0;
  padding: 13px 0 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px;
  color: var(--muted);
}

.extract-status__cancel {
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--brand);
  cursor: pointer;
}

.extract-status__cancel:hover {
  color: var(--brand-dark);
}

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

@keyframes extract-bar {
  from {
    width: 20%;
  }
  60% {
    width: 64%;
  }
  to {
    width: 82%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .extract-status__icon {
    animation-duration: 2.4s !important;
  }
  .extract-status__bar span {
    animation: none !important;
    width: 50%;
  }
}

.hero__inner:has(.extract-status--active) .pill-row,
.hero__inner:has(.htmx-request) .pill-row,
.hero__inner:has(#extract-result:not(:empty)) .pill-row {
  visibility: hidden;
}

.extract-card {
  margin-top: 16px;
  padding: 20px 22px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--line);
}

.extract-card--error {
  border-color: var(--danger);
  border-left: 4px solid var(--danger);
}

.extract-card__message {
  color: var(--danger);
  margin: 0;
}

#extract-result:empty {
  display: none;
}

#extract-result:not(:empty) {
  text-align: left;
  margin-bottom: -46px;
}

.site-footer {
  background: var(--brand-dark);
  color: rgba(255, 255, 255, 0.62);
}

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  row-gap: 16px;
  max-width: var(--col-tool);
  margin: 0 auto;
  padding: 20px 20px;
  width: 100%;
  font-size: 12.5px;
  line-height: 1;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 0;
}

.site-footer__links a {
  color: rgba(255, 255, 255, 0.62);
  text-decoration: none;
}

.site-footer__links a:hover {
  text-decoration: underline;
  color: #fff;
}

.site-footer__group {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  width: 100%;
}

.site-footer__heading {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 600;
}

.site-footer__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  line-height: 1.4;
}

.site-footer__tools a {
  color: rgba(255, 255, 255, 0.62);
  text-decoration: none;
}

.site-footer__tools a:hover {
  text-decoration: underline;
  color: #fff;
}

.site-footer__note {
  margin: 0;
}

.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;
}

.result-card {
  background: var(--surface);
  text-align: left;
}

.result-card__media {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.result-card__thumb {
  display: block;
  flex: none;
  width: 112px;
  height: 63px;
  object-fit: cover;
  border-radius: 9px;
  border: 1px solid var(--line-soft);
  background: var(--placeholder);
}

.result-card__media--portrait .result-card__thumb {
  width: 64px;
  height: 84px;
}

.result-card__copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-card__title {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.result-card__meta {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.result-card__meta:empty {
  display: none;
}

.result-card__badge {
  flex: none;
  align-self: center;
  margin: 0;
  padding: 6px 9px;
  border-radius: 5px;
  background: var(--brand-tint);
  color: var(--brand);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-card__note {
  margin: 12px 20px 0;
  font-size: 14px;
  color: var(--muted);
}

.result-card__note--warn {
  color: var(--danger);
}

.rendition-list {
  display: flex;
  flex-direction: column;
}

.rendition-list > .result-card__note {
  margin-bottom: 12px;
}

.rendition-group__heading {
  margin: 0;
  padding: 14px 20px 8px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.rendition-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 20px;
  border-top: 1px solid var(--line-soft);
}

.rendition-row:first-child {
  border-top: 0;
}

.rendition-row--primary {
  background: var(--panel);
}

.rendition-row__label {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.rendition-row--primary .rendition-row__label {
  font-weight: 700;
}

.rendition-row__dims,
.rendition-row__size {
  flex: none;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.rendition-row__dims {
  width: 104px;
}

.rendition-row__size {
  width: 64px;
}

.rendition {
  flex: none;
  padding: 10px 16px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
}

.rendition:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.rendition--primary {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
  font-weight: 700;
}

.rendition--primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #fff;
}

.rendition-row--disabled .rendition-row__label {
  color: var(--muted);
  font-weight: 500;
}

.rendition-row__na {
  flex: none;
  padding: 10px 0;
  font-size: 13px;
  color: var(--muted);
}

@media (max-width: 520px) {
  .rendition-row {
    gap: 10px;
    padding: 12px 16px;
  }
  .rendition-row__dims {
    display: none;
  }
  .result-card__media {
    padding: 16px;
    gap: 12px;
  }
  .result-card__thumb {
    width: 88px;
    height: 50px;
  }
}

.result-card__foot {
  margin: 0;
  padding: 13px 20px;
  border-top: 1px solid var(--line-soft);
  background: var(--panel);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.article {
  margin-top: 40px;
  max-width: 72ch;
}

.article h2 {
  margin: 32px 0 12px;
  font-size: 22px;
  line-height: 1.3;
}

.article h3 {
  margin: 20px 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.article p {
  margin: 0 0 12px;
  line-height: 1.65;
  color: var(--body);
}

.article ul,
.article ol {
  margin: 0 0 12px;
  padding-left: 22px;
  line-height: 1.65;
}

.article li {
  margin-bottom: 8px;
}

.article code {
  font-size: 14px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--panel);
  border: 1px solid var(--line);
  font-family: var(--font-mono);
}

.article .steps,
.steps {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  position: relative;
  margin-bottom: 16px;
  padding: 16px 18px 16px 56px;
  background: var(--panel);
  border-radius: var(--radius-panel);
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  line-height: 28px;
  text-align: center;
}

.hero__lede code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 0;
  padding: 1px 6px;
  border-radius: 4px;
}

.faq {
  margin-top: 36px;
}

.faq__item {
  margin: 0;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.faq__question {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.4;
}

.faq__answer {
  margin: 0;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.65;
  color: var(--muted);
}

@media (max-width: 639px) {
  .site-header__inner {
    padding: 10px 20px;
  }

  .hero h1 {
    font-size: 30px;
    line-height: 1.08;
  }

  .hero--compact .hero__inner {
    padding: 10px 20px 28px;
  }

  .legal-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-form {
    flex-direction: column;
    height: auto;
  }

  .hero-form__submit {
    width: 100%;
  }

  .overlap-card {
    margin-top: 18px;
  }

  .site-footer__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

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

/* Compact companion navigation, matching the supplied backlink mockup. */
.hero:has(> .companion-tool) > .hero__inner {
  padding-bottom: 40px;
}

.hero:has(> .companion-tool) #extract-result:not(:empty) {
  margin-bottom: 0;
}

.companion-tool {
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
}

.companion-tool__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: var(--col-tool);
  margin: 0 auto;
  padding: 11px 20px;
  font-size: 13px;
  line-height: 1.4;
}

.companion-tool__label { flex-shrink: 0; }

.companion-tool__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 24px;
  color: #fff;
  text-decoration: none;
}

.companion-tool__link:hover .companion-tool__title,
.companion-tool__link:focus-visible .companion-tool__title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.companion-tool__link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
  border-radius: 2px;
}

.companion-tool__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #fff;
  color: #1f4fcc;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.companion-tool__play {
  width: 0;
  height: 0;
  margin-left: 2px;
  border-left: 7px solid #d71f27;
  border-top: 4.5px solid transparent;
  border-bottom: 4.5px solid transparent;
}

.companion-tool__title { font-weight: 600; }

.companion-tool__domain {
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}

.companion-tool__links { display: flex; gap: 20px; flex-wrap: wrap; }

@media (max-width: 639px) {
  .companion-tool__links { flex-direction: column; gap: 10px; }
  .companion-tool__inner { gap: 12px; font-size: 12px; }
  .companion-tool__link { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 2px 8px; }
  .companion-tool__icon { grid-row: 1 / 3; align-self: center; }
  .companion-tool__title, .companion-tool__domain { grid-column: 2; }
  .companion-tool__domain { font-size: 11px; }
}


.photo-card {
  color: var(--ink);
  background: var(--surface);
  text-align: left;
}

.photo-card__head {
  padding: 20px 22px 8px;
}

.photo-card__title {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.photo-card__sub,
.photo-card__counts {
  margin: 0 0 4px;
  font-size: 14px;
  color: var(--muted);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 12px 18px;
}

.photo-grid__cell {
  margin: 0;
  min-width: 0;
}

.photo-grid__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  background: var(--placeholder);
}

.photo-grid__download {
  display: block;
  margin-top: 8px;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}

@media (min-width: 640px) {
  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Photo selection + album ZIP (POST /zip). One submit button in the DOM: it
   sits in the card header from 640px up and in a sticky bottom bar below. */
.zip-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.photo-cell__media {
  position: relative;
}

.photo-grid__cell--selected .photo-grid__img,
.photo-grid__cell:has(.photo-cell__check:checked) .photo-grid__img {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
}

.photo-cell__check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  margin: 0;
  opacity: 0;
}

.photo-cell__label {
  position: absolute;
  inset: 0;
  cursor: pointer;
  border-radius: 10px;
}

.photo-cell__box {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  box-sizing: border-box;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(15, 23, 42, 0.2);
  color: #ffffff;
  font: 600 11px/18px var(--font);
  text-align: center;
}

.photo-cell__check:checked + .photo-cell__label .photo-cell__box {
  background: var(--brand);
  border-color: var(--brand);
}

.photo-cell__check:checked + .photo-cell__label .photo-cell__box::after {
  content: "\2713";
}

.photo-cell__check:focus-visible + .photo-cell__label .photo-cell__box {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.photo-card__actions {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: flex-end;
}

.btn {
  font: 600 12.5px/1 var(--font);
  border: 0;
  border-radius: var(--radius-chip);
  padding: 11px 16px;
  cursor: pointer;
  white-space: nowrap;
}

.btn[hidden] {
  display: none;
}

.btn--primary {
  color: #ffffff;
  background: var(--brand);
}

.btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--soft {
  font-weight: 500;
  color: var(--brand);
  background: var(--brand-tint);
  padding: 11px 14px;
}

.btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

@media (max-width: 639.98px) {
  .zip-bar {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line-soft);
  }

  .zip-bar .btn--primary {
    flex: 1;
  }
}


.zip-bar { position: sticky; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 22px; border-top: 1px solid var(--line-soft); background: var(--surface); }
.zip-count { margin-right: auto; font-size: 13px; color: var(--muted); }
.photo-card__audio { padding: 0 22px 16px; }
.photo-card__badge { display: inline-block; margin: 6px 0; padding: 5px 9px; border-radius: var(--radius-pill); color: var(--brand); background: var(--brand-tint); font-size: 12px; font-weight: 600; }
.hero-form__submit:focus-visible { outline: 2px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 55%, transparent); }
@media (max-width: 639px) { .zip-bar { padding: 12px 18px calc(12px + env(safe-area-inset-bottom, 0px)); } .zip-count { margin-right: 0; } .zip-bar .btn--primary { flex-basis: 100%; } }

/* The post owns its header; each media item reuses the rendition and photo rules. */
.post-card { color: var(--ink); background: var(--surface); text-align: left; overflow-wrap: anywhere; }
.post-card__head { padding: 22px 22px 14px; border-bottom: 1px solid var(--line-soft); }
.post-card__text { margin: 12px 0; color: var(--body); line-height: 1.65; white-space: pre-line; }
.post-media { min-width: 0; }
.post-media + .post-media { border-top: 1px solid var(--line); }
.post-media__heading { margin: 0; padding: 18px 20px 0; color: var(--ink); font-size: 16px; }
.companion-tool__icon--tt { color: #0f766e; font-size: 10px; letter-spacing: -0.02em; }
@media (max-width: 639px) {
  .post-card__head { padding: 18px; }
  .post-card .photo-grid { grid-template-columns: minmax(0, 1fr); }
  .post-media .result-card__media { flex-direction: column; align-items: flex-start; }
  .post-media .rendition-row { flex-wrap: wrap; }
}
