:root {
  --navy: #12366b;
  --teal: #17a2a4;
  --teal-soft: #e6f6f6;
  --bg: #f3f7fa;
  --white: #ffffff;
  --ink: #1f2937;
  --muted: #5b677a;
  --warn-bg: #fff7e8;
  --warn-ink: #8a5a00;
  --line: #d7e0ea;
  --shadow: 0 8px 24px rgba(18, 54, 107, 0.08);
  --radius: 12px;
  --space: 20px;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.header h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.header__sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
}

.badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.message-band {
  background: var(--teal-soft);
  border: 1px solid rgba(23, 162, 164, 0.22);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 18px;
}

.message-band__lead {
  margin: 0;
  color: var(--navy);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 800;
  line-height: 1.45;
}

.message-band__body {
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.65;
}

.message-band__sub {
  margin: 8px 0 0;
  color: var(--teal);
  font-size: 14px;
  font-weight: 700;
}

.sample-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: #eef4fb;
  border: 1px solid rgba(18, 54, 107, 0.14);
  border-radius: 8px;
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

.sample-note--result {
  margin: 0 0 4px;
}

.company-docs {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.company-docs__item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 10px 12px;
}

.company-docs__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.company-docs__type {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f1fb;
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
}

.company-docs__status {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
}

.company-docs__title {
  margin: 0;
  color: var(--navy);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.4;
}

.company-docs__summary {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.company-docs__empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.refs-strip {
  border: 1px solid rgba(23, 162, 164, 0.28);
  border-radius: 10px;
  background: var(--teal-soft);
  padding: 12px 14px;
}

.refs-strip__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.refs-strip__head h3 {
  margin: 0;
  color: var(--navy);
  font-size: 15px;
  font-weight: 800;
}

.refs-strip__note {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.5;
}

.refs-strip__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.refs-strip__list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid rgba(18, 54, 107, 0.1);
  border-radius: 8px;
}

.refs-strip__type {
  flex-shrink: 0;
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8f1fb;
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
}

.refs-strip__title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

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

.steps__item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--muted);
  opacity: 0.72;
  transition: opacity .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.steps__item.is-active {
  opacity: 1;
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(23, 162, 164, 0.15);
  color: var(--navy);
}

.steps__item.is-done {
  opacity: 1;
  border-color: rgba(18, 54, 107, 0.28);
  color: var(--navy);
}

.steps__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg);
  color: var(--navy);
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.steps__item.is-active .steps__num {
  background: var(--teal);
  color: #fff;
}

.steps__item.is-done .steps__num {
  background: var(--navy);
  color: #fff;
}

.steps__label {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.workspace {
  display: grid;
  grid-template-columns: 45fr 55fr;
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.panel--input {
  min-height: 520px;
}

.panel__title {
  margin: 0 0 16px;
  color: var(--navy);
  font-size: 18px;
  font-weight: 800;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--navy);
  font-size: 14px;
  font-weight: 700;
}

.field__hint {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.field__note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
}

select {
  height: 48px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 12px) 20px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.65;
}

select:focus,
textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(23, 162, 164, 0.16);
}

.field.is-highlight select {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(23, 162, 164, 0.22);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.actions__sub {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}

.btn:disabled {
  cursor: wait;
  opacity: 0.85;
}

.btn--primary {
  width: 100%;
  min-height: 52px;
  background: var(--navy);
  color: #fff;
  font-size: 16px;
}

.btn--primary:hover:not(:disabled) {
  background: #0e2b56;
}

.btn--ghost {
  min-height: 40px;
  padding: 0 14px;
  background: #fff;
  color: var(--navy);
  border-color: var(--line);
  font-size: 14px;
}

.btn--ghost:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.btn__spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  display: none;
  animation: spin .7s linear infinite;
}

.btn.is-loading .btn__spinner {
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.field-error {
  margin: 0;
  color: #9b1c1c;
  font-size: 13px;
  font-weight: 600;
}

.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.result-head .panel__title {
  margin-bottom: 0;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.result-empty[hidden],
.result-body[hidden],
.result-actions[hidden] {
  display: none !important;
}

.result-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfe;
  padding: 14px 16px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.card h3 {
  margin: 0;
  color: var(--navy);
  font-size: 15px;
  font-weight: 800;
}

.card-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  white-space: normal;
  line-height: 1.3;
}

.card-badge--memo {
  background: #e8f1fb;
  color: var(--navy);
}

.card-badge--check {
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.card-badge--staff {
  background: var(--teal-soft);
  color: var(--teal);
}

.card-badge--docs {
  background: #e8f1fb;
  color: var(--navy);
}

.demand-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.demand-col {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.demand-col__head,
.role-block__head,
.plan-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.demand-col h4,
.role-block h4,
.plan-card__title {
  margin: 0;
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
}

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

.plan-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
}

.plan-card__purpose {
  margin: 0 0 10px !important;
  color: var(--ink);
  font-size: 13px !important;
  line-height: 1.55;
  white-space: normal !important;
}

.plan-card__label {
  margin: 10px 0 4px !important;
  color: var(--navy);
  font-size: 12px !important;
  font-weight: 800;
  white-space: normal !important;
}

.check-group {
  margin: 0;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.timeline__item {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  position: relative;
  padding: 0 0 14px;
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__item:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: rgba(23, 162, 164, 0.28);
}

.timeline__num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  position: relative;
  z-index: 1;
}

.timeline__step {
  margin: 0 0 4px !important;
  color: var(--navy);
  font-size: 14px !important;
  font-weight: 800;
  white-space: normal !important;
}

.timeline__prep {
  margin: 0 !important;
  color: var(--muted);
  font-size: 13px !important;
  line-height: 1.55;
  white-space: normal !important;
}

.timeline__prep-label {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: #eef4fb;
  color: var(--navy);
  font-size: 11px;
  font-weight: 800;
}

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

.role-block {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
}

.result-footer-note {
  margin: 4px 0 0;
  padding: 12px 14px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

.card ul {
  margin: 0;
  padding-left: 1.15em;
}

.card li {
  margin: 4px 0;
  font-size: 14px;
  line-height: 1.55;
}

.card p {
  margin: 0;
  font-size: 14px;
  white-space: pre-wrap;
  line-height: 1.65;
}

.card__note {
  margin-top: 10px !important;
  color: var(--muted);
  font-size: 12px !important;
}

.card__mail-subject {
  margin: 0 0 8px !important;
  font-weight: 700;
  color: var(--ink);
}

.caution {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 600;
}

.footer {
  margin-top: 22px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.footer a {
  color: var(--navy);
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  background: var(--navy);
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 700;
}

@media (max-width: 960px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .panel {
    min-height: 0;
  }

  .steps {
    grid-template-columns: 1fr;
  }

  .demand-grid,
  .plan-grid,
  .role-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 16px 12px 28px;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel {
    padding: 16px;
  }

  .card__head,
  .demand-col__head,
  .role-block__head,
  .plan-card__head {
    align-items: flex-start;
  }

  .card-badge {
    font-size: 11px;
  }

  .timeline__item {
    gap: 8px;
  }

  .sample-note,
  .result-footer-note {
    font-size: 11px;
  }
}
