:root {
  color-scheme: light;
  --blue: #0f6cbd;
  --blue-dark: #0b3a5b;
  --blue-soft: #eaf4ff;
  --orange: #f59e0b;
  --red: #dc2626;
  --green: #16a34a;
  --ink: #111827;
  --muted: #5b6678;
  --line: #d9e1ea;
  --paper: #f8fafc;
  --panel: #ffffff;
  --shadow: 0 18px 44px rgba(15, 46, 75, 0.12);
  font-family:
    "Noto Sans JP", "Yu Gothic", Meiryo, ui-sans-serif, system-ui,
    -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 66px;
  padding: 12px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.brand,
.topbar nav,
.hero-actions,
.action-bar,
.reference-links,
.section-row {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  min-width: 0;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
}

.topbar nav {
  flex-wrap: wrap;
  gap: 8px 16px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.topbar nav a:hover {
  color: var(--blue);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 430px);
  gap: clamp(22px, 4vw, 56px);
  align-items: center;
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(16px, 4vw, 48px) 22px;
}

.hero-copy {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 1.06;
}

h2 {
  font-size: 1.24rem;
}

h3 {
  font-size: 1rem;
}

.hero p:not(.eyebrow) {
  max-width: 720px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  font-weight: 650;
  line-height: 1.75;
}

.hero-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.primary-link,
.secondary-link,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 15px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}

.primary-link,
button {
  background: var(--blue);
  color: #fff;
}

.secondary-link {
  background: #fff;
  color: var(--blue);
}

button {
  gap: 8px;
}

button:hover,
.primary-link:hover,
.secondary-link:hover {
  filter: brightness(0.96);
}

.hero-visual {
  margin: 0;
  min-width: 0;
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px) 28px;
}

.quick-grid div {
  min-height: 86px;
  padding: 14px;
  border-left: 4px solid var(--blue);
  background: #fff;
}

.quick-grid strong,
.quick-grid span {
  display: block;
}

.quick-grid strong {
  margin-bottom: 6px;
}

.quick-grid span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  line-height: 1.55;
}

.tool-shell {
  display: grid;
  grid-template-columns: minmax(340px, 500px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  width: min(1480px, 100%);
  margin: 0 auto;
  padding: 24px clamp(16px, 4vw, 48px) 42px;
}

.editor,
.preview-panel,
.form-section,
.risk-card,
.missing-box,
.info-band {
  border: 1px solid var(--line);
  background: var(--panel);
}

.editor,
.preview-panel {
  box-shadow: var(--shadow);
}

.editor {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 98px);
  overflow: auto;
  padding: 16px;
}

.editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.form-section {
  display: grid;
  gap: 13px;
  padding: 15px;
  border-radius: 8px;
}

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

label,
fieldset {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 9px 11px;
}

textarea {
  min-height: 78px;
  resize: vertical;
  padding: 10px 11px;
  line-height: 1.55;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.15);
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 8px;
  color: var(--ink);
}

.check-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 10px;
}

.check,
.worker-row {
  display: grid;
  align-items: center;
  gap: 8px;
}

.check {
  grid-template-columns: 18px 1fr;
  min-height: 28px;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.check input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--blue);
}

.section-row {
  justify-content: space-between;
  gap: 10px;
}

.small-button,
.icon-button {
  min-height: 36px;
  padding: 7px 10px;
}

.icon-button {
  width: 38px;
  padding: 0;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.worker-list {
  display: grid;
  gap: 10px;
}

.worker-row {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 92px 92px 36px;
}

.worker-row label {
  min-width: 0;
}

.worker-row .worker-check {
  place-items: center;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--ink);
  font-size: 0.78rem;
}

.worker-row .worker-check input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--blue);
}

.preview-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.risk-card {
  padding: 17px;
  border-left: 6px solid var(--orange);
  border-radius: 8px;
  background: #fff;
}

.risk-card p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.62;
}

.risk-high {
  border-left-color: var(--red);
  background: #fff5f5;
}

.risk-caution,
.risk-unknown {
  border-left-color: var(--orange);
  background: #fff8eb;
}

.risk-normal {
  border-left-color: var(--green);
  background: #f0fff6;
}

.action-bar {
  flex-wrap: wrap;
  gap: 10px;
}

.missing-box {
  padding: 14px;
  border-radius: 8px;
}

.missing-box ul {
  display: grid;
  gap: 7px;
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.5;
}

.print-preview {
  display: grid;
  gap: 16px;
}

.pdf-page {
  min-height: 920px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 46, 75, 0.08);
}

.pdf-header,
.pdf-section,
.pdf-table {
  margin-bottom: 16px;
}

.pdf-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 12px;
  border-bottom: 3px solid var(--blue);
}

.pdf-header h2 {
  font-size: 1.35rem;
}

.pdf-meta {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  text-align: right;
}

.risk-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue-dark);
  font-weight: 900;
}

.pdf-section h3 {
  margin-bottom: 8px;
  color: var(--blue-dark);
  font-size: 0.98rem;
}

.pdf-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 0.87rem;
}

.pdf-table th,
.pdf-table td {
  padding: 8px 9px;
  border: 1px solid #cfd8e3;
  text-align: left;
  vertical-align: top;
  line-height: 1.45;
}

.pdf-table th {
  width: 28%;
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.status-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.86rem;
}

.status-list li {
  padding: 7px 8px;
  border: 1px solid #d5dde7;
  border-radius: 6px;
  line-height: 1.42;
}

.flow-list {
  margin: 0;
  padding-left: 21px;
  line-height: 1.65;
}

.pdf-note {
  margin-top: 18px;
  padding: 11px 12px;
  border: 1px solid #f2c879;
  border-radius: 8px;
  background: #fff8eb;
  color: #6b4a10;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.58;
}

.info-band {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto 24px;
  padding: 24px clamp(16px, 4vw, 34px);
  border-radius: 8px;
}

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

.steps li {
  min-height: 74px;
  padding: 13px;
  border-left: 4px solid var(--blue);
  background: var(--paper);
  font-weight: 750;
  line-height: 1.55;
}

.muted-band {
  background: #fff;
}

.muted-band p {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.7;
}

.reference-links {
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.reference-links a {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--blue);
  font-weight: 850;
}

footer {
  padding: 22px clamp(16px, 4vw, 48px) 34px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

@media (max-width: 1040px) {
  .hero,
  .tool-shell {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    max-width: 520px;
  }

  .editor {
    position: static;
    max-height: none;
  }

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

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand span:last-child {
    font-size: 0.96rem;
  }

  .field-grid,
  .check-list,
  .status-list,
  .steps,
  .quick-grid {
    grid-template-columns: 1fr;
  }

  .worker-row {
    grid-template-columns: 1fr;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
  }

  .action-bar,
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  button,
  .primary-link,
  .secondary-link {
    width: 100%;
  }

  .pdf-page {
    min-height: auto;
    padding: 18px;
  }

  .pdf-header {
    display: grid;
  }

  .pdf-meta {
    text-align: left;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  body {
    background: #fff;
  }

  .topbar,
  .hero,
  .quick-grid,
  .editor,
  .preview-panel > :not(.print-preview),
  .info-band,
  footer {
    display: none !important;
  }

  .tool-shell,
  .preview-panel,
  .print-preview {
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .pdf-page {
    min-height: auto;
    height: 277mm;
    page-break-after: always;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .pdf-page:last-child {
    page-break-after: auto;
  }
}
