:root {
  --header-h: 85px;
  --toggle-h: 74px;
}

/* ============ role toggle (sticky) ============ */
.role-toggle {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 16px 64px;
  position: sticky;
  top: var(--header-h);
  z-index: 20;
  background: oklch(0.99 0.002 250);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.role-toggle.is-stuck { border-bottom-color: oklch(0.92 0.01 250); }

.tab-btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 32px;
  border-radius: 100px;
  border: 1px solid oklch(0.91 0.01 250);
  background: white;
  color: oklch(0.45 0.02 255);
  cursor: pointer;
  display: inline-block;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.tab-btn:hover { border-color: oklch(0.7 0.02 255); color: oklch(0.3 0.02 255); }
/* toggle active color is fixed brand navy regardless of the active panel's accent */
.tab-btn.active,
.tab-btn.active:hover {
  background: oklch(0.32 0.09 260);
  border-color: oklch(0.32 0.09 260);
  color: white;
}
.tab-btn:focus-visible { outline: 2px solid oklch(0.45 0.14 255); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .role-toggle { transition: none; }
}

/* ============ tokens (inherited from M-About01) ============ */
.manual-page {
  --ink:        oklch(0.22 0.03 260);
  --ink-body:   oklch(0.45 0.02 255);
  --ink-mute:   oklch(0.55 0.01 255);
  --line:       oklch(0.91 0.01 250);
  --line-soft:  oklch(0.92 0.01 250);
  --surface:    oklch(0.99 0.002 250);
  --surface-2:  oklch(0.98 0.005 250);

  --accent:      oklch(0.45 0.14 255);
  --accent-soft: oklch(0.93 0.03 255);
  --warn:        oklch(0.65 0.13 75);
  --warn-soft:   oklch(0.96 0.04 80);
}
.manual-page[data-role="demand"] {
  --accent:      oklch(0.58 0.10 180);
  --accent-soft: oklch(0.94 0.03 180);
}

.manual-panel { background: var(--surface); }

/* pill label, scoped so the plain-text hero .eyebrow is untouched */
.manual-page .eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: normal;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 12px;
  border-radius: 100px;
  margin: 0 0 16px;
}

.manual-page h2 { font-size: 30px; line-height: 1.4; font-weight: 700; margin: 0 0 20px; color: var(--ink); }
.manual-page p { font-size: 16px; line-height: 1.7; color: var(--ink-body); }

/* ============ band A: flow overview ============ */
.flow-band {
  padding: 72px 64px;
  background: var(--surface-2);
  border-top: 1px solid var(--line-soft);
}
.flow-band-inner { max-width: 1200px; margin: 0 auto; }
.flow-band-inner > p { max-width: 800px; margin: -8px 0 32px; }

.flow-overview {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}
.flow-overview li { display: flex; align-items: center; gap: 12px; }
.flow-overview li + li::before { content: "→"; color: var(--ink-mute); font-size: 16px; }

.flow-step {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-body);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
a.flow-step:hover { border-color: var(--accent); color: var(--accent); }

.flow-num {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

/* mini flow reused inside the supplier fieldwork print block */
.flow-overview.mini-flow .flow-step { padding: 8px 16px; font-size: 13px; }
.flow-overview.mini-flow .flow-num { width: 20px; height: 20px; font-size: 11px; }

.mini-flow { margin-bottom: 20px;}

/* ============ band B: 2-col body ============ */
.manual-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 96px 64px;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 72px;
  align-items: start;
  background: var(--surface);
  border-top: 1px solid var(--line-soft);
}

.step-nav {
  position: sticky;
  top: calc(var(--header-h) + var(--toggle-h) + 24px);
  display: flex;
  flex-direction: column;
}
.step-nav a {
  padding: 10px 0 10px 16px;
  font-size: 14px;
  color: var(--ink-body);
  border-left: 2px solid var(--line);
}
.step-nav a:hover { color: var(--ink); }
.step-nav a.is-active { color: var(--accent); font-weight: 700; border-left-color: var(--accent); }

.manual-content { min-width: 0; }

/* ============ step-section ============ */
.step-section { padding: 56px 0; border-top: 1px solid var(--line-soft); scroll-margin-top: calc(var(--header-h) + var(--toggle-h) + 16px); }
.step-section:first-child { padding-top: 0; border-top: 0; }

.step-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.step-num {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.step-head h2 { font-size: 26px; font-weight: 700; margin: 0; color: var(--ink); }
.step-content > * + * { margin-top: 20px; }

/* bullet lists inside step content (checklist has its own marker, see below) */
.step-content ul:not(.checklist) { list-style: none; margin: 0; padding: 0; }
.step-content ul:not(.checklist) li {
  position: relative;
  padding-left: 20px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-body);
}
.step-content ul:not(.checklist) li + li { margin-top: 10px; }
.step-content ul:not(.checklist) li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* ============ checklist ============ */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  position: relative;
  padding: 12px 0 12px 28px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-body);
  border-bottom: 1px solid var(--line-soft);
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: 15px;
  width: 15px; height: 15px;
  border: 2px solid var(--accent);
  border-radius: 4px;
  background: none;
}
.checklist li::after {
  content: "";
  position: absolute;
  left: 4px; top: 17px;
  width: 7px; height: 3px;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* ============ kv-table ============ */
.kv-table { width: 100%; border-collapse: collapse; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kv-table th, .kv-table td { padding: 14px 20px; text-align: left; font-size: 15px; border-bottom: 1px solid var(--line-soft); }
.kv-table thead th { background: var(--surface-2); font-size: 13px; font-weight: 700; color: var(--ink); }
.kv-table tbody th { width: 160px; font-weight: 600; color: var(--ink); vertical-align: top; }
.kv-table tbody td { color: var(--ink-body); line-height: 1.6; }
.kv-table tr:last-child th, .kv-table tr:last-child td { border-bottom: 0; }

/* ============ callout ============ */
.callout {
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 20px 24px;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-body);
}
.callout::before {
  content: "안내";
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.callout.warn::before { content: "주의"; color: oklch(0.48 0.12 60); }

/* ============ sub-step card ============ */
.sub-step {
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
}
.sub-step + .sub-step { margin-top: 20px; }
.sub-step-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 12px;
  border-radius: 100px;
  margin-bottom: 12px;
}
.sub-step h3 { font-size: 19px; font-weight: 700; margin: 0 0 8px; color: var(--ink); }
p.sub-flow { font-size: 13px; color: var(--ink-mute); font-variant-numeric: tabular-nums; margin: 0 0 16px; }
.sub-step > * + * { margin-top: 16px; }

/* ============ shot placeholder ============ */
.shot { margin: 0; max-width: 480px; }
.shot .shot-box {
  aspect-ratio: 16 / 10;
  border: 1px dashed oklch(0.85 0.02 250);
  border-radius: 12px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--ink-mute);
  font-size: 14px;
  margin: 15px 0px;
}
.shot figcaption { margin-top: 10px; font-size: 13px; color: var(--ink-mute); }

.print-only { display: none; }
.print-btn { margin-top: 20px; }


/* ============ responsive ============ */
@media (max-width: 860px) {
  .role-toggle { padding: 12px 20px; }
  :root { --toggle-h: 62px; }

  .flow-band { padding: 48px 20px; }
  .manual-body { padding: 64px 20px; grid-template-columns: 1fr; gap: 32px; }

  .flow-step { width: fit-content; max-width: 100%; box-sizing: border-box; }

  .step-nav {
    position: static;
    flex-direction: row;
    overflow-x: auto;
    gap: 20px;
    -webkit-overflow-scrolling: touch;
  }
  .step-nav .eyebrow { display: none; }
  .step-nav a { padding: 0 0 8px; white-space: nowrap; border-left: 0; border-bottom: 2px solid var(--line); }
  .step-nav a.is-active { border-left: 0; border-bottom-color: var(--accent); }

  .step-head h2 { font-size: 22px; }
  .step-num { width: 34px; height: 34px; font-size: 14px; }
  .sub-step { padding: 20px; }

  .kv-table, .kv-table thead, .kv-table tbody, .kv-table th, .kv-table td, .kv-table tr { display: block; }
  .kv-table thead { display: none; }
  .kv-table tr { border-bottom: 1px solid var(--line); padding: 12px 0; }
  .kv-table tr:last-child { border-bottom: 0; }
  .kv-table th, .kv-table td { padding: 4px 0; border-bottom: 0; }
  .kv-table tbody th { width: auto; }
}

/* ============ print ============ */
@page { size: A4 portrait; margin: 15mm; }

@media print {
  [hidden] { display: none !important; }

  header, footer, .step-nav, .flow-band, .page-hero,
  .role-toggle, .print-btn { display: none !important; }

  body.printing-fieldwork .step-section:not(#sup-fieldwork) { display: none !important; }
  body.printing-fieldwork #sup-fieldwork > *:not(.print-target) { display: none !important; }

  .print-target { display: block !important; }
  .print-only { display: block; }

  body { background: #fff; color: #000; font-size: 11pt; }
  .manual-body { display: block; padding: 0; }
  .step-num { print-color-adjust: exact; -webkit-print-color-adjust: exact; }

  /* always lay the flow chips out horizontally on paper, regardless of viewport width */
  .flow-overview, .flow-overview li {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    width: auto !important;
  }
  .flow-overview li + li::before { content: "→" !important; }
  .flow-step { width: fit-content !important; }
  .print-head {
    font-size: 15pt; font-weight: 700;
    padding-bottom: 8pt; margin-bottom: 14pt;
    border-bottom: 2px solid #333;
  }
  .print-foot {
    margin-top: 16pt; padding-top: 8pt;
    border-top: 1px solid #999;
    font-size: 9pt; color: #555;
  }
  .sub-step, .callout, .checklist, figure { break-inside: avoid; page-break-inside: avoid; }
  h3 { break-after: avoid; }
  .shot { display: none; }
  a[href]::after { content: ""; }

  /* tighten screen-sized spacing so printed pages fill with content, not padding */
  .step-content > * + * { margin-top: 8pt; }
  p, .step-content ul:not(.checklist) li { font-size: 10pt; line-height: 1.5; }
  .step-content ul:not(.checklist) li + li { margin-top: 5pt; }

  .flow-overview.mini-flow { gap: 6pt; margin-bottom: 10pt; }
  .flow-overview.mini-flow .flow-step { padding: 4pt 10pt; font-size: 10pt; }
  .flow-overview.mini-flow .flow-num { width: 14pt; height: 14pt; font-size: 8pt; }

  .sub-step { padding: 10pt 12pt; border-radius: 4pt; }
  .sub-step + .sub-step { margin-top: 8pt; }
  .sub-step > * + * { margin-top: 6pt; }
  .sub-step-tag { font-size: 8pt; padding: 2pt 8pt; margin-bottom: 0; }
  .sub-step h3 { font-size: 12pt; margin: 0 0 2pt; }
  p.sub-flow { font-size: 8pt; margin: 0 0 4pt; }

  .callout { padding: 8pt 10pt; font-size: 10pt; line-height: 1.5; border-radius: 4pt; }
  .callout::before { margin-bottom: 3pt; font-size: 8pt; }

  .checklist li { padding: 5pt 0 5pt 20pt; font-size: 10pt; }
}
