html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  color: #1f2937;
  background: #f6f7f9;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.75;
}

a {
  color: #0f766e;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid #d8dee6;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.header-inner,
.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
}

.brand {
  font-weight: 700;
  color: #111827;
  text-decoration: none;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  color: #374151;
  text-decoration: none;
  font-size: 0.94rem;
}

.nav a:hover,
.nav a[aria-current="page"] {
  background: #e7f3f1;
  color: #0f766e;
}

.nav .primary-link {
  background: #0f766e;
  color: #fff;
  font-weight: 700;
}

.nav .primary-link:hover {
  background: #115e59;
  color: #fff;
}

.hero {
  padding: 48px 0 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #0f766e;
  font-size: 0.88rem;
  font-weight: 700;
}

h1,
h2,
h3 {
  color: #111827;
  line-height: 1.35;
}

h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3.2vw, 2.65rem);
  letter-spacing: 0;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

h2 {
  margin: 0 0 18px;
  font-size: 1.55rem;
}

h3 {
  margin: 0 0 10px;
  font-size: 1.08rem;
}

.lead {
  max-width: 720px;
  margin: 18px 0 0;
  font-size: 1.05rem;
  color: #4b5563;
}

.notice {
  margin-top: 28px;
  border-left: 4px solid #0f766e;
  background: #fff;
  padding: 16px 18px;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.notice strong {
  display: block;
  margin-bottom: 4px;
  color: #111827;
}

.section {
  padding: 28px 0;
  scroll-margin-top: 88px;
}

.section > p {
  max-width: 820px;
}

.section-lead {
  max-width: 780px;
  margin: -4px 0 18px;
  color: #4b5563;
}

.panel {
  background: #fff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.toc {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.toc a {
  display: block;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d8dee6;
  border-radius: 6px;
  background: #fff;
  color: #1f2937;
  text-decoration: none;
}

.toc a:hover {
  border-color: #0f766e;
  color: #0f766e;
}

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

.video-card {
  border: 1px solid #d8dee6;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.video-card h3 {
  margin-bottom: 12px;
}

.video-card a {
  display: inline-flex;
  margin-top: 12px;
  font-weight: 700;
  text-decoration: none;
}

.video-frame {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  background: #111827;
}

.video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-grid li,
.flow-step {
  border: 1px solid #d8dee6;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.flow-board {
  padding: 28px 24px 24px;
  border-top: 4px solid #0f766e;
  background: #edf7f6;
}

.flow-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 22px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flow-step {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 260px;
  padding: 38px 14px 18px;
  border-color: #9fd0cd;
  text-align: center;
  box-shadow: 0 3px 0 #56b8c5;
}

.flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -18px;
  width: 0;
  height: 0;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 12px solid #56b8c5;
  transform: translateY(-50%);
}

.flow-number {
  position: absolute;
  top: -24px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #2ca6b6;
  color: #fff;
  font-size: 1.45rem;
  font-weight: 700;
  transform: translateX(-50%);
}

.flow-step h3 {
  margin: 0 0 10px;
  min-height: 48px;
  font-size: 1.06rem;
}

.flow-step p {
  margin: 0;
  color: #374151;
  font-size: 0.95rem;
  line-height: 1.65;
}

.flow-visual {
  position: relative;
  width: 72px;
  height: 58px;
  margin: 8px auto 18px;
  color: #0f766e;
}

.flow-visual::before,
.flow-visual::after,
.flow-visual span,
.flow-visual span::before,
.flow-visual span::after {
  position: absolute;
  content: "";
  box-sizing: border-box;
}

.visual-template::before {
  inset: 4px 14px 2px 14px;
  border: 2px solid #4b5563;
  background: #fff;
}

.visual-template::after {
  top: 16px;
  left: 24px;
  width: 24px;
  height: 2px;
  background: #2ca6b6;
  box-shadow: 0 10px 0 #d99f35, 0 20px 0 #2ca6b6;
}

.visual-template span {
  right: 12px;
  bottom: 2px;
  width: 18px;
  height: 18px;
  border-right: 2px solid #d99f35;
  border-bottom: 2px solid #d99f35;
}

.visual-upload::before {
  left: 13px;
  right: 13px;
  bottom: 4px;
  height: 18px;
  border: 2px solid #4b5563;
  border-top: 0;
  background: #fff;
}

.visual-upload::after {
  top: 6px;
  left: 50%;
  width: 22px;
  height: 22px;
  border-left: 4px solid #2ca6b6;
  border-top: 4px solid #2ca6b6;
  transform: translateX(-50%) rotate(45deg);
}

.visual-upload span {
  top: 14px;
  left: 50%;
  width: 4px;
  height: 28px;
  background: #2ca6b6;
  transform: translateX(-50%);
}

.visual-input::before {
  inset: 5px 10px 5px 10px;
  border: 2px solid #4b5563;
  background: #fff;
}

.visual-input::after {
  top: 17px;
  left: 22px;
  width: 28px;
  height: 2px;
  background: #2ca6b6;
  box-shadow: 0 10px 0 #d99f35, 0 20px 0 #2ca6b6;
}

.visual-input span {
  right: 6px;
  bottom: 8px;
  width: 26px;
  height: 8px;
  border-radius: 4px;
  background: #d99f35;
  transform: rotate(-28deg);
}

.visual-zip::before {
  inset: 8px 18px 4px 18px;
  border: 2px solid #4b5563;
  background: #fff;
}

.visual-zip::after {
  top: 8px;
  left: 36px;
  width: 2px;
  height: 42px;
  background: repeating-linear-gradient(to bottom, #2ca6b6 0 4px, transparent 4px 8px);
}

.visual-zip span {
  left: 20px;
  bottom: 4px;
  width: 34px;
  height: 12px;
  border: 2px solid #d99f35;
  background: #fff8e8;
}

.visual-loop::before {
  top: 7px;
  left: 8px;
  width: 50px;
  height: 40px;
  border: 4px solid #2ca6b6;
  border-right-color: transparent;
  border-radius: 50%;
}

.visual-loop::after {
  right: 8px;
  top: 9px;
  width: 14px;
  height: 14px;
  border-top: 4px solid #2ca6b6;
  border-right: 4px solid #2ca6b6;
  transform: rotate(38deg);
}

.visual-loop span {
  left: 26px;
  top: 18px;
  width: 20px;
  height: 24px;
  border: 2px solid #4b5563;
  background: #fff;
}

.flow-cycle {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #bddedb;
  color: #374151;
}

.flow-cycle strong {
  flex: 0 0 auto;
  color: #0f766e;
  font-size: 1rem;
}

.flow-cycle span {
  min-width: 0;
}

.workflow {
  display: grid;
  gap: 28px;
}

.workflow-block {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  gap: 24px;
  align-items: start;
  padding: 28px 0;
  border-top: 1px solid #d8dee6;
}

.workflow-block:first-child {
  padding-top: 0;
  border-top: 0;
}

.workflow-block.reverse {
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
}

.workflow-block.reverse .workflow-text {
  order: initial;
}

.workflow-block.reverse .screenshot {
  order: initial;
}

.workflow-text {
  min-width: 0;
}

.workflow-text p {
  margin: 0 0 12px;
}

.workflow-text p:last-child {
  margin-bottom: 0;
}

.screenshot {
  margin: 0;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  overflow: hidden;
  background: #f9fafb;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.screenshot img {
  display: block;
  width: 100%;
  height: clamp(280px, 42vw, 520px);
  object-fit: cover;
  object-position: top center;
  background: #fff;
}

.screenshot-visual {
  position: relative;
  overflow: hidden;
  background: #fff;
}

.screenshot--annotated .screenshot-visual img {
  height: auto;
  object-fit: initial;
}

.annotation-box {
  position: absolute;
  box-sizing: border-box;
  border: 4px solid #e11d48;
  border-radius: 8px;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.92),
    0 8px 22px rgba(190, 18, 60, 0.28);
  pointer-events: none;
}

.annotation-box--upload {
  left: 8.9%;
  top: 10.1%;
  width: 82.1%;
  height: 21.2%;
}

.annotation-box--inspection {
  left: 8.9%;
  top: 23.6%;
  width: 82%;
  height: 31%;
}

.annotation-box--abnormal {
  left: 10.4%;
  top: 33.7%;
  width: 79.2%;
  height: 42.8%;
}

.annotation-box--result {
  left: 8.9%;
  top: 18.6%;
  width: 82.1%;
  height: 20.1%;
}

.screenshot figcaption {
  padding: 10px 12px;
  color: #4b5563;
  font-size: 0.9rem;
  border-top: 1px solid #d8dee6;
}

.callout {
  margin: 16px 0 0;
  color: #374151;
}

.input-list {
  display: grid;
  gap: 0;
  margin: 16px 0 0;
}

.input-list div {
  display: grid;
  grid-template-columns: minmax(120px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #e5e7eb;
}

.input-list.compact div {
  padding: 8px 0;
}

.input-list dt,
.input-list dd {
  margin: 0;
  min-width: 0;
}

.input-list dt {
  color: #111827;
  font-weight: 700;
}

.input-list dd {
  color: #374151;
}

.output-summary {
  margin-top: 18px;
}

.output-summary-heading {
  margin: 0 0 8px;
  color: #111827;
  font-size: 0.96rem;
  font-weight: 700;
}

.output-file-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.output-file-list li {
  display: grid;
  grid-template-columns: minmax(190px, max-content) minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
}

.output-file-list code {
  justify-self: start;
  white-space: nowrap;
}

.output-file-list span {
  color: #374151;
}

.note-text {
  margin: 14px 0 0;
  color: #4b5563;
  font-size: 0.96rem;
}

.error-list {
  display: grid;
  gap: 0;
  max-width: 900px;
  margin: 0;
}

.error-list div {
  padding: 14px 0;
  border-top: 1px solid #e5e7eb;
}

.error-list div:first-child {
  border-top: 0;
}

.error-list dt,
.error-list dd {
  margin: 0;
}

.error-list dt {
  color: #111827;
  font-weight: 700;
}

.error-list dd {
  margin-top: 4px;
  color: #374151;
}

.warning {
  color: #7c2d12;
}

.table-wrap {
  overflow: hidden;
  border: 1px solid #d8dee6;
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: normal;
}

th {
  width: 30%;
  background: #f3f6f8;
  color: #111827;
  font-weight: 700;
}

tr:last-child th,
tr:last-child td {
  border-bottom: 0;
}

code {
  color: #111827;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.94em;
  overflow-wrap: break-word;
}

.details-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

details {
  border: 1px solid #d8dee6;
  border-radius: 8px;
  background: #fff;
}

summary {
  cursor: pointer;
  padding: 14px 16px;
  color: #111827;
  font-weight: 700;
}

details[open] summary {
  border-bottom: 1px solid #e5e7eb;
}

.details-body {
  padding: 16px;
}

.subsection-heading {
  margin-top: 18px;
}

.footer {
  margin-top: 36px;
  padding: 28px 0 42px;
  color: #6b7280;
  font-size: 0.92rem;
}

@media (max-width: 1100px) {
  .workflow-block,
  .workflow-block.reverse {
    grid-template-columns: 1fr;
  }

  .workflow-block {
    padding: 18px;
  }

  .workflow-block.reverse .workflow-text,
  .workflow-block.reverse .screenshot {
    order: initial;
  }

  .screenshot img {
    height: clamp(260px, 62vw, 480px);
  }

  .toc,
  .feature-grid,
  .video-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-board {
    padding: 28px 18px 20px;
  }

  .flow-steps {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .flow-step {
    min-height: auto;
    text-align: left;
    padding: 20px 18px 20px 76px;
  }

  .flow-step:not(:last-child)::after {
    top: auto;
    right: auto;
    bottom: -22px;
    left: 44px;
    border-top: 12px solid #56b8c5;
    border-right: 12px solid transparent;
    border-left: 12px solid transparent;
    border-bottom: 0;
    transform: none;
  }

  .flow-number {
    top: 18px;
    left: 18px;
    width: 42px;
    height: 42px;
    font-size: 1.25rem;
    transform: none;
  }

  .flow-visual {
    display: none;
  }

  .flow-step h3 {
    min-height: 0;
  }

  .flow-cycle {
    display: block;
  }

  .flow-cycle span {
    display: block;
    margin-top: 4px;
  }
}

@media (max-width: 640px) {
  .site-header {
    position: static;
  }

  .header-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero {
    padding-top: 32px;
  }

  .toc,
  .feature-grid,
  .video-grid {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }

  .workflow-block {
    padding: 14px;
  }

  .input-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .output-file-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  th,
  td {
    display: block;
    width: auto;
    padding: 10px 12px;
  }

  tr {
    display: block;
    border-bottom: 1px solid #e5e7eb;
  }

  tr:last-child {
    border-bottom: 0;
  }

  th {
    border-bottom: 0;
  }

  td {
    border-bottom: 0;
  }

  .screenshot img {
    height: clamp(220px, 76vw, 380px);
  }
}
