/* ============================================================
   Tektome — Knowledge Builder solution page
   Light mode, brand tokens only. Display headings use the Light (300)
   weight with purple accent spans, matching the other solution pages.
   Sections alternate white / light-blue / light-gray.
   ============================================================ */

.kb-page {
  flex: 1;
  background: var(--color-draft-white);
  font-family: var(--font-sans);
  color: var(--fg-primary);
  /* Page-wide accent scheme — baked-in "Lavender" selection.
     Emphasis fills carry dark text; the small number badge stays a
     saturated tone with white text. */
  --kb-fill: var(--purple-100);
  --kb-fill-fg: var(--color-data-black);
  --kb-pill-bg: var(--purple-50);
  --kb-pill-fg: var(--purple-700);
  --kb-badge-bg: var(--purple-400);
  --kb-badge-fg: var(--color-draft-white);
  --kb-pipe-bg: var(--color-light-gray);
  --kb-formats-bg: var(--color-light-gray);
}

/* ---- shared section pieces ---- */
.kb-inner {
  max-width: var(--site-width, 1300px);
  margin: 0 auto;
  padding: 0 40px;
}
.kb-h2 {
  font-family: var(--font-sans);
  font-weight: var(--fw-light);
  font-size: clamp(32px, 3.8vw, 50px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--color-data-black);
  margin: 0;
  text-wrap: balance;
}
.kb-h2 .accent { color: var(--color-arch-purple); }
.kb-sub {
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg-secondary);
  margin: 22px 0 0;
  text-wrap: pretty;
}
.kb-head--center { text-align: center; max-width: 820px; margin: 0 auto clamp(40px, 5vw, 60px); }
.kb-head--center .kb-sub { margin-left: auto; margin-right: auto; }
.kb-head--gap { margin-top: clamp(48px, 6vw, 80px); }
.kb-eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-arch-purple);
  margin: 0 0 18px;
}

/* ===================== 1. HERO ===================== */
.kb-hero { background: var(--color-draft-white); }
.kb-hero__inner {
  max-width: var(--site-width, 1300px);
  margin: 0 auto;
  padding: clamp(48px, 6vw, 88px) 40px clamp(56px, 7vw, 96px);
  display: grid;
  grid-template-columns: minmax(0, 0.98fr) minmax(0, 1.02fr);
  align-items: center;
  gap: clamp(40px, 5vw, 72px);
}
.kb-hero__copy { max-width: 600px; }
.kb-hero__badges { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; }
.kb-badge {
  display: inline-flex; align-items: center; gap: 9px;
  height: 34px; padding: 0 16px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 12px; font-weight: var(--fw-semibold);
  letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap;
}
.kb-badge--primary { background: var(--purple-50); color: var(--color-arch-purple); }
.kb-badge--primary .kb-badge__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--color-arch-purple); }
.kb-hero__media {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: transparent;
}
.kb-hero__video { display: block; width: 100%; height: auto; }
.kb-hero__title {
  font-family: var(--font-sans);
  font-weight: var(--fw-light);
  font-size: clamp(40px, 4.6vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--color-data-black);
  margin: 0;
  text-wrap: balance;
}
.kb-hero__title .accent { color: var(--color-arch-purple); }
.kb-hero__lede {
  font-size: 18px;
  line-height: 1.6;
  color: var(--fg-secondary);
  margin: 24px 0 0;
  max-width: 46ch;
  text-wrap: pretty;
}
.kb-hero__actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 38px; }

/* ===================== 2. PIPELINE ===================== */
.kb-pipe { background: var(--kb-pipe-bg); padding: clamp(56px, 7vw, 96px) 0; }
.kb-pipe__grid {
  display: grid;
  grid-template-columns: 1fr auto 1.05fr auto 1fr;
  gap: clamp(16px, 2vw, 32px);
  align-items: start;
  --kb-head: auto;
}
.kb-pipe__col { align-self: stretch; display: flex; flex-direction: column; }
.kb-pipe__col--center { align-items: center; text-align: center; }
/* Shared top label band: left/right captions and the centre brand+title+sub
   bottom-align to the same height so the three labels line up. */
.kb-pipe__head {
  min-height: var(--kb-head, 132px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 22px;
}
.kb-pipe__head .kb-pipe__sub { margin: 6px 0 0; }
.kb-pipe__caption {
  min-height: var(--kb-head, 132px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-size: 16px;
  color: var(--color-data-black);
  margin: 0 0 22px;
  font-weight: var(--fw-regular);
  text-align: center;
}
.kb-pipe__caption strong { font-weight: var(--fw-semibold); }
.kb-pipe__inputs, .kb-pipe__outputs { display: flex; flex-direction: column; gap: 14px; justify-content: center; flex: 1; }
.kb-input {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 56px; padding: 14px 24px;
  border: 1.5px solid var(--gray-400);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font-size: 15px; font-weight: var(--fw-semibold);
  color: var(--color-data-black);
  text-align: center;
}
.kb-input__icon { display: inline-flex; color: var(--color-arch-purple); flex: 0 0 auto; }
.kb-input__icon svg { width: 22px; height: 22px; }
.kb-output {
  display: flex; align-items: center; justify-content: center;
  min-height: 76px; padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--kb-fill);
  color: var(--kb-fill-fg);
  font-size: 16px; font-weight: var(--fw-semibold);
  line-height: 1.3; text-align: center; text-wrap: balance;
}
.kb-pipe__arrow { color: var(--color-data-black); display: flex; align-items: center; }
.kb-pipe__arrow svg { width: 26px; height: 26px; }
.kb-pipe__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.kb-pipe__logo { color: var(--color-data-black); display: inline-flex; }
.kb-pipe__logo svg { width: 26px; height: 34px; }
.kb-pipe__wordmark { font-size: 22px; font-weight: var(--fw-semibold); color: var(--color-data-black); letter-spacing: -0.01em; }
.kb-pipe__title {
  font-family: var(--font-sans);
  font-weight: var(--fw-semibold);
  font-size: clamp(26px, 2.6vw, 34px);
  letter-spacing: -0.01em;
  color: var(--color-arch-purple);
  margin: 0;
}
.kb-pipe__sub { font-size: 15px; color: var(--fg-secondary); margin: 6px 0 26px; }
.kb-pipe__sub strong { font-weight: var(--fw-semibold); color: var(--color-data-black); }
.kb-engine {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--purple-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.kb-engine__icon { color: var(--color-data-black); }
.kb-engine__icon svg { width: 72px; height: 72px; }
.kb-engine__icon img { width: 72px; height: 72px; display: block; object-fit: contain; }
.kb-engine__chip {
  background: var(--kb-fill);
  color: var(--kb-fill-fg);
  border-radius: var(--radius-md);
  padding: 22px 18px;
  width: 100%;
  text-align: center;
  font-size: 20px;
  font-weight: var(--fw-semibold);
  line-height: 1.25;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 12px;
}
.kb-engine__chip-logo { flex: 0 0 auto; height: 26px; width: auto; display: block; }
.kb-engine__note { font-size: 15px; color: var(--fg-secondary); margin: 16px 0 0; line-height: 1.4; }

/* ---- Knowledge-box style variants (Tweaks-driven) ----
   Restyle the engine chip + output boxes. Defaults to "soft".
   All consume the active accent scheme via --kb-fill / --kb-fill-fg. */
.kb-pipe[data-box="soft"] .kb-output,
.kb-pipe[data-box="soft"] .kb-engine__chip {
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--kb-fill) 68%, white);
  box-shadow: 0 10px 26px -12px color-mix(in srgb, var(--kb-fill) 90%, black), var(--shadow-xs);
}
.kb-pipe[data-box="outline"] .kb-output,
.kb-pipe[data-box="outline"] .kb-engine__chip {
  background: var(--bg-surface);
  border: 1.5px solid var(--kb-fill);
  color: var(--color-data-black);
  border-radius: 14px;
  box-shadow: none;
}
.kb-pipe[data-box="glass"] .kb-output,
.kb-pipe[data-box="glass"] .kb-engine__chip {
  background: color-mix(in srgb, var(--kb-fill) 40%, transparent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid color-mix(in srgb, var(--kb-fill) 55%, white);
  color: var(--color-data-black);
  border-radius: 16px;
  box-shadow: 0 8px 22px -12px rgba(16,16,16,0.28);
}

/* ===================== 3. DATA EXTRACTION ===================== */
.kb-extract {
  background: var(--color-draft-white);
  padding: clamp(56px, 7vw, 96px) 0;
  /* Extract step-card theming — baked-in "Lavender" selection. */
  --kb-card-bg: var(--purple-50);
  --kb-card-border: var(--purple-300);
  --kb-card-fg: var(--color-data-black);
  --kb-card-fg-soft: var(--fg-secondary);
  --kb-card-divider: var(--purple-200);
  --kb-field-bg: var(--color-draft-white);
  --kb-field-border: var(--purple-300);
  --kb-field-fg: var(--color-data-black);
  --kb-card-ui: var(--color-arch-purple);
}
.kb-flow {
  display: grid;
  grid-template-columns: 1fr auto 1.3fr auto 1fr;
  gap: clamp(8px, 1.2vw, 18px);
  align-items: stretch;
}
.kb-step { display: flex; flex-direction: column; }
.kb-step__tab {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--kb-pill-bg);
  color: var(--kb-pill-fg);
  font-size: 14px;
  font-weight: var(--fw-semibold);
  padding: 7px 16px 7px 7px;
  border-radius: var(--radius-pill);
  margin-bottom: 14px;
}
.kb-step__n {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--kb-badge-bg);
  color: var(--kb-badge-fg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: var(--fw-semibold);
}
.kb-step__card {
  flex: 1;
  background: var(--kb-card-bg);
  border: 1.5px solid var(--kb-card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}
.kb-step__card--tablet { display: flex; align-items: center; justify-content: center; }
/* step 1 — prompt fields */
.kb-field { display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 14px; margin-bottom: 18px; }
.kb-field--top { align-items: start; margin-bottom: 0; }
.kb-field__label { font-size: 15px; color: var(--kb-card-fg); }
.kb-select {
  display: flex; align-items: center; justify-content: space-between;
  border: 1.5px solid var(--kb-field-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 15px; color: var(--kb-field-fg);
  background: var(--kb-field-bg);
}
.kb-select svg { width: 18px; height: 18px; color: var(--kb-card-ui); }
.kb-prompt {
  border: 1.5px solid var(--kb-field-border);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 15px; line-height: 1.5; color: var(--kb-field-fg);
  background: var(--kb-field-bg);
  min-height: 120px;
}
/* step 2 — tablet */
.kb-tablet {
  width: 100%;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-surface);
  box-shadow: var(--shadow-md);
}
.kb-tablet img { display: block; width: 100%; height: auto; }
/* step 3 — attributes */
.kb-attrs__head { font-size: 14px; font-weight: var(--fw-semibold); color: var(--kb-card-fg); margin: 0 0 7px; }
.kb-attrs { margin: 0; display: flex; flex-direction: column; }
.kb-attr { padding: 4px 0; border-bottom: 1px solid var(--kb-card-divider); }
.kb-attr:last-child { border-bottom: 0; padding-bottom: 0; }
.kb-attr dt { font-size: 11.5px; font-weight: var(--fw-semibold); color: var(--kb-card-fg-soft); margin: 0 0 1px; }
.kb-attr dd { font-size: 13.5px; color: var(--kb-card-fg); margin: 0; line-height: 1.3; }
.kb-flow__chevron { display: flex; align-items: center; color: var(--color-arch-purple); align-self: center; }
.kb-flow__chevron svg { width: 26px; height: 26px; }
.kb-flow-notes {
  max-width: 1000px;
  margin: clamp(28px, 3.5vw, 44px) auto 0;
  display: grid;
  gap: 16px;
}
.kb-flow-notes .kb-note { justify-content: center; }

/* ===================== 4. COMPATIBLE FORMATS ===================== */
.kb-formats { background: var(--kb-formats-bg); padding: clamp(56px, 7vw, 96px) 0; }
.kb-formats__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(40px, 5vw, 80px);
  align-items: center;
}
.kb-docs { position: relative; display: flex; flex-direction: column; gap: 28px; }
.kb-doc {
  position: relative;
  z-index: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  box-shadow: var(--shadow-sm);
  padding: 26px 28px 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--color-data-black);
  /* torn-paper bottom edge */
  -webkit-mask: radial-gradient(8px 10px at 12px bottom, transparent 96%, #000 0) repeat-x left bottom / 24px 10px, linear-gradient(#000 0 0) top / 100% calc(100% - 9px) no-repeat;
          mask: radial-gradient(8px 10px at 12px bottom, transparent 96%, #000 0) repeat-x left bottom / 24px 10px, linear-gradient(#000 0 0) top / 100% calc(100% - 9px) no-repeat;
  padding-bottom: 22px;
}
.kb-doc__org { font-weight: var(--fw-semibold); font-size: 13px; margin: 0 0 14px; }
.kb-doc__line { margin: 0 0 4px; }
.kb-doc__line b, .kb-doc__list b { font-weight: var(--fw-semibold); }
.kb-doc__line--gap { margin-top: 12px; }
.kb-doc__sub { font-weight: var(--fw-semibold); margin: 14px 0 6px; }
.kb-doc__list { margin: 0; padding-left: 16px; }
.kb-doc__list li { margin-bottom: 4px; }
.kb-doc__list ul { margin: 4px 0 0; padding-left: 16px; }
.kb-mark { border-radius: 3px; padding: 1px 5px; }
.kb-mark--pink { background: #F5E4F7; }
.kb-mark--blue { background: var(--color-sky-200); }
.kb-mark--lav  { background: var(--purple-50); }
.kb-doc__fade { color: var(--gray-500); margin: 12px 0 0; font-size: 12.5px; line-height: 1.5;
  -webkit-mask: linear-gradient(180deg, #000 30%, transparent); mask: linear-gradient(180deg, #000 30%, transparent); }
.kb-docs__connect { position: absolute; right: -76px; top: 0; bottom: 0; width: 120px; display: none; z-index: 0; }
@media (min-width: 1100px) { .kb-docs__connect { display: block; } }
.kb-docs__connect svg { width: 100%; height: 100%; }
.kb-docs__connect path { stroke-linecap: round; stroke-linejoin: round; transition: stroke var(--duration-base) var(--ease-out); }
/* Document → table connector style variants (Tweaks-driven). Defaults
   to "refined" — thinner and softer than the original bold black line.
   CSS stroke overrides the inline presentation attribute. */
.kb-formats[data-connector="refined"] .kb-docs__connect path { stroke: var(--gray-400); stroke-width: 1.4; }
.kb-formats[data-connector="accent"] .kb-docs__connect path { stroke: var(--purple-400); stroke-width: 1.5; }
.kb-formats[data-connector="dashed"] .kb-docs__connect path { stroke: var(--gray-500); stroke-width: 1.4; }
.kb-formats[data-connector="dashed"] .kb-docs__connect path:nth-child(-n+2) { stroke-dasharray: 6 5; }

.kb-formats__out { display: flex; flex-direction: column; gap: 22px; }
.kb-otable {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.kb-otable table { width: 100%; border-collapse: collapse; }
.kb-otable th {
  font-size: 15px; font-weight: var(--fw-semibold); color: var(--color-data-black);
  text-align: center; padding: 18px 16px;
  border-bottom: 1px solid var(--border-default);
}
.kb-otable td {
  font-size: 15px; color: var(--color-data-black);
  text-align: center; padding: 18px 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.kb-otable th + th, .kb-otable td + td { border-left: 1px solid var(--border-subtle); }
.kb-otable tbody tr:last-child td { border-bottom: 0; }
.kb-otable__fade td { color: var(--gray-400); }
.kb-note { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.kb-note__icon { color: var(--color-data-black); display: inline-flex; }
.kb-note__icon svg { width: 30px; height: 30px; }
.kb-note p { font-size: 16px; line-height: 1.55; color: var(--color-data-black); margin: 0; text-wrap: pretty; }

/* ===================== 5. DATA STRUCTURING METHOD ===================== */
.kb-method { background: var(--color-light-gray); padding: clamp(56px, 7vw, 96px) 0; }
.kb-compare {
  display: grid;
  grid-template-columns: 0.8fr 1.05fr 1fr 1fr;
  max-width: 1040px;
  margin-inline: auto;
  gap: clamp(10px, 1.2vw, 18px);
  align-items: stretch;
  --kb-head-h: 50px;        /* header-tab height (fixed so 1- and 2-line titles align) */
  --kb-head-overlap: 14px;  /* how far the body tucks under the header */
  /* Header colour scheme — overridable by the Tweaks panel.
     Default "Blue & grey": grey Conventional, sky RAG, purple winner.
     Light-mode only; no dark fills. */
  --kb-h1-bg: var(--gray-300);
  --kb-h1-fg: var(--color-data-black);
  --kb-h2-bg: #EAEAEA;
  --kb-h2-fg: var(--color-data-black);
  --kb-h3-bg: linear-gradient(118deg, #5a5fe0, #4a4ecf);
  --kb-h3-fg: var(--color-draft-white);
  --kb-feature-border: var(--color-arch-purple);
}
/* Variation: Sky — all blues, ascending intensity. */
.kb-compare[data-method="sky"] {
  --kb-h1-bg: var(--color-sky-100);
  --kb-h1-fg: var(--color-data-black);
  --kb-h2-bg: var(--color-sky-200);
  --kb-h2-fg: var(--color-data-black);
  --kb-h3-bg: var(--color-sky-300);
  --kb-h3-fg: var(--color-data-black);
  --kb-feature-border: var(--color-arch-purple);
}
/* Variation: Slate — all greys, ascending intensity. */
.kb-compare[data-method="slate"] {
  --kb-h1-bg: var(--gray-200);
  --kb-h1-fg: var(--color-data-black);
  --kb-h2-bg: var(--gray-300);
  --kb-h2-fg: var(--color-data-black);
  --kb-h3-bg: var(--gray-400);
  --kb-h3-fg: var(--color-data-black);
  --kb-feature-border: var(--color-arch-purple);
}

/* ---- label cards (no header; tops align with the system bodies) ---- */
.kb-mcard {
  margin-top: calc(var(--kb-head-h) - var(--kb-head-overlap));
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: var(--shadow-xs);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
}
.kb-mcard--method { align-items: center; justify-content: center; text-align: center; gap: 16px; }
.kb-mcard__icon { width: 44px; height: 44px; object-fit: contain; }
.kb-mcard__label { font-size: 15px; font-weight: var(--fw-semibold); color: var(--color-data-black); margin: 0; line-height: 1.4; }
.kb-mrows { display: grid; grid-template-rows: repeat(3, minmax(0, 1fr)); padding: calc(var(--kb-head-overlap) + 16px) 12px 8px; }
.kb-mrow { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 11px 0; }
.kb-mrow + .kb-mrow { border-top: 1px solid var(--border-subtle); }
.kb-mrow__icon { width: 22px; height: 22px; object-fit: contain; }
.kb-mrow span { font-size: 13.5px; font-weight: var(--fw-medium); color: var(--color-data-black); line-height: 1.25; }

/* ---- system columns: colored header tab over a white body ---- */
.kb-syscol { position: relative; display: flex; flex-direction: column; }
.kb-syscol__head {
  position: relative;
  z-index: 2;
  margin: 0 0 calc(-1 * var(--kb-head-overlap));
  height: var(--kb-head-h);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px 12px 0 0;
  text-align: center;
  font-size: 16px;
  font-weight: var(--fw-semibold);
}
.kb-syscol__head--neutral { background: var(--kb-h1-bg); color: var(--kb-h1-fg); }
.kb-syscol__head--dark { background: var(--kb-h2-bg); color: var(--kb-h2-fg); }
.kb-syscol__head--accent { background: var(--kb-h3-bg); color: var(--kb-h3-fg); }
.kb-syscol__body {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: calc(var(--kb-head-overlap) + 16px) 20px 8px;
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
}
.kb-syscol--feature .kb-syscol__body { border: 1.5px solid var(--kb-feature-border); }
.kb-syscol__body--mid { display: flex; align-items: center; justify-content: center; }
.kb-syscell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-secondary);
  text-align: center;
  margin: 0;
}
.kb-syscol__body--mid .kb-syscell { flex: 0 1 auto; }
.kb-syscell + .kb-syscell { border-top: 1px solid var(--border-subtle); }
.kb-syscell__t { display: block; }
.kb-syscell strong { font-weight: var(--fw-semibold); color: var(--color-data-black); }
/* KnowledgeBuilder rows: icon + accent bold lead on its own line, rest below */
.kb-syscell__lead { display: block; margin-bottom: 4px; }
.kb-syscell--kb .kb-syscell__lead strong { color: var(--color-arch-purple); }
.kb-syscell__icon { width: 18px; height: 18px; vertical-align: -3px; margin-right: 7px; object-fit: contain; }

/* ===================== 6. INTEGRATED SEARCH ===================== */
.kb-search { background: var(--kb-search-bg, var(--color-draft-white)); padding: clamp(56px, 7vw, 96px) 0; }
.kb-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px clamp(40px, 6vw, 90px);
  max-width: 960px;
  margin: 0 auto;
}
.kb-feature { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.kb-feature__icon {
  width: 46px; height: 46px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-arch-purple);
}
.kb-feature__icon svg { width: 30px; height: 30px; }
.kb-feature p { font-size: 18px; color: var(--color-data-black); margin: 0; }
.kb-feature p strong { font-weight: var(--fw-semibold); }

/* ---- Call-out design variants (Tweaks-driven). Default "inline". ---- */
/* Cards: boxed white cards, icon in a tinted rounded chip, text below. */
.kb-features[data-feat="cards"] { gap: 22px; }
.kb-features[data-feat="cards"] .kb-feature {
  grid-template-columns: 1fr;
  justify-items: start;
  align-items: start;
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px 26px;
}
.kb-features[data-feat="cards"] .kb-feature__icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: var(--purple-50);
}
.kb-features[data-feat="cards"] .kb-feature__icon svg { width: 28px; height: 28px; }
.kb-features[data-feat="cards"] .kb-feature p { font-size: 17px; line-height: 1.4; }

/* Stacked: 4 across, centered, circular icon on top, smaller type. */
.kb-features[data-feat="stacked"] {
  grid-template-columns: repeat(4, 1fr);
  max-width: 1060px;
  align-items: start;
  gap: 28px;
}
.kb-features[data-feat="stacked"] .kb-feature {
  grid-template-columns: 1fr;
  justify-items: center;
  text-align: center;
  gap: 14px;
}
.kb-features[data-feat="stacked"] .kb-feature__icon {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--purple-50);
  border: 1px solid var(--purple-200);
}
.kb-features[data-feat="stacked"] .kb-feature__icon svg { width: 30px; height: 30px; }
.kb-features[data-feat="stacked"] .kb-feature p { font-size: 16px; line-height: 1.4; }
/* Two-item group, centered on the page */
.kb-features--pair[data-feat="stacked"] {
  grid-template-columns: repeat(2, minmax(0, 240px));
  justify-content: center;
  max-width: 760px;
}
/* Three-item group, centered on the page */
.kb-features--trio[data-feat="stacked"] {
  grid-template-columns: repeat(3, minmax(0, 240px));
  justify-content: center;
  max-width: 860px;
}

.kb-action { text-align: center; }
.kb-action__title { margin-bottom: clamp(36px, 4vw, 56px); }
.kb-demo {
  max-width: 1040px;
  margin: 0 auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--color-draft-white);
}
.kb-demo__frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 0;
}
@media (max-width: 720px) {
  .kb-demo__frame { aspect-ratio: 3 / 4; }
}

/* ===================== 7. SUCCESS STORY ===================== */

/* ===================== 7. SUCCESS STORY ===================== */
.kb-story { background: var(--color-draft-white); padding: clamp(56px, 7vw, 96px) 0; }
.kb-cpt {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  margin-bottom: 0;
}
.kb-vconn {
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--color-arch-purple);
  margin: clamp(14px, 2vw, 22px) 0;
}
.kb-vconn svg { width: 30px; height: 30px; }
.kb-cpt__card {
  border: 1.5px solid var(--purple-300);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  padding: 26px 40px;
}
.kb-cpt__label { font-size: 17px; font-weight: var(--fw-semibold); color: var(--color-arch-purple); margin: 0 0 12px; }
.kb-cpt__text { font-size: 16px; line-height: 1.55; color: var(--color-data-black); margin: 0; text-wrap: pretty; }

.kb-solution__label {
  text-align: center;
  font-size: clamp(24px, 2.6vw, 32px);
  font-weight: var(--fw-semibold);
  color: var(--color-arch-purple);
  margin: 0 0 8px;
}
.kb-solution {
  position: relative;
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-xl);
  padding: clamp(36px, 4vw, 56px) 40px;
  margin-bottom: 0;
}
/* plain framed panel (speech-bubble pointer removed per design review) */
.kb-solution::before {
  content: none;
}
.kb-solution__intro {
  margin-bottom: clamp(28px, 3.5vw, 44px);
  padding-bottom: clamp(24px, 3vw, 36px);
  border-bottom: 1px solid var(--border-subtle);
}
.kb-solution__intro .kb-cpt__label { margin-bottom: 10px; }
.kb-solution__cols {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: clamp(14px, 2vw, 32px);
  align-items: start;
  margin-bottom: 40px;
}
.kb-scol-head { position: relative; }
.kb-scol-head__title {
  font-family: var(--font-sans);
  font-weight: var(--fw-semibold);
  font-size: clamp(22px, 2.2vw, 30px);
  letter-spacing: -0.01em;
  color: var(--color-data-black);
  margin: 0 0 14px;
  display: flex; align-items: center; gap: 10px;
}
.kb-scol-head__spark { color: var(--color-arch-purple); display: inline-flex; }
.kb-scol-head__spark svg { width: 28px; height: 28px; }
.kb-scol-head__desc { font-size: 14.5px; line-height: 1.55; color: var(--color-data-black); margin: 0; text-wrap: pretty; }
.kb-scol-head__desc strong { font-weight: var(--fw-semibold); }
/* connector cells between the column heads */
.kb-scol-conn {
  align-self: start;
  position: relative;
  height: clamp(30px, 2.2vw, 34px);   /* ≈ column-title cap height — keeps icons on the title line */
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  text-align: center;
}
.kb-scol-conn__label {
  position: absolute;
  top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  font-size: 11.5px; font-weight: var(--fw-semibold); color: var(--fg-secondary);
  white-space: nowrap; line-height: 1.2;
}
.kb-scol-conn__logo { color: var(--color-data-black); display: inline-flex; }
.kb-scol-conn__logo svg { width: 28px; height: 36px; display: block; }
.kb-scol-conn__arrow { color: var(--purple-400); display: inline-flex; }
.kb-scol-conn__arrow svg { width: 24px; height: 24px; display: block; }

/* --- connector layout variants (Tweaks-driven) --- */
/* V1 "inline" (default): logo on the title line, "Auto Structuring" caption
   below; second connector is an arrow on the same line. */
.kb-solution__cols[data-conn="inline"] .kb-scol-conn--auto .kb-scol-conn__arrow { display: none; }

/* V2 "arrows": both gaps show an arrow on the title line; the first arrow
   carries the "Auto Structuring" caption below. Symmetric, minimal. */
.kb-solution__cols[data-conn="arrows"] .kb-scol-conn--auto .kb-scol-conn__logo { display: none; }

/* V3 "pill": the Auto Structuring marker is a lavender pill (logo + label
   inline) centred on the title line; second connector is an arrow. */
/* Equal-width connector tracks so the three content columns stay symmetric,
   and both connectors render as matching lavender pills. */
.kb-solution__cols[data-conn="pill"] { grid-template-columns: 1fr 150px 1fr 150px 1fr; }
.kb-solution__cols[data-conn="pill"] .kb-scol-conn {
  align-self: center;
  justify-self: center;
  width: max-content;
  height: auto;
  background: var(--purple-50);
  border: 1px solid var(--purple-200);
  border-radius: var(--radius-pill);
  padding: 7px 15px;
  gap: 8px;
}
.kb-solution__cols[data-conn="pill"] .kb-scol-conn--auto .kb-scol-conn__arrow { display: none; }
.kb-solution__cols[data-conn="pill"] .kb-scol-conn--auto .kb-scol-conn__logo svg { width: 18px; height: 23px; }
.kb-solution__cols[data-conn="pill"] .kb-scol-conn--auto .kb-scol-conn__label { position: static; transform: none; }
.kb-solution__cols[data-conn="pill"] .kb-scol-conn__arrow { color: var(--color-arch-purple); }

.kb-srow {
  display: grid;
  grid-template-columns: 1fr 40px 1fr auto 1fr;
  gap: clamp(12px, 1.6vw, 28px);
  align-items: center;
  padding: 28px 0;
}
.kb-srow + .kb-srow { border-top: 1px solid var(--border-subtle); }

/* ---- source-row slider (autoplay + dots + chevrons) ---- */
.kb-slider { position: relative; }
.kb-slider__track { position: relative; display: flex; flex-direction: column; justify-content: center; }
.kb-slider .kb-srow + .kb-srow { border-top: 0; }
.kb-srow[hidden] { display: none; }
.kb-srow.is-active { animation: kbSlideFade 0.45s var(--ease-out); }
@keyframes kbSlideFade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.kb-slider__controls {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin-top: 8px;
}
.kb-slider__chev {
  width: 40px; height: 44px; border-radius: 0;
  border: 0;
  background: transparent;
  color: var(--gray-500);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: color var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}
.kb-slider__chev:hover { background: transparent; color: var(--color-arch-purple); transform: scale(1.1); }
.kb-slider__chev:focus-visible { outline: none; box-shadow: var(--shadow-focus); border-radius: var(--radius-sm); }
.kb-slider__chev svg { width: 24px; height: 24px; }
.kb-slider__dots { display: flex; align-items: center; gap: 12px; }
.kb-slider__dot {
  position: relative;
  width: 9px; height: 9px; border-radius: 50%; padding: 0;
  border: 0; cursor: pointer;
  background: var(--gray-400);
  transition: background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}
.kb-slider__dot::before { content: ""; position: absolute; inset: -9px; }  /* larger hit target */
.kb-slider__dot:hover { background: var(--purple-300); }
.kb-slider__dot[aria-current="true"] { background: var(--color-arch-purple); transform: scale(1.3); }
.kb-slider__dot:focus-visible { outline: none; box-shadow: var(--shadow-focus); }
.kb-srow__source { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.kb-srow__pill {
  background: var(--kb-pill-bg);
  color: var(--kb-pill-fg);
  font-size: 13px; font-weight: var(--fw-semibold);
  padding: 7px 22px;
  border-radius: var(--radius-pill);
}
.kb-srow__thumb { width: 100%; max-width: 230px; }
.kb-srow__thumb img { display: block; width: 100%; height: auto; }
.kb-srow__cap { font-size: 14px; line-height: 1.45; color: var(--color-data-black); text-align: center; margin: 0; text-wrap: pretty; }
.kb-srow__line { height: 1.5px; background: var(--border-subtle); width: 100%; }
.kb-srow__spark { color: var(--purple-300); display: inline-flex; justify-self: center; }
.kb-srow__spark svg { width: 32px; height: 32px; }
.kb-srow__table {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-surface);
}
.kb-srow__table table { width: 100%; border-collapse: collapse; }
.kb-srow__table th {
  font-size: 11.5px; font-weight: var(--fw-semibold); color: var(--color-data-black);
  text-align: center; padding: 9px 8px;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}
.kb-srow__table td {
  font-size: 11px; color: var(--fg-secondary);
  text-align: center; padding: 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.kb-srow__table th + th, .kb-srow__table td + td { border-left: 1px solid var(--border-subtle); }
.kb-srow__table tbody tr:last-child td { border-bottom: 0; }
.kb-srow__queries { display: flex; flex-direction: column; gap: 14px; }
.kb-query {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--purple-200);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--color-data-black);
  text-wrap: pretty;
}
.kb-query::before {
  content: "";
  flex: 0 0 auto;
  width: 18px; height: 18px;
  margin-top: 1px;
  background: var(--color-arch-purple);
  -webkit-mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3l1.8 5.4L19 10l-5.2 1.6L12 17l-1.8-5.4L5 10l5.2-1.6L12 3z" fill="%23000"/></svg>') center / contain no-repeat;
          mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3l1.8 5.4L19 10l-5.2 1.6L12 17l-1.8-5.4L5 10l5.2-1.6L12 3z" fill="%23000"/></svg>') center / contain no-repeat;
}

.kb-result {
  width: 100%;
  margin: 0;
  border: 1.5px solid var(--purple-300);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  padding: 32px 40px;
}
.kb-result__label { font-size: 17px; font-weight: var(--fw-semibold); color: var(--color-arch-purple); margin: 0 0 14px; }
.kb-result__text { font-size: 16px; line-height: 1.6; color: var(--color-data-black); margin: 0; text-wrap: pretty; }

/* ===================== 8. CTA ===================== */
.kb-cta { background: var(--bg-section-alt); padding: clamp(64px, 8vw, 104px) 0; }
.kb-cta__inner {
  max-width: 720px;
  margin: 0 auto;
  background: var(--color-draft-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.kb-cta__media { height: 200px; }
.kb-cta__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.kb-cta__head { padding: clamp(32px, 4vw, 48px) clamp(32px, 4vw, 52px) 0; text-align: center; }
.kb-cta__eyebrow {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: var(--fw-semibold);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--color-arch-purple); margin: 0 0 16px;
}
.kb-cta__title {
  font-family: var(--font-sans); font-weight: var(--fw-light);
  font-size: clamp(28px, 3.4vw, 42px); line-height: 1.1; letter-spacing: -0.02em;
  color: var(--color-data-black); margin: 0; text-wrap: balance;
}
.kb-cta__sub { font-size: 17px; line-height: 1.6; color: var(--fg-secondary); margin: 16px auto 0; max-width: 52ch; text-wrap: pretty; }
.kb-cta__form { padding: 22px clamp(32px, 4vw, 52px) clamp(32px, 4vw, 52px); }
.kb-cta__form .hs-form-frame { width: 100%; min-height: 160px; }

/* CTA section — tighten the (otherwise tall) shared padding for this page. */
#kb-cta.td-ctaA { padding: clamp(36px, 4vw, 56px) 0; }
#kb-cta .hs-form-frame { min-height: 0; }

/* HubSpot embedded form — best-effort font override to match site type.
   Only applies if the form renders in the light DOM; Shadow-DOM / iframe
   embeds ignore page CSS (set the font in HubSpot's form style editor). */
#kb-cta .hs-form-frame,
#kb-cta .hs-form-frame :is(input, select, textarea, button, label, legend, p, span, a, h1, h2, h3, h4) {
  font-family: var(--font-sans), "Noto Sans JP", sans-serif !important;
}

/* ============================================================
   BILINGUAL ADDITIONS
   The English copy stays exactly as authored; the Japanese version
   (from the JP design) is added beneath each element as a .kb-jp block.
   Order does not matter — English first, Japanese added under it.
   ============================================================ */
.kb-jp {
  display: block;
  font-family: var(--font-sans);
  font-weight: var(--fw-regular);
  letter-spacing: normal;
  text-wrap: pretty;
}
/* Heading contexts — JP set smaller than the Light display English. */
.kb-h2 .kb-jp,
.kb-hero__title .kb-jp,
.kb-pipe__title .kb-jp,
.kb-action__title .kb-jp,
.kb-solution__label .kb-jp {
  font-size: clamp(20px, 2vw, 27px);
  line-height: 1.3;
  color: var(--color-data-black);
  margin-top: 10px;
}
.kb-scol-head__title .kb-jp { font-size: clamp(16px, 1.6vw, 20px); line-height: 1.3; color: var(--color-data-black); margin-top: 6px; }
.kb-pipe__title .kb-jp { color: var(--color-arch-purple); }
.kb-cpt__label .kb-jp,
.kb-result__label .kb-jp,
.kb-solution__label .kb-jp { color: inherit; }
/* Body contexts — JP set in the same secondary tone, a touch smaller. */
.kb-sub .kb-jp,
.kb-hero__lede .kb-jp,
.kb-pipe__caption .kb-jp,
.kb-pipe__sub .kb-jp,
.kb-engine__note .kb-jp,
.kb-note p .kb-jp,
.kb-scol-head__desc .kb-jp,
.kb-cpt__text .kb-jp,
.kb-result__text .kb-jp,
.kb-srow__cap .kb-jp,
.kb-feature p .kb-jp {
  font-size: 0.95em;
  color: var(--fg-secondary);
  margin-top: 6px;
}
/* Short label/pill/tab contexts — JP inline-ish under the English. */
.kb-field__label .kb-jp,
.kb-attrs__head .kb-jp,
.kb-attr dt .kb-jp,
.kb-step__tab .kb-jp,
.kb-output .kb-jp,
.kb-input .kb-jp,
.kb-engine__chip .kb-jp,
.kb-srow__pill .kb-jp,
.kb-mcard__label .kb-jp,
.kb-mrow span .kb-jp,
.kb-syscol__head .kb-jp,
.kb-scol-conn__label .kb-jp {
  font-size: 0.92em;
  font-weight: var(--fw-regular);
  opacity: 0.85;
  margin-top: 2px;
}
.kb-output .kb-jp,
.kb-engine__chip .kb-jp { color: inherit; opacity: 0.9; }
.kb-step__tab .kb-jp { color: inherit; }

/* Comparison cells + saved-query cards get a body-style JP line. */
.kb-syscell .kb-jp,
.kb-query .kb-jp {
  display: block;
  font-size: 0.92em;
  color: var(--fg-secondary);
  margin-top: 6px;
}
.kb-syscell--kb .kb-jp { color: var(--fg-secondary); }
/* Let flex chips wrap so the JP line sits under the English. */
.kb-input, .kb-output, .kb-step__tab { flex-wrap: wrap; }
.kb-input .kb-jp, .kb-output .kb-jp, .kb-step__tab .kb-jp { flex-basis: 100%; }
.kb-output .kb-jp { text-align: center; }

/* ===================== FAQ (よくあるご質問) ===================== */
.kb-faq { background: var(--color-draft-white); padding: clamp(56px, 7vw, 96px) 0; }
.kb-faq__list {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.kb-faq__item {
  border: 1.5px solid var(--purple-200);
  border-radius: var(--radius-pill);
  background: var(--bg-surface);
  transition: border-color var(--duration-fast) var(--ease-out), border-radius var(--duration-base) var(--ease-out);
}
.kb-faq__item[open] { border-radius: var(--radius-xl); border-color: var(--purple-300); }
.kb-faq__q {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 30px;
  font-size: 17px;
  font-weight: var(--fw-semibold);
  color: var(--color-data-black);
}
.kb-faq__q::-webkit-details-marker { display: none; }
.kb-faq__q .kb-jp { display: block; font-size: 0.9em; font-weight: var(--fw-regular); color: var(--fg-secondary); margin-top: 4px; }
.kb-faq__chev {
  flex: 0 0 auto;
  width: 22px; height: 22px;
  color: var(--color-arch-purple);
  transition: transform var(--duration-base) var(--ease-out);
}
.kb-faq__item[open] .kb-faq__chev { transform: rotate(180deg); }
.kb-faq__a {
  padding: 0 30px 24px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--fg-secondary);
  text-wrap: pretty;
}
.kb-faq__a .kb-jp { color: var(--fg-secondary); margin-top: 6px; }
.kb-faq__more {
  display: block;
  width: max-content;
  margin: clamp(28px, 3vw, 40px) auto 0;
  font-size: 15px;
  font-weight: var(--fw-semibold);
  color: var(--color-arch-purple);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none; border: 0; cursor: pointer;
}

/* ===================== RELATED SOLUTIONS (関連ソリューション) ===================== */
.kb-relsol { background: var(--bg-section-alt); padding: clamp(56px, 7vw, 96px) 0; }
.kb-relsol__inner {
  max-width: var(--site-width, 1300px);
  margin: 0 auto;
  padding: 0 40px;
}
.kb-relsol__head {
  text-align: center;
  max-width: 760px;
  margin: 0 auto clamp(36px, 4vw, 52px);
}
.kb-relsol__eyebrow {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: var(--fw-semibold);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-arch-purple);
  margin: 0 0 20px;
}
.kb-relsol__title {
  font-family: var(--font-sans);
  font-weight: var(--fw-light);
  font-size: clamp(28px, 3.4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--color-data-black);
  margin: 0;
  text-wrap: balance;
}
.kb-relsol__sub {
  font-size: 17px;
  line-height: 1.6;
  color: var(--fg-tertiary);
  margin: 18px auto 0;
  max-width: 60ch;
  text-wrap: pretty;
}
.kb-relsol__cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  align-items: stretch;
}
.kb-relsol__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--purple-200);
  border-radius: var(--radius-xl);
  padding: 36px;
  text-decoration: none;
  transition: border-color var(--duration-fast) var(--ease-out),
              box-shadow var(--duration-base) var(--ease-out),
              transform var(--duration-base) var(--ease-out);
}
.kb-relsol__card:hover {
  border-color: var(--color-arch-purple);
  box-shadow: var(--shadow-sm);
  transform: translateY(-4px);
}
.kb-relsol__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  background: var(--purple-50);
  color: var(--color-arch-purple);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: var(--fw-medium);
  letter-spacing: 0.02em;
}
.kb-relsol__badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-arch-purple);
}
.kb-relsol__cardhead {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0 14px;
}
.kb-relsol__icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--purple-50);
  color: var(--color-arch-purple);
}
.kb-relsol__icon svg { width: 26px; height: 26px; }
.kb-relsol__ctitle {
  font-family: var(--font-sans);
  font-weight: var(--fw-medium);
  font-size: 23px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--color-data-black);
  margin: 0;
  text-wrap: pretty;
}
.kb-relsol__cdesc {
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg-tertiary);
  margin: 0 0 24px;
  text-wrap: pretty;
}
.kb-relsol__link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: var(--fw-medium);
  letter-spacing: 0.04em;
  color: var(--color-arch-purple);
}
.kb-relsol__arrow { display: inline-flex; transition: transform var(--duration-base) var(--ease-out); }
.kb-relsol__arrow svg { width: 14px; height: 14px; display: block; }
.kb-relsol__card:hover .kb-relsol__arrow { transform: translateX(3px); }
@media (max-width: 960px) {
  .kb-relsol__cards { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .kb-relsol__card { padding: 28px; }
}

/* ===================== RELATED CONTENT (関連コンテンツ) — carousel ===================== */
.kb-related { background: var(--color-draft-white); padding: clamp(56px, 7vw, 96px) 0; }

/* full-width viewport; track scrolls horizontally, cards snap */
.kb-related__viewport { width: 100%; overflow: hidden; }
.kb-related__track {
  display: flex;
  gap: clamp(20px, 2.2vw, 32px);
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 4px max(40px, calc((100% - 1300px) / 2 + 40px)) 8px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.kb-related__track::-webkit-scrollbar { display: none; }

.kb-rcard {
  flex: 0 0 clamp(280px, 26vw, 330px);
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
}
.kb-rcard__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 11;
  overflow: hidden;
  background: linear-gradient(150deg, var(--color-arch-purple), #8A8DE8 55%, var(--color-taro));
  text-decoration: none;
}
.kb-rcard__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.kb-rcard__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(16,16,16,0.18) 0%, rgba(16,16,16,0.32) 45%, rgba(16,16,16,0.58) 100%);
}
.kb-rcard__overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  padding: 22px;
  text-align: center;
}
.kb-rcard__otitle {
  font-family: var(--font-sans);
  font-weight: var(--fw-bold);
  font-size: clamp(17px, 1.5vw, 20px);
  line-height: 1.45;
  color: var(--color-draft-white);
  text-wrap: balance;
}
.kb-rcard__osub {
  font-size: clamp(13px, 1.1vw, 15px);
  font-weight: var(--fw-regular);
  color: rgba(255,255,255,0.92);
  line-height: 1.5;
}
.kb-rcard__body { padding: 18px 4px 4px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.kb-rcard__tag {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: var(--fw-medium);
  letter-spacing: 0.14em;
  color: var(--fg-tertiary);
  margin: 0;
}
.kb-rcard__title {
  font-size: 15.5px;
  font-weight: var(--fw-medium);
  line-height: 1.6;
  color: var(--color-data-black);
  margin: 0;
  text-wrap: pretty;
}
.kb-rcard__title a {
  color: inherit;
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
.kb-rcard__title a:hover { color: var(--color-arch-purple); text-decoration: underline; text-underline-offset: 3px; }
.kb-rcard__link {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  font-weight: var(--fw-medium);
  color: var(--color-arch-purple);
  text-decoration: none;
}
.kb-rcard__link:hover { color: var(--purple-700); text-decoration: underline; text-underline-offset: 3px; }
.kb-rcard__arrow { font-size: 13px; }

.kb-related__nav {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: clamp(28px, 3.5vw, 44px);
}
.kb-related__arrowbtn {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--purple-200);
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--color-arch-purple);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.kb-related__arrowbtn:hover { background: var(--purple-50); border-color: var(--color-arch-purple); }
.kb-related__arrowbtn:disabled { opacity: 0.4; cursor: default; }
.kb-related__arrowbtn:disabled:hover { background: var(--bg-surface); border-color: var(--purple-200); }
.kb-related__arrowbtn svg { width: 20px; height: 20px; }

/* ===================== JP CTA (まずは相談する) ===================== */
.kb-jcta { background: linear-gradient(135deg, var(--color-arch-purple), #8A8DE8); padding: clamp(56px, 7vw, 96px) 0; }
.kb-jcta__inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 40px;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(40px, 5vw, 72px);
  align-items: center;
}
.kb-jcta__copy { color: var(--color-draft-white); }
.kb-jcta__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.16); color: var(--color-draft-white); margin-bottom: 22px;
}
.kb-jcta__icon svg { width: 26px; height: 26px; }
.kb-jcta__title {
  font-family: var(--font-sans); font-weight: var(--fw-light);
  font-size: clamp(30px, 3.6vw, 44px); line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 18px;
}
.kb-jcta__lede { font-size: 15.5px; line-height: 1.85; color: rgba(255,255,255,0.88); margin: 0; max-width: 420px; }
.kb-jformcard { background: var(--color-draft-white); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: clamp(28px, 3vw, 40px); }
.kb-jform { display: flex; flex-direction: column; gap: 18px; }
.kb-jform__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.kb-jfield { display: flex; flex-direction: column; gap: 8px; }
.kb-jfield label { font-size: 13.5px; font-weight: var(--fw-semibold); color: var(--color-data-black); }
.kb-jreq { color: var(--color-arch-purple); }
.kb-jfield input, .kb-jfield textarea {
  font-family: var(--font-sans); font-size: 14.5px; color: var(--color-data-black);
  background: var(--gray-100); border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
  padding: 12px 14px; line-height: 1.5;
  transition: border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out), background var(--duration-fast) var(--ease-out);
}
.kb-jfield textarea { resize: vertical; min-height: 96px; }
.kb-jfield input::placeholder, .kb-jfield textarea::placeholder { color: var(--gray-500); }
.kb-jfield input:focus, .kb-jfield textarea:focus {
  outline: none; background: var(--color-draft-white); border-color: var(--color-arch-purple); box-shadow: var(--shadow-focus);
}
.kb-jform__error { margin: 0; font-size: 13px; color: var(--state-error-fg); background: var(--state-error-bg); border-radius: var(--radius-md); padding: 10px 12px; }
.kb-jform__submit {
  align-self: center; display: inline-flex; align-items: center; justify-content: center;
  min-width: 180px; padding: 13px 28px; margin-top: 2px;
  font-family: var(--font-sans); font-size: 15px; font-weight: var(--fw-semibold);
  color: var(--color-draft-white); background: var(--color-arch-purple); border: none; border-radius: var(--radius-md);
  cursor: pointer; transition: background var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
}
.kb-jform__submit:hover { background: var(--purple-700); }
.kb-jform__submit:active { transform: translateY(1px); }
.kb-jform__legal { margin: 0; font-size: 11.5px; line-height: 1.7; color: var(--fg-tertiary); text-align: center; }
.kb-jform__success { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 24px 8px; }
.kb-jform__success-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--state-success-bg); color: var(--state-success-fg); margin-bottom: 18px;
}
.kb-jform__success-icon svg { width: 28px; height: 28px; }
.kb-jform__success-title { font-size: 18px; font-weight: var(--fw-semibold); color: var(--color-data-black); margin: 0 0 8px; }
.kb-jform__success-text { font-size: 14px; color: var(--fg-secondary); margin: 0; }
@media (max-width: 880px) {
  .kb-jcta__inner { grid-template-columns: 1fr; gap: 36px; }
  .kb-jcta__lede { max-width: none; }
}
@media (max-width: 600px) {
  .kb-jcta__inner { padding: 0 22px; }
  .kb-jform__row { grid-template-columns: 1fr; }
  .kb-jform__submit { width: 100%; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1040px) {
  .kb-pipe__grid { grid-template-columns: 1fr; gap: 24px; }
  .kb-pipe__head, .kb-pipe__caption { min-height: 0; }
  .kb-pipe__head { margin-bottom: 14px; }
  .kb-pipe__arrow { transform: rotate(90deg); justify-self: center; }
  .kb-flow { grid-template-columns: 1fr; }
  .kb-flow__chevron { transform: rotate(90deg); justify-self: center; }
  .kb-compare { grid-template-columns: 1fr 1fr; }
  .kb-mcard { margin-top: 0; }
  .kb-syscol__head { margin-left: 0; margin-right: 0; }
  .kb-srow { grid-template-columns: 1fr; gap: 18px; text-align: center; }
  .kb-srow__line { display: none; }
  .kb-srow__spark { display: none; }
}
@media (max-width: 1000px) {
  .kb-hero__inner { grid-template-columns: 1fr; gap: 40px; }
  .kb-hero__copy { max-width: none; order: 1; }
  .kb-hero__media { order: 2; }
  .kb-hero__lede { max-width: 60ch; }
}
@media (max-width: 1024px) {
  /* Stack the 解決策 columns earlier so the descriptions get the full
     lede width instead of becoming narrow, tall text blocks. */
  .kb-solution__cols,
  .kb-solution__cols[data-conn="pill"] {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .kb-scol-conn { height: auto; flex-direction: row; gap: 10px; }
  .kb-scol-conn__label { position: static; transform: none; }
  .kb-scol-conn__arrow svg { transform: rotate(90deg); }
}
@media (max-width: 860px) {
  .kb-formats__grid { grid-template-columns: 1fr; }
  .kb-features { grid-template-columns: 1fr; }
  .kb-features[data-feat="stacked"] { grid-template-columns: 1fr 1fr; }
  .kb-cpt { grid-template-columns: 1fr; }
  .kb-solution__cols { grid-template-columns: 1fr; gap: 22px; }
  .kb-scol-conn { height: auto; flex-direction: row; gap: 10px; }
  .kb-scol-conn__label { position: static; transform: none; }
  .kb-scol-conn__arrow svg { transform: rotate(90deg); }
}
@media (max-width: 720px) {
  .kb-inner, .kb-hero__inner { padding-left: 24px; padding-right: 24px; }
  .kb-compare { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .kb-hero__inner { padding-top: 40px; padding-bottom: 48px; gap: 32px; }
  .kb-hero__title { font-size: clamp(28px, 8vw, 38px); }
  .kb-hero__lede { font-size: 16px; max-width: none; }
  .kb-hero__actions { margin-top: 30px; }
}
