/* ============================================================
   OCR System — Landing page
   1) :root variables
   2) reset / base
   3) layout (.container, .section)
   4) sections in page order (nav, hero, pipeline, ocr-list,
      template, why, cta, footer)
   5) @keyframes
   6) media queries
   ============================================================ */

/* ===== 1) VARIABLES ===== */
:root {
  /* colors */
  --color-primary: #2563EB;
  --color-primary-hover: color-mix(in oklab, var(--color-primary) 82%, black);
  --color-primary-soft: color-mix(in oklab, var(--color-primary) 10%, white);
  --color-success: #16A34A;
  --color-success-hover: #15803D;
  --color-danger: #DC2626;
  --color-neutral: #6B7280;

  --grad-blue: linear-gradient(135deg, #2563EB, #1D4ED8);
  --grad-green: linear-gradient(135deg, #16A34A, #15803D);

  --bg-page: #F9FAFB;
  --bg-white: #FFFFFF;
  --bg-dark: #111827;

  --amber-bg: #FFFBEB;
  --amber-border: #FDE68A;
  --amber-text: #92400E;
  --info-bg: #EFF6FF;
  --info-border: #BFDBFE;
  --info-text: #1E40AF;

  --text-strong: #111827;
  --text-body: #374151;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --border-soft: #F3F4F6;

  /* badges */
  --badge-processing-bg: #FEF3C7;
  --badge-processing-text: #92400E;
  --badge-ocr-bg: #DBEAFE;
  --badge-ocr-text: #1E40AF;
  --badge-edited-bg: #DCFCE7;
  --badge-edited-text: #166534;
  --badge-failed-bg: #FEE2E2;
  --badge-failed-text: #991B1B;

  /* days remaining */
  --days-danger: #DC2626;
  --days-warn: #D97706;
  --days-ok: #16A34A;

  /* annotation palette */
  --ann-1: #4CAF50;
  --ann-2: #2196F3;
  --ann-3: #9C27B0;
  --ann-4: #FF9800;
  --ann-5: #E91E63;
  --ann-6: #00BCD4;

  /* pagination */
  --pg-active: #1F2937;

  /* shape & elevation */
  --radius-card: 12px;
  --radius-btn: 8px;
  --radius-input: 6px;
  --radius-pill: 999px;
  --shadow-card: 0 10px 30px -12px rgba(17, 24, 39, 0.14), 0 2px 8px rgba(17, 24, 39, 0.05);
  --shadow-float: 0 32px 64px -24px rgba(17, 24, 39, 0.22), 0 6px 18px -8px rgba(17, 24, 39, 0.10);
  --shadow-pop: 0 12px 28px -10px rgba(17, 24, 39, 0.25);

  /* type */
  --font-main: "Inter", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ===== 2) RESET / BASE ===== */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-body);
  background: var(--bg-white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); }
button { font-family: inherit; cursor: pointer; }
img, svg { display: block; }

html[lang="en"] .hero__title { letter-spacing: -0.03em; }
html[lang="ja"] .hero__title { letter-spacing: -0.005em; }

/* ===== 3) LAYOUT ===== */
.container {
  margin: 0 auto;
  padding: 0 50px;
}

.container--wide { max-width: 100vw; }

.section { padding: 104px 0; }
.section--gray { background: var(--bg-page); }

.section__head { max-width: 640px; margin-bottom: 56px; }
.section__head--center { margin-left: auto; margin-right: auto; text-align: center; }

.section__title {
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--text-strong);
  text-wrap: pretty;
}

.section__sub {
  margin-top: 14px;
  font-size: 16.5px;
  color: var(--text-muted);
  text-wrap: pretty;
}

/* buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: var(--radius-btn);
  font-size: 15px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.btn--primary { background: var(--color-primary); color: #fff; }
.btn--primary:hover { background: var(--color-primary-hover); color: #fff; transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--text-strong); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--text-muted); color: var(--text-strong); background: var(--bg-page); }
.btn--white { background: #fff; color: var(--bg-dark); }
.btn--white:hover { background: #E5E7EB; color: var(--bg-dark); }

/* scroll reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
[data-reveal].is-revealed { opacity: 1; transform: none; }

/* ===== 4a) NAV ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.nav--scrolled {
  background: var(--bg-white);
  box-shadow: inset 0 -1px 0 var(--border);
}

/* Over the dark hero (top of page, before scrolling): use light text so
   the header stays legible. Reverts automatically once .nav--scrolled is
   added on scroll, leaving the scrolled style untouched. */
.nav:not(.nav--scrolled) .nav__logo,
.nav:not(.nav--scrolled) .nav__logo:hover { color: #FFFFFF; }
.nav:not(.nav--scrolled) .nav__logo-sep { color: #FFFFFF; }
.nav:not(.nav--scrolled) .nav__link,
.nav:not(.nav--scrolled) .nav__lang { color: rgba(255, 255, 255, 0.78); }
.nav:not(.nav--scrolled) .nav__link:hover { color: #FFFFFF; }
.nav:not(.nav--scrolled) .nav__login {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.35);
}
.nav:not(.nav--scrolled) .nav__login:hover {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.1);
}
/* Smooth color swap on the scroll transition */
.nav__logo, .nav__logo-sep, .nav__lang { transition: color 0.25s ease; }

.nav__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-strong);
}
.nav__logo:hover { color: var(--text-strong); }

.nav__logo-mark {
  display: grid;
  place-items: center;
}
.nav__logo-mark img {
  width: 235px;
  height: 55px;
  display: block;
}
/* Show white logo on hero, dark logo after scroll */
.nav__logo-mark img.nav__logo-img--dark { display: none; }
.nav--scrolled .nav__logo-mark img.nav__logo-img--white { display: none; }
.nav--scrolled .nav__logo-mark img.nav__logo-img--dark { display: block; }
.nav__logo-sep {
  color: var(--text-muted);
  font-weight: 300;
}
.nav__logo-text {
  font-size: 20px;
  color: inherit;
}
/* Only the logo mark is a link (to the corporate site); the product name is
   plain text. It inherits the container's color so the hero/scrolled color swap
   keeps working. */
.nav__logo-corp {
  display: flex;
  align-items: center;
}

.nav__links {
  display: flex;
  gap: 26px;
  margin-left: 12px;
}
.nav__link {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s ease;
}
.nav__link:hover { color: var(--text-strong); }

.nav__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav__lang {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--text-muted);
}
.nav__lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: inherit;
  font-size: 13px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.nav__lang-btn:hover { border-color: var(--text-muted); }
/* On the scrolled (white) header: pale blue gradient chip — same hues as the
   お問い合わせ CTA (#00e5ff → #3b82f6) but mixed with white so it reads lighter
   and no longer sinks into the white header. */
.nav--scrolled .nav__lang-btn {
  background: linear-gradient(90deg, color-mix(in oklab, #00E5FF 20%, white), color-mix(in oklab, #3B82F6 20%, white));
  border-color: color-mix(in oklab, #3B82F6 28%, white);
  color: var(--color-primary);
}
.nav--scrolled .nav__lang-btn:hover {
  border-color: color-mix(in oklab, #3B82F6 48%, white);
}
.nav__lang-flag {
  display: inline-flex;
  width: 20px;
  height: 14px;
}
.nav__lang-flag svg {
  width: 20px;
  height: 14px;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.12);
}
.nav__lang-caret {
  flex: none;
  transition: transform 0.15s ease;
}
.nav__lang-btn[aria-expanded="true"] .nav__lang-caret { transform: rotate(180deg); }

.nav__lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 132px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-pop);
  display: none;
  z-index: 60;
}
.nav__lang-menu.is-open { display: block; }
.nav__lang-option {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-radius: var(--radius-input);
  cursor: pointer;
}
.nav__lang-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-body);
  white-space: nowrap;
}
.nav__lang-option:hover { background: var(--bg-page); }
.nav__lang-option[aria-selected="true"] { background: var(--color-primary-soft); }
.nav__lang-option[aria-selected="true"] .nav__lang-name { color: var(--color-primary); }

.nav__login {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  padding: 8px 18px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.nav__login:hover { border-color: var(--text-muted); color: var(--text-strong); background: var(--bg-page); }


/* ===== 4b) HERO ===== */
.hero {
  position: relative;
  padding: 188px 0 128px;
  overflow: hidden;
  height: 100vh;
}

.hero__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(17, 24, 39, 0.10) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 0%, #000 30%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 80% at 50% 0%, #000 30%, transparent 78%);
}

.hero__glow {
  position: absolute;
  top: -240px;
  left: 50%;
  transform: translateX(-50%);
  width: 880px;
  height: 520px;
  background: radial-gradient(ellipse at center, color-mix(in oklab, var(--color-primary) 14%, transparent), transparent 65%);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  text-align: center;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.7);
  margin-bottom: 30px;
}
.hero__eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
}

.hero__title {
  font-size: clamp(38px, 6.4vw, 76px);
  font-weight: 750;
  line-height: 1.14;
  color: var(--text-strong);
  text-wrap: balance;
}
.hero__title-accent { color: var(--color-primary); }

.hero__sub {
  margin: 26px auto 0;
  max-width: 620px;
  font-size: clamp(16px, 1.6vw, 18.5px);
  color: var(--text-muted);
  text-wrap: pretty;
}

.hero__ctas {
  margin-top: 40px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero__note {
  margin-top: 22px;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ===== 4c) PIPELINE ===== */
.pipeline__track {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.pipeline__step {
  flex: 1 1 0;
  min-width: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px 14px 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}
.pipeline__step.is-active {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-primary) 14%, transparent), var(--shadow-card);
  transform: translateY(-3px);
}

.pipeline__visual {
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.pipeline__label {
  margin-top: 14px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-strong);
  text-align: center;
}
.pipeline__desc {
  margin-top: 3px;
  font-size: 15px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.5;
}
/* The 処理中 badge in step 3 reads too small next to the 17px label. Applied at every
   width on purpose: a min-width:1025px guard missed laptops at 125% display scaling
   (1280px physical = 1024px CSS). The step is 187px wide at its narrowest (3 columns
   at 768px) and full width below 640px, so an 11px badge fits everywhere.
   Scoped to .pipeline__visual so the badges inside the OCR list table keep 9.5px —
   they sit in narrow <td>s. */
.pipeline__visual .badge { font-size: 11px; }

.pipeline__arrow {
  align-self: center;
  flex: 0 0 auto;
  color: #9CA3AF;
}

/* step 1 — upload */
.pipeline__drop {
  width: 100%;
  height: 86px;
  border: 1.5px dashed #CBD5E1;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-page);
}
.pipeline__chip {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
  padding: 4px 7px;
  border-radius: 6px;
}
.pipeline__chip--jpg { background: var(--color-primary); }
.pipeline__chip--png { background: var(--color-success); }
.pipeline__chip--pdf { background: var(--color-danger); }
.pipeline__chip--zip { background: #D97706; }
.pipeline__step.is-active .pipeline__chip { animation: chip-in 0.5s var(--ease) both; }
.pipeline__step.is-active .pipeline__chip:nth-child(2) { animation-delay: 0.16s; }
.pipeline__step.is-active .pipeline__chip:nth-child(3) { animation-delay: 0.32s; }
.pipeline__step.is-active .pipeline__chip:nth-child(4) { animation-delay: 0.48s; }

/* step 2 — template / language */
.pipeline__selects { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.pipeline__select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 10.5px;
  color: var(--text-body);
  background: #fff;
}
.pipeline__select b { font-weight: 600; color: var(--text-strong); }
.pipeline__select svg { flex: 0 0 auto; color: #9CA3AF; }
.pipeline__step.is-active .pipeline__select:first-child { animation: select-glow 1.6s ease 0.2s; }

/* step 3 — processing */
.pipeline__spin {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid rgba(180, 83, 9, 0.25);
  border-top-color: #B45309;
  animation: spin 0.9s linear infinite;
}

/* step 4 — recognition */
.pipeline__doc {
  width: 62px;
  height: 82px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(17, 24, 39, 0.08);
  position: relative;
  overflow: hidden;
  padding: 9px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.pipeline__doc-line { height: 5px; border-radius: 2px; background: var(--border); }
.pipeline__doc-line--short { width: 62%; }
.pipeline__step.is-active .pipeline__doc-line { animation: line-on 0.4s ease both; }
.pipeline__step.is-active .pipeline__doc-line:nth-child(2) { animation-delay: 0.25s; }
.pipeline__step.is-active .pipeline__doc-line:nth-child(3) { animation-delay: 0.5s; }
.pipeline__step.is-active .pipeline__doc-line:nth-child(4) { animation-delay: 0.75s; }
.pipeline__step.is-active .pipeline__doc-line:nth-child(5) { animation-delay: 1s; }
.pipeline__scan {
  position: absolute;
  left: 0;
  right: 0;
  top: -20px;
  height: 18px;
  background: linear-gradient(to bottom, transparent, color-mix(in oklab, var(--color-primary) 30%, transparent));
  border-bottom: 1.5px solid var(--color-primary);
  opacity: 0;
}
.pipeline__step.is-active .pipeline__scan { animation: scan-y 1.5s ease-in-out infinite; opacity: 1; }

/* step 5 — results */
.pipeline__table { width: 100%; display: flex; flex-direction: column; gap: 5px; }
.pipeline__row {
  display: flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  padding: 5px 7px;
}
.pipeline__cell { height: 5px; border-radius: 2px; background: var(--border); }
.pipeline__cell--a { width: 18%; }
.pipeline__cell--b { flex: 1; }
.pipeline__minibadge {
  font-size: 8px;
  font-weight: 700;
  padding: 1.5px 6px;
  border-radius: var(--radius-pill);
  background: var(--badge-edited-bg);
  color: var(--badge-edited-text);
}
.pipeline__step.is-active .pipeline__row--new { animation: row-in 0.5s var(--ease) 0.15s both; }
.pipeline__step.is-active .pipeline__row--new .pipeline__minibadge { animation: pop-in 0.35s var(--ease) 0.55s both; }

/* step 6 — download */
.pipeline__dl { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pipeline__csv {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  font-weight: 700;
  color: var(--color-success);
  border: 1px solid color-mix(in oklab, var(--color-success) 35%, white);
  background: color-mix(in oklab, var(--color-success) 8%, white);
  border-radius: 6px;
  padding: 4px 8px;
}
.pipeline__dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--color-primary);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
}
.pipeline__step.is-active .pipeline__dl-btn { animation: pulse-ring 1.1s ease infinite; }

/* ===== 4d) FEATURE SECTIONS (shared) ===== */
.feature__inner {
  display: grid;
  gap: 64px;
  align-items: center;
}
/* Grid width for the OCR list section (#ocr-list) — edit independently.
   The copy column needs ~4fr so the JA sub-headline keeps its intended
   two-line shape instead of spilling onto a third line. */
.feature__inner--list { grid-template-columns: 4fr 8fr; }
/* Grid width for the Template Designer section (#template) — edit independently */
.feature__inner--flip { grid-template-columns: 8fr 8fr; }
.feature__inner--flip .feature__copy { order: 2; }
.feature__inner--flip .feature__mock { order: 1; }

.feature__copy .section__title { font-size: clamp(26px, 2.8vw, 34px); }

.feature__bullets { margin-top: 28px; display: flex; flex-direction: column; gap: 14px; }
.feature__bullet {
  display: flex;
  gap: 11px;
  font-size: 14.5px;
  color: var(--text-body);
  line-height: 1.55;
}
.feature__bullet-icon {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--color-primary-soft);
  color: var(--color-primary);
  display: grid;
  place-items: center;
}

.feature__mock { min-width: 0; }

/* browser chrome */
.browser {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}
.browser__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--border-soft);
  border-bottom: 1px solid var(--border);
}
.browser__dots { display: flex; gap: 6px; }
.browser__dot { width: 10px; height: 10px; border-radius: 50%; }
.browser__dot--r { background: #FF5F57; }
.browser__dot--y { background: #FEBC2E; }
.browser__dot--g { background: #28C840; }
.browser__url {
  flex: 1;
  max-width: 340px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 11px;
  color: var(--text-muted);
  padding: 4px 12px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.browser__body { background: var(--bg-page); padding: 14px; }

/* Scale-to-fit for the OCR list browser mock. On narrow screens initBrowserFit
   (script.js) freezes the browser to a fixed design width and scales it down so
   it keeps the exact desktop proportions instead of overflowing horizontally.
   --browser-fit-scale and the reserved height are set inline by JS. */
.browser-fit.is-scaled { overflow: hidden; }
.browser-fit.is-scaled > .browser {
  width: var(--browser-fit-design, 820px);
  transform-origin: top left;
  transform: scale(var(--browser-fit-scale, 1));
}
/* Neutralize viewport-based mobile rules inside the frozen mock so its internal
   layout stays identical to desktop — only uniform scaling changes its size. */
.browser-fit.is-scaled .browser__body { padding: 14px; }
.browser-fit.is-scaled .ocr-list__field { flex: 0 0 120px; width: 120px; }
.browser-fit.is-scaled .ocr-list__filter-actions { margin-left: auto; }
.browser-fit.is-scaled .ocr-list__actions { margin-left: auto; }

/* mockup form controls (shared) */
.mock-label { font-size: 10px; font-weight: 600; color: var(--text-body); }
.mock-label--req::after { content: " *"; color: var(--color-danger); }
.mock-input {
  background: #fff;
  border: 1px solid #D1D5DB;
  border-radius: var(--radius-input);
  padding: 5px 9px;
  font-size: 11px;
  color: var(--text-strong);
  white-space: nowrap;
}
.mock-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mock-select svg { color: #9CA3AF; flex: 0 0 auto; }

.mbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-input);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  padding: 6.5px 13px;
  white-space: nowrap;
}
.mbtn--blue { background: var(--color-primary); }
.mbtn--blue:hover { background: var(--color-primary-hover); }
.mbtn--green { background: var(--color-success); }
.mbtn--green:hover { background: var(--color-success-hover); }
.mbtn--red { background: var(--color-danger); }
.mbtn--gray { background: var(--color-neutral); }

/* status badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2.5px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.badge--processing { background: var(--badge-processing-bg); color: var(--badge-processing-text); }
.badge--ocr { background: var(--badge-ocr-bg); color: var(--badge-ocr-text); }
.badge--edited { background: var(--badge-edited-bg); color: var(--badge-edited-text); }
.badge--failed { background: var(--badge-failed-bg); color: var(--badge-failed-text); }

/* ===== 4e) OCR LIST MOCKUP ===== */
.ocr-list__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 10px;
  margin-bottom: 12px;
}
.ocr-list__field { display: flex; flex-direction: column; gap: 3px; flex: 0 0 120px; width: 120px; }
/* Make every input/date/select field the same width, without touching buttons */
.ocr-list__filters .ocr-list__field .mock-input { width: 100%; }
.ocr-list__check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-body);
  padding-bottom: 7px;
}
.ocr-list__check input { accent-color: var(--color-primary); margin: 0; }
.ocr-list__filter-actions { display: flex; gap: 8px; margin-left: auto; padding-bottom: 1px; }

.ocr-list__card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
  min-height: 463px;
}
.ocr-list__card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}
.ocr-list__card-title { font-size: 12.5px; font-weight: 700; color: var(--text-strong); }
.ocr-list__count { font-size: 11px; color: var(--text-muted); }

/* Reserve height for the tallest state (6 rows + header, ~359px) so the
   animated incoming "Processing" row appearing/disappearing does not change
   the browser mock height and cause layout shift. */
.ocr-list__scroll { overflow-x: auto; min-height: 360px; }

.ocr-list__table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 11px;
}
.ocr-list__table th {
  background: var(--bg-page);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  padding: 8px 9px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.ocr-list__table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: middle;
  white-space: nowrap;
  color: var(--text-body);
}
.ocr-list__table input[type="checkbox"] { accent-color: var(--color-primary); margin: 0; display: block; }

.ocr-list__thumb {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: linear-gradient(160deg, #F3F4F6, #E5E7EB);
  position: relative;
  overflow: hidden;
}
.ocr-list__thumb::before,
.ocr-list__thumb::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  height: 3px;
  border-radius: 2px;
  background: #C7CCD4;
}
.ocr-list__thumb::before { top: 9px; }
.ocr-list__thumb::after { top: 17px; right: 14px; }

.ocr-list__text {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}
.ocr-list__date { font-family: var(--font-mono); font-size: 10.5px; }

.ocr-list__days { font-weight: 600; }
.ocr-list__days--danger { color: var(--days-danger); font-weight: 800; }
.ocr-list__days--warn { color: var(--days-warn); }
.ocr-list__days--ok { color: var(--days-ok); }

/* animated incoming row */
.ocr-list__row--incoming { display: none; background: var(--info-bg); }
.ocr-list__row--incoming .badge--ocr { display: none; }
.ocr-list[data-phase="in"] .ocr-list__row--incoming,
.ocr-list[data-phase="done"] .ocr-list__row--incoming,
.ocr-list[data-phase="select"] .ocr-list__row--incoming,
.ocr-list[data-phase="download"] .ocr-list__row--incoming {
  display: table-row;
  animation: row-slide 0.5s var(--ease);
}
.ocr-list[data-phase="done"] .ocr-list__row--incoming,
.ocr-list[data-phase="select"] .ocr-list__row--incoming,
.ocr-list[data-phase="download"] .ocr-list__row--incoming { background: #fff; transition: background 0.6s ease; }
.ocr-list[data-phase="done"] .ocr-list__row--incoming .badge--processing,
.ocr-list[data-phase="select"] .ocr-list__row--incoming .badge--processing,
.ocr-list[data-phase="download"] .ocr-list__row--incoming .badge--processing { display: none; }
.ocr-list[data-phase="done"] .ocr-list__row--incoming .badge--ocr,
.ocr-list[data-phase="select"] .ocr-list__row--incoming .badge--ocr,
.ocr-list[data-phase="download"] .ocr-list__row--incoming .badge--ocr {
  display: inline-flex;
  animation: pop-in 0.35s var(--ease);
}

.ocr-list__row.is-sweep { background: var(--info-bg); transition: background 0.25s ease; }
.ocr-list[data-phase="download"] .ocr-list__dl > .mbtn--blue { animation: pulse-ring 1s ease 2; }

/* table footer */
.ocr-list__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.ocr-list__rows { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-muted); }

.ocr-list__pg { display: flex; gap: 4px; }
.ocr-list__pg-btn {
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text-body);
  font-size: 10.5px;
  display: grid;
  place-items: center;
}
.ocr-list__pg-btn--active { background: var(--pg-active); border-color: var(--pg-active); color: #fff; font-weight: 600; }
.ocr-list__pg-btn--gap { border: none; background: transparent; }

.ocr-list__actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }

.ocr-list__dl { position: relative; }
.ocr-list__dl-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  min-width: 168px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-pop);
  padding: 4px;
  display: none;
  z-index: 5;
}
.ocr-list__dl:hover .ocr-list__dl-menu { display: block; }
.ocr-list__dl-item {
  font-size: 11px;
  color: var(--text-body);
  padding: 6.5px 10px;
  border-radius: 6px;
}
.ocr-list__dl-item:hover { background: var(--info-bg); color: var(--info-text); }

/* ===== 4f) TEMPLATE MOCKUP ===== */
.template__mock { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.tcard {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.tcard__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
}
.tcard__head--blue { background: var(--grad-blue); }
.tcard__head--green { background: var(--grad-green); }
.tcard__back {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0;
}
.tcard__head-btn {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 6px;
  padding: 4px 9px;
}

.template__info-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
}
.template__info-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.template__info-field--full { grid-column: 1 / -1; }
.template__textarea { min-height: 44px; white-space: normal; color: var(--text-muted); line-height: 1.5; }

.template__banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  color: var(--amber-text);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 11.5px;
  line-height: 1.5;
}

.template__work {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: 14px;
  align-items: start;
}

/* meta field list */
.template__list { padding: 9px; display: flex; flex-direction: column; gap: 7px; }
.template__field-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 9px;
  font-size: 11px;
  color: var(--text-strong);
}
.template__drag { color: #9CA3AF; flex: 0 0 auto; cursor: grab; }
.template__idx { font-size: 10px; font-weight: 700; color: var(--text-muted); width: 12px; }
.template__dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }
.template__dot--1 { background: var(--ann-1); }
.template__dot--2 { background: var(--ann-2); }
.template__dot--3 { background: var(--ann-3); }
.template__dot--4 { background: var(--ann-4); }
.template__field-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.template__coords { margin-left: auto; font-family: var(--font-mono); font-size: 9.5px; color: var(--text-muted); white-space: nowrap; }
.template__del {
  border: none;
  background: transparent;
  color: var(--color-danger);
  padding: 2px;
  transition: opacity 0.15s ease;
  flex: 0 0 auto;
}

.template__field-item--new { display: none; }
.template__mock[data-phase="added"] .template__field-item--new,
.template__mock[data-phase="hold"] .template__field-item--new {
  display: flex;
  animation: slide-in-left 0.45s var(--ease);
  border-color: var(--ann-4);
}

/* annotation canvas */
.template__canvas {
  position: relative;
  height: 400px;
  background: #E8ECF1;
  overflow: hidden;
}

.template__page {
  position: absolute;
  inset: 26px 44px;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(17, 24, 39, 0.18);
}
.template__pl { position: absolute; background: #D6DAE1; border-radius: 2px; }
.template__pl--dark { background: #9CA3AF; }

.template__bbox { position: absolute; border-width: 3px; border-style: solid; }
.template__bbox--1 { border-color: var(--ann-1); background: rgba(76, 175, 80, 0.07); }
.template__bbox--2 { border-color: var(--ann-2); background: rgba(33, 150, 243, 0.07); }
.template__bbox--3 { border-color: var(--ann-3); background: rgba(156, 39, 176, 0.07); }
.template__handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: #fff;
  border: 2px solid;
  border-color: inherit;
  border-radius: 2px;
}
.template__handle--tl { top: -6px; left: -6px; }
.template__handle--tr { top: -6px; right: -6px; }
.template__handle--bl { bottom: -6px; left: -6px; }
.template__handle--br { bottom: -6px; right: -6px; }

.template__hint {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.12);
  padding: 8px 11px;
  font-size: 10px;
  line-height: 1.7;
  color: var(--text-body);
}
.template__hint span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.template__hint span::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--color-primary); }

.template__zoom {
  position: absolute;
  bottom: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 10px;
  padding: 4px;
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.14);
}
.template__zoom-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-strong);
  font-size: 14px;
  font-weight: 600;
  display: grid;
  place-items: center;
  padding: 0;
}
.template__zoom-val {
  min-width: 44px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-strong);
}

/* animated drawing */
.template__cursor {
  position: absolute;
  left: 93%;
  top: 90%;
  z-index: 6;
  transition: left 0.85s var(--ease), top 0.85s var(--ease);
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}
.template__mock[data-phase="move"] .template__cursor { left: 54%; top: 64%; }
.template__mock[data-phase="draw"] .template__cursor,
.template__mock[data-phase="dialog"] .template__cursor,
.template__mock[data-phase="added"] .template__cursor,
.template__mock[data-phase="hold"] .template__cursor { left: 84%; top: 76%; }

.template__draw {
  position: absolute;
  left: 54%;
  top: 64%;
  width: 0;
  height: 0;
  border: 3px solid var(--ann-4);
  background: rgba(255, 152, 0, 0.09);
  opacity: 0;
  transition: width 0.9s var(--ease), height 0.9s var(--ease), opacity 0.25s ease;
  z-index: 3;
}
.template__mock[data-phase="draw"] .template__draw,
.template__mock[data-phase="dialog"] .template__draw,
.template__mock[data-phase="added"] .template__draw,
.template__mock[data-phase="hold"] .template__draw { opacity: 1; width: 30%; height: 12%; }
.template__draw .template__handle { opacity: 0; transition: opacity 0.2s ease; }
.template__mock[data-phase="dialog"] .template__draw .template__handle,
.template__mock[data-phase="added"] .template__draw .template__handle,
.template__mock[data-phase="hold"] .template__draw .template__handle { opacity: 1; }

.template__dialog {
  position: absolute;
  left: 54%;
  top: 78%;
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-pop);
  padding: 8px 9px;
  font-size: 10.5px;
  color: var(--text-body);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s var(--ease);
  pointer-events: none;
}
.template__mock[data-phase="dialog"] .template__dialog { opacity: 1; transform: translateY(0); }
.template__dialog .mock-input { font-size: 10.5px; padding: 4px 8px; }
.template__dialog .mbtn { font-size: 10px; padding: 4.5px 10px; }

/* ===== 4g) WHY ===== */
.why__title-accent { color: var(--color-primary); }
.why__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 12px;
}
html[lang="ja"] .why__eyebrow,
html[lang="en"] .why__eyebrow { display: none; }
.why__eyebrow::before {
  content: '';
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--color-primary);
  animation: why-dot-pulse 2s ease-in-out infinite;
}
@keyframes why-dot-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklab, var(--color-primary) 45%, transparent); }
  70%  { box-shadow: 0 0 0 6px color-mix(in oklab, var(--color-primary) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--color-primary) 0%, transparent); }
}

/* Full-width hero card on top, three supporting cards in a row below */
.why__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  align-items: stretch;
}
.why__card {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 24px 22px;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.why__card:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--color-primary) 30%, var(--border));
}
/* Staggered pop-in once the grid scrolls into view; independent of the
   hover transition above so the two never fight over timing. */
.why__grid[data-reveal] .why__card { opacity: 0; }
.why__grid.is-revealed .why__card { animation: why-card-in 0.6s var(--ease) both; }
.why__grid.is-revealed .why__card:nth-child(1) { animation-delay: .06s; }
.why__grid.is-revealed .why__card:nth-child(2) { animation-delay: .14s; }
.why__grid.is-revealed .why__card:nth-child(3) { animation-delay: .22s; }
@keyframes why-card-in {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.why__card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.why__icon {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--grad-blue);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.35s var(--ease);
}
.why__icon::after {
  content: '';
  position: absolute;
  inset: -5px;
  z-index: -1;
  border-radius: inherit;
  background: inherit;
  opacity: 0.3;
  filter: blur(7px);
  animation: why-icon-glow 2.6s ease-in-out infinite;
}
@keyframes why-icon-glow {
  0%, 100% { opacity: 0.18; transform: scale(0.9); }
  50%      { opacity: 0.5;  transform: scale(1.15); }
}
.why__card:hover .why__icon { transform: rotate(-8deg) scale(1.08); }
.why__icon .material-symbols-outlined { font-size: 22px; line-height: 1; }
.why__card-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-strong);
}
.why__card-desc { font-size: 13.5px; color: var(--text-muted); line-height: 1.65; }
/* Desktop only: larger card title/desc; tablets & phones (≤1024px) keep base sizes */
@media (min-width: 1025px) {
  .why__card-title { font-size: 17px; }
  .why__card-desc { font-size: 15px; }
}

/* Hero card: full-width, holds the bulk-processing pipeline illustration */
.why__hero {
  position: relative;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 30px 34px;
  margin-bottom: 18px;
  transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.25s ease;
}
.why__hero:hover {
  box-shadow: var(--shadow-card);
  transform: translateY(-3px);
  border-color: color-mix(in oklab, var(--color-primary) 30%, var(--border));
}
.why__hero[data-reveal] { opacity: 0; }
.why__hero.is-revealed { animation: why-card-in 0.6s var(--ease) both; }
.why__hero .why__card-desc { max-width: 560px; }
/* Desktop: size the measure to the string itself so each locale's one-line copy
   never wraps, regardless of font metrics. Narrower viewports keep the 560px cap. */
@media (min-width: 1025px) {
  .why__hero .why__card-desc { max-width: max-content; }
}
.why__icon--hero { width: 44px; height: 44px; border-radius: 12px; }
.why__icon--hero .material-symbols-outlined { font-size: 24px; }

/* Colored accent cards: soft pastel background, colored icon tile */
.why__card--green  { background: #F0FDF4; border-color: #BBF7D0; }
.why__card--green  .why__icon { background: var(--grad-green); }
.why__card--green:hover  { box-shadow: 0 14px 32px -14px rgba(22, 163, 74, 0.35), var(--shadow-card); border-color: #86EFAC; }
.why__card--purple { background: #F5F3FF; border-color: #DDD6FE; }
.why__card--purple .why__icon { background: linear-gradient(135deg, #8B5CF6, #6D28D9); }
.why__card--purple:hover { box-shadow: 0 14px 32px -14px rgba(109, 40, 217, 0.35), var(--shadow-card); border-color: #C4B5FD; }
.why__card--amber  { background: var(--amber-bg); border-color: var(--amber-border); }
.why__card--amber  .why__icon { background: linear-gradient(135deg, #F59E0B, #D97706); }
.why__card--amber:hover  { box-shadow: 0 14px 32px -14px rgba(217, 119, 6, 0.35), var(--shadow-card); border-color: #FCD34D; }

/* Pipeline: files → parallel workers → structured rows, left to right */
.why__pipeline {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 16px 4px 4px;
}
/* Stack of floating source files */
.why__files {
  position: relative;
  width: 128px;
  height: 80px;
  flex: none;
}
.why__file {
  position: absolute;
  top: 8px;
  width: 44px;
  height: 56px;
  border-radius: 8px;
  background: #fff;
  border: 1.5px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.08);
  animation: why-file-float 3.2s ease-in-out infinite;
}
.why__file--jpg { left: 6px;  top: 12px; --r: -14deg; border-color: #BFDBFE; color: #2563EB; animation-delay: 0s; }
.why__file--png { left: 28px; top: 2px;  --r: -5deg;  border-color: #BBF7D0; color: #16A34A; animation-delay: .2s; }
.why__file--pdf { left: 50px; top: 8px;  --r: 6deg;   border-color: #FDE68A; color: #D97706; animation-delay: .4s; }
.why__file--zip { left: 72px; top: 16px; --r: 15deg;  border-color: #DDD6FE; color: #7C3AED; animation-delay: .6s; }
@keyframes why-file-float {
  0%, 100% { transform: translateY(0)    rotate(var(--r, 0deg)); }
  50%      { transform: translateY(-7px) rotate(var(--r, 0deg)); }
}
/* Dashed connector with a marching arrow head */
.why__flow {
  position: relative;
  flex: 1;
  min-width: 32px;
  height: 2px;
  margin: 0 4px;
  background-image: repeating-linear-gradient(90deg, #CBD5E1 0 6px, transparent 6px 12px);
  animation: why-dash-march 1s linear infinite;
}
.why__flow::after {
  content: '';
  position: absolute;
  right: -1px;
  top: -4px;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid #CBD5E1;
}
@keyframes why-dash-march { to { background-position: 24px 0; } }
@keyframes why-dash-march-v { to { background-position: 0 24px; } }
/* Parallel worker spinners */
.why__workers {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: none;
}
.why__rings { display: flex; gap: 7px; }
.why__ring {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #DBEAFE;
  border-top-color: var(--color-primary);
  animation: why-ring-spin 1.1s linear infinite;
}
.why__ring:nth-child(2) { animation-delay: .15s; }
.why__ring:nth-child(3) { animation-delay: .3s; }
@keyframes why-ring-spin { to { transform: rotate(360deg); } }
/* 11px at every width, not behind min-width:1025px — that guard missed laptops at
   125% display scaling (1280px physical = 1024px CSS), so the label stayed 9.5px on
   the very desktops it was meant for. Safe to widen: the neighbouring .why__flow
   connectors are flex:1 (min-width:32px), so they absorb the extra width. */
.why__workers-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-faint, #94A3B8);
  white-space: nowrap;
}
/* Structured output rows */
.why__result {
  width: 112px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.05);
}
.why__result-row {
  height: 6px;
  border-radius: 2px;
  background: #E2E8F0;
}
.why__result-row:nth-child(1) { width: 90%; }
.why__result-row:nth-child(2) { width: 75%; }
.why__result-row:nth-child(3) { width: 82%; }
.why__result-row:nth-child(4) { width: 60%; }
.why__result-row--done  { background: #BBF7D0; animation: why-shimmer-row 1.6s ease-in-out infinite; }
.why__result-row--done2 { background: #BBF7D0; animation: why-shimmer-row 1.6s ease-in-out infinite .3s; }
@keyframes why-shimmer-row {
  0%, 100% { opacity: .45; }
  50%      { opacity: 1; }
}

/* ===== 4h) CTA ===== */
.cta {
  position: relative;
  background: var(--bg-dark);
  padding: 110px 0;
  overflow: hidden;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(ellipse 80% 90% at 50% 100%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 90% at 50% 100%, #000 20%, transparent 75%);
  pointer-events: none;
}
.cta__inner { position: relative; text-align: center; max-width: 720px; }
.cta__title {
  font-size: clamp(28px, 4vw, 46px);
  font-weight: 750;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: #fff;
  text-wrap: balance;
}
.cta__sub { margin-top: 16px; font-size: 16.5px; color: #9CA3AF; }
/* Match the hero お問い合わせ CTA: cyan→blue gradient pill with a glow. */
.cta__btn {
  margin-top: 38px;
  background: linear-gradient(90deg, #00E5FF, #3B82F6);
  color: #051019;
  font-size: 16px;
  font-weight: 700;
  padding: 16px 42px;
  border: none;
  border-radius: var(--radius-pill);
  box-shadow: 0 0 32px rgba(0, 229, 255, 0.35);
}
.cta__btn:hover {
  color: #051019;
  transform: translateY(-1px);
  box-shadow: 0 0 40px rgba(0, 229, 255, 0.45);
}

/* Forces a clean line break at a phrase boundary on narrow screens only;
   on wider screens where the text fits on one line, no break is inserted.
   Used both directly in markup and inside i18n strings, so keep it locale-neutral. */
.mobile-break { display: none; }

/* Same idea, but for a break that is only useful in a narrow band of widths — used
   by why.c3d, whose first half is 304px: below ~390px that half overflows the card
   and the break costs a third line, and from ~548px up the whole sentence already
   fits on one. .mobile-break (everything ≤640px) would be wrong at both ends. */
.mobile-break--mid { display: none; }
@media (min-width: 390px) and (max-width: 547px) {
  .mobile-break--mid { display: block; }
}

/* ===== 4i) FOOTER ===== */
.footer { background: #fff; border-top: 1px solid var(--border); padding: 36px 0; }
.footer__inner { display: flex; justify-content: center; }
.footer__copy { font-size: 12px; color: var(--text-muted); text-align: center; }

/* ===== 5) KEYFRAMES ===== */
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes chip-in {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: none; }
}

@keyframes select-glow {
  0%, 100% { box-shadow: 0 0 0 0 transparent; border-color: var(--border); }
  40% { box-shadow: 0 0 0 3px color-mix(in oklab, var(--color-primary) 18%, transparent); border-color: var(--color-primary); }
}

@keyframes line-on {
  from { background: var(--border); opacity: 0.35; }
  to { background: #8B93A1; opacity: 1; }
}

@keyframes scan-y {
  0% { top: -20px; }
  55% { top: 100%; }
  100% { top: 100%; }
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--color-primary) 40%, transparent); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@keyframes row-slide {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: none; }
}

/* ===== 6) MEDIA QUERIES ===== */
@media (max-width: 1024px) {
  .section { padding: 84px 0; }

  .pipeline__track { flex-wrap: wrap; }
  .pipeline__step { flex: 1 1 28%; }
  .pipeline__arrow { display: none; }

  .feature__inner { grid-template-columns: 1fr; gap: 40px; }
  .feature__inner--flip .feature__copy { order: 1; }
  .feature__inner--flip .feature__mock { order: 2; }

  .why__pipeline { flex-wrap: wrap; justify-content: center; gap: 12px 6px; }
  .why__flow { min-width: 40px; }

  /* On tablets, keep all filter fields, checkbox and buttons on a single row;
     the inputs shrink evenly to make room for the checkbox and action buttons.
     The .is-scaled variants override the higher-specificity rules used when the
     mock is frozen and scaled down, without touching the desktop layout. */
  .ocr-list__filters,
  .browser-fit.is-scaled .ocr-list__filters { flex-wrap: nowrap; }
  .ocr-list__field,
  .browser-fit.is-scaled .ocr-list__field { flex: 1 1 0; width: auto; min-width: 0; }
  .ocr-list__filter-actions,
  .browser-fit.is-scaled .ocr-list__filter-actions { flex: 0 0 auto; margin-left: 0; }
}

@media (max-width: 900px) {
  .nav__links, .nav__login { display: none; }
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .section { padding: 68px 0; }
  .section__head { margin-bottom: 36px; }

  /* Phone: these section headings read better one step below the shared 28px
     clamp floor. */
  .pipeline .section__title,
  .why .section__title { font-size: 26px; }

  /* Phone: compact brand — smaller logo mark, hide separator and wordmark */
  .nav__logo-mark img { width: auto; height: 40px; }
  .nav__logo-sep,
  .nav__logo-text { display: none; }

  .mobile-break { display: block; }

  .hero { padding: 138px 0 84px; }
  .hero__ctas .btn { width: 100%; }

  .pipeline__track { flex-direction: column; }
  .pipeline__step { flex: 1 1 auto; }
  .pipeline__arrow {
    display: flex;
    justify-content: center;
    transform: rotate(90deg);
    height: 18px;
  }

  .browser__body { padding: 10px; }
  /* On phones, keep all filter fields, checkbox and buttons on a single row;
     the inputs shrink evenly to make room for the checkbox and action buttons.
     The .is-scaled variants override the rules used when the mock is scaled down. */
  .ocr-list__filters,
  .browser-fit.is-scaled .ocr-list__filters { flex-wrap: nowrap; gap: 6px 5px; }
  .ocr-list__field,
  .browser-fit.is-scaled .ocr-list__field { flex: 1 1 0; width: auto; min-width: 0; }
  .ocr-list__filter-actions,
  .browser-fit.is-scaled .ocr-list__filter-actions { flex: 0 0 auto; margin-left: 0; }
  .ocr-list__actions { margin-left: 0; }

  .template__info-body { grid-template-columns: 1fr; }
  .template__work { grid-template-columns: 1fr; }
  .template__canvas { height: 320px; }
  .template__hint { display: none; }
  /* Phone: keep the annotation label dialog on a single line and anchored to the
     bbox's right edge, so it doesn't wrap inside the narrow canvas. */
  .template__dialog { left: auto; right: 16%; white-space: nowrap; }

  /* Phone: single-column cards; the pipeline reflows into a centered column */
  .why__grid { grid-template-columns: 1fr; }
  .why__hero { padding: 24px 20px; }
  .why__pipeline { flex-direction: column; gap: 14px; }
  .why__flow {
    width: 2px;
    min-width: 0;
    height: 26px;
    margin: 0;
    background-image: repeating-linear-gradient(180deg, #CBD5E1 0 6px, transparent 6px 12px);
    animation: why-dash-march-v 1s linear infinite;
  }
  .why__flow::after {
    right: auto;
    top: auto;
    bottom: -1px;
    left: -4px;
    border-top: 7px solid #CBD5E1;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: none;
  }
}

/* ===== reduced motion ===== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
