@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

:root {
  --pb-primary: #158274;
  --pb-secondary: #19b184;
  --pb-error: #cc4953;
  --pb-bg: #eef1ef;
  --pb-surface: #ffffff;
  --pb-text: #212529;
  --pb-muted: #6b7280;
  --pb-border: #d7dcd4;
  --pb-font: "Noto Sans JP", sans-serif;
}

html { font-size: 17px; }

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--pb-font);
  background: var(--pb-bg);
  color: var(--pb-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.pb-header {
  background: var(--pb-surface);
  border-bottom: 1px solid var(--pb-border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.pb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--pb-primary);
}

.pb-logo-mark {
  background: var(--pb-primary);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pb-badge {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--pb-secondary);
  border: 1px solid var(--pb-secondary);
  border-radius: 100px;
  padding: 4px 12px;
}

/* Layout */
.pb-main {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

/* Stepper */
.pb-steps {
  display: flex;
  list-style: none;
  margin-bottom: 32px;
  counter-reset: step;
}

.pb-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  color: var(--pb-muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.pb-step::before {
  content: '';
  position: absolute;
  top: 17px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: var(--pb-border);
  z-index: 0;
}

.pb-step:first-child::before { display: none; }

.pb-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pb-surface);
  border: 2px solid var(--pb-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  z-index: 1;
  transition: all 0.25s ease;
}

.pb-step.is-active .pb-step-num {
  background: var(--pb-primary);
  border-color: var(--pb-primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(21, 130, 116, 0.15);
}

.pb-step.is-active { color: var(--pb-primary); font-weight: 700; }

.pb-step.is-done .pb-step-num {
  background: var(--pb-secondary);
  border-color: var(--pb-secondary);
  color: #fff;
}

.pb-step.is-done::before { background: var(--pb-secondary); }

.pb-step.is-skipped {
  color: #b0b4ac;
  font-weight: 400;
}

.pb-step.is-skipped .pb-step-num {
  background: #f1f3f0;
  border-color: var(--pb-border);
  color: #b0b4ac;
  box-shadow: none;
}

.pb-step.is-skipped::before {
  background: transparent;
  border-top: 2px dashed var(--pb-border);
  height: 0;
  top: 18px;
}

/* Panels */
.pb-panel {
  display: none;
  background: var(--pb-surface);
  border-radius: 14px;
  padding: 36px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
  animation: pbFade 0.3s ease;
}

.pb-panel.is-active { display: block; }

@keyframes pbFade {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.pb-panel-title {
  font-size: 1.3rem;
  color: var(--pb-primary);
  margin-bottom: 28px;
}

.pb-subsection-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--pb-primary);
  margin-top: 36px;
  margin-bottom: 22px;
  padding-top: 28px;
  border-top: 1px dashed var(--pb-border);
}

.pb-panel-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 28px;
}

.pb-panel-head .pb-panel-title { margin-bottom: 0; }

.pb-panel-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* Fields */
.pb-field { margin-bottom: 22px; }

.pb-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 22px;
}

.pb-field label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--pb-text);
  margin-bottom: 8px;
}

.pb-req {
  background: var(--pb-error);
  color: #fff;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 3px;
  margin-left: 8px;
  vertical-align: middle;
}

.pb-field input,
.pb-field select {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--pb-border);
  border-radius: 10px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  transition: all 0.2s;
}

.pb-field input:focus,
.pb-field select:focus {
  outline: none;
  border-color: var(--pb-primary);
  box-shadow: 0 0 0 4px rgba(21, 130, 116, 0.1);
}

/* readonly 入力欄 (自治体選択で自動入力される 企業名/カナ 用) */
.pb-field input[readonly] {
  background: #f1f3f0 !important;
  color: var(--pb-muted) !important;
  cursor: not-allowed;
  border-color: var(--pb-border);
}

.pb-field input[readonly]:focus {
  border-color: var(--pb-border);
  box-shadow: none;
}

.pb-help {
  font-size: 0.8rem;
  color: var(--pb-muted);
  margin-top: 6px;
}

.pb-error {
  display: none;
  color: var(--pb-error);
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 6px;
}

.pb-field-error {
  color: var(--pb-error);
  font-size: 0.82rem;
  font-weight: 700;
  margin-top: 6px;
}

.pb-field-error[hidden] {
  display: none;
}

.pb-field input.is-invalid,
.pb-field select.is-invalid {
  border-color: var(--pb-error);
  background: #fff7f7;
}

.pb-field input.is-invalid:focus,
.pb-field select.is-invalid:focus {
  box-shadow: 0 0 0 4px rgba(204, 73, 83, 0.12);
}

.pb-inline { display: flex; gap: 10px; }

.pb-label-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.pb-label-action > label {
  margin-bottom: 0;
}

.pb-btn-member {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #fff;
  border: 1px solid var(--pb-primary);
  border-radius: 8px;
  color: var(--pb-primary);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
}

.pb-btn-member::after {
  content: '↗';
  font-size: 0.9rem;
}

.pb-btn-member:hover {
  background: var(--pb-primary);
  color: #fff;
}

.pb-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pb-choice {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400 !important;
  cursor: pointer;
  padding: 12px 16px;
  border: 1px solid var(--pb-border);
  border-radius: 10px;
  transition: all 0.2s;
  margin-bottom: 0 !important;
}

.pb-choice:hover { background: var(--pb-bg); }

.pb-choice input { width: 18px; height: 18px; accent-color: var(--pb-primary); }

.pb-choice:has(input:checked) {
  border-color: var(--pb-primary);
  background: rgba(21, 130, 116, 0.05);
  font-weight: 700 !important;
}

/* Q1 / Q2 question cards (Step 2 top) */
.pb-question-card {
  background: rgba(48, 110, 199, 0.06);
  border-radius: 12px;
  padding: 22px 24px;
  margin-bottom: 18px;
}

.pb-question-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--pb-text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pb-question-icon {
  color: #3a6fc8;
  font-size: 1.05rem;
}

.pb-req-star {
  color: var(--pb-error);
  margin-left: 4px;
}

.pb-question-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pb-question-options.pb-3col {
  grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 720px) {
  .pb-question-options.pb-3col {
    grid-template-columns: 1fr;
  }
}

/* JIS cascade: 市区町村が非表示のときは 都道府県だけで1カラムに */
#jis-pref-row:has(> #jis-city-field[hidden]) {
  grid-template-columns: 1fr;
}

.pb-option-card {
  background: #fff;
  border: 1px solid var(--pb-border);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-weight: 400 !important;
  margin-bottom: 0 !important;
}

.pb-option-card:hover {
  background: #f9faf8;
}

.pb-option-card input[type="radio"] {
  width: 20px;
  height: 20px;
  accent-color: var(--pb-error);
  margin-top: 2px;
  flex-shrink: 0;
}

.pb-option-card:has(input:checked) {
  border-color: var(--pb-primary);
}

.pb-option-card.is-locked {
  background: #f1f3f0;
  cursor: not-allowed;
  opacity: 0.55;
}

.pb-option-card.is-locked .pb-option-title,
.pb-option-card.is-locked .pb-option-sub {
  color: var(--pb-muted);
}

.pb-option-body {
  flex: 1;
}

.pb-option-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--pb-text);
  margin-bottom: 4px;
}

.pb-option-sub {
  color: var(--pb-muted);
  font-size: 0.85rem;
  line-height: 1.5;
}

.pb-warn-box {
  background: #fef9e7;
  border-left: 4px solid #e0a800;
  border-radius: 6px;
  padding: 14px 18px;
  margin-top: 14px;
  font-size: 0.88rem;
  color: #6b5d2a;
}

.pb-warn-title {
  font-weight: 700;
  margin-bottom: 8px;
}

.pb-warn-list {
  padding-left: 20px;
  line-height: 1.7;
  margin: 0;
}

.pb-warn-list strong {
  color: #5a4d1b;
}

.pb-question-note {
  color: var(--pb-muted);
  font-size: 0.82rem;
  margin-top: 10px;
}

@media (max-width: 600px) {
  .pb-question-options { grid-template-columns: 1fr; }
}

/* Trainee skip toggle */
.pb-skip-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.pb-skip-status {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--pb-muted);
}

.pb-btn-skip {
  background: #fff;
  border: 1px solid var(--pb-border);
  color: var(--pb-muted);
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.pb-btn-skip:hover {
  border-color: var(--pb-primary);
  color: var(--pb-primary);
}

.pb-csv-status {
  margin-top: 12px;
  padding: 10px 14px;
  background: rgba(25, 177, 132, 0.08);
  border-left: 4px solid var(--pb-secondary);
  border-radius: 6px;
  color: var(--pb-text);
  font-size: 0.9rem;
  font-weight: 500;
}

.pb-csv-status[hidden] {
  display: none;
}

/* Loading overlay */
.pb-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(70, 75, 80, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: pb-fade-in 0.2s ease-out;
}

.pb-loading-overlay[hidden] { display: none; }

@keyframes pb-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.pb-loading-popup {
  background: #fff;
  border-radius: 14px;
  padding: 36px 40px 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  text-align: center;
  max-width: 440px;
  width: 90%;
}

.pb-loading-spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
  border: 4px solid var(--pb-bg);
  border-top-color: var(--pb-primary);
  border-radius: 50%;
  animation: pb-spin 0.8s linear infinite;
}

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

.pb-loading-msg {
  color: var(--pb-text);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.7;
  margin: 0 0 22px !important;
}

.pb-loading-done-btn {
  padding: 12px 32px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  background: #fff7e6;
  color: #a06d0e;
  border: 1px dashed #d4901a;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.pb-loading-done-btn:hover {
  background: #ffe9c4;
  border-style: solid;
}

.pb-loading-hint {
  margin: 14px 0 0 !important;
  font-size: 0.78rem !important;
  color: var(--pb-muted) !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
}

.pb-error-list {
  background: rgba(204, 73, 83, 0.08);
  border: 2px solid var(--pb-error);
  border-radius: 10px;
  padding: 20px 22px;
  margin-bottom: 24px;
}

.pb-error-list[hidden] { display: none; }

.pb-error-list h3 {
  color: var(--pb-error);
  font-size: 1.05rem;
  margin-bottom: 12px;
  font-weight: 700;
}

.pb-error-list ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.pb-error-list li {
  color: var(--pb-error);
  font-weight: 500;
  margin-bottom: 5px;
  line-height: 1.6;
}

.pb-error-list > p {
  color: var(--pb-text);
  font-size: 0.88rem;
  margin: 0;
}

.pb-proto-error-selector {
  margin-top: 16px;
  padding: 14px 18px;
  background: #fef8e5;
  border: 1px dashed #d4901a;
  border-radius: 8px;
  font-size: 0.9rem;
}

.pb-proto-error-selector[hidden] { display: none; }

.pb-proto-error-selector > label {
  display: block;
  color: #a06d0e;
  font-weight: 700;
  margin-bottom: 8px;
}

.pb-proto-error-selector select {
  width: auto;
  min-width: 260px;
  padding: 8px 14px;
  border: 1px solid var(--pb-border);
  border-radius: 6px;
  background: #fff;
  font-size: 0.9rem;
  font-family: inherit;
}

.pb-proto-hint {
  margin-top: 8px;
  color: #806012;
  font-size: 0.82rem;
  line-height: 1.5;
}

.pb-csv-notice {
  margin-top: 14px;
  padding: 14px 18px;
  background: rgba(48, 110, 199, 0.05);
  border-left: 4px solid #3a6fc8;
  border-radius: 6px;
  font-size: 0.88rem;
  color: var(--pb-text);
  line-height: 1.7;
}

.pb-csv-notice[hidden] { display: none; }

.pb-csv-notice ul {
  margin: 0;
  padding-left: 20px;
}

.pb-csv-notice li {
  margin-bottom: 4px;
}

.pb-done-download-note {
  color: var(--pb-muted);
  font-size: 0.82rem;
  margin-top: 12px;
  margin-bottom: 20px;
  line-height: 1.6;
}

.pb-done .pb-btn-sub {
  margin-bottom: 8px;
}

.pb-trainee-csv-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.pb-trainee-csv-row[hidden] { display: none; }

/* JIS code search suggestions */
.pb-jis-search-wrap {
  position: relative;
}

.pb-jis-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--pb-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 40;
  list-style: none;
  margin: 0;
  padding: 4px 0;
}

.pb-jis-suggestions[hidden] {
  display: none;
}

.pb-jis-suggestion-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--pb-text);
  transition: background 0.12s;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pb-jis-suggestion-item:hover,
.pb-jis-suggestion-item.is-focused {
  background: rgba(21, 130, 116, 0.08);
}

.pb-jis-suggestion-name {
  font-weight: 500;
}

.pb-jis-suggestion-code {
  color: var(--pb-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pb-jis-suggestion-empty {
  padding: 12px 16px;
  color: var(--pb-muted);
  font-size: 0.88rem;
  text-align: center;
}

/* Trainee email auto-generate */
.pb-trainee-email-field .pb-label-action {
  margin-bottom: 8px;
  align-items: flex-end;
}

.pb-autogen-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.pb-btn-autogen-email {
  background: #fff;
  border: 1px solid var(--pb-primary);
  color: var(--pb-primary);
  padding: 11px 20px;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.pb-btn-autogen-email:hover {
  background: var(--pb-primary);
  color: #fff;
}

.pb-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--pb-bg);
  border: 1px solid var(--pb-border);
  color: var(--pb-muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: help;
  position: relative;
  user-select: none;
}

.pb-help-icon:hover,
.pb-help-icon:focus {
  background: var(--pb-primary);
  border-color: var(--pb-primary);
  color: #fff;
  outline: none;
}

.pb-help-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  right: -4px;
  width: 300px;
  max-width: 80vw;
  background: #2d2e30;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.55;
  padding: 10px 12px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  white-space: normal;
  text-align: left;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.pb-help-icon::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  right: 4px;
  border: 5px solid transparent;
  border-top-color: #2d2e30;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 50;
}

.pb-help-icon:hover::after,
.pb-help-icon:focus::after,
.pb-help-icon:hover::before,
.pb-help-icon:focus::before {
  opacity: 1;
}

.pb-email-input-wrap {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.pb-email-input-wrap > input[type="email"] {
  flex: 1;
  min-width: 0;
}

.pb-email-suffix {
  display: none;
  align-items: center;
  background: #f1f3f0;
  border: 1px solid var(--pb-border);
  border-left: none;
  border-radius: 0 10px 10px 0;
  padding: 0 16px;
  color: var(--pb-muted);
  font-size: 0.95rem;
  white-space: nowrap;
}

.pb-trainee-email-field.is-auto-mode .pb-email-suffix {
  display: inline-flex;
}

.pb-trainee-email-field.is-auto-mode .pb-email-input-wrap > input[type="email"] {
  border-radius: 10px 0 0 10px;
  border-right: 1px solid var(--pb-border);
}

.pb-trainee-email-field.is-auto-mode .pb-email-input-wrap > input[type="email"]:focus {
  border-right-color: var(--pb-primary);
  z-index: 1;
}

/* Step 2 リード note (Q1 の上に配置される「メールアドレスがログインＩＤになります。」) */
.pb-lead-note {
  margin: 0 0 20px 0;
  padding: 12px 16px;
  background: #f4f8f5;
  border-left: 4px solid var(--pb-primary);
  border-radius: 6px;
  color: var(--pb-text);
  font-size: 0.92rem;
  font-weight: 500;
}

/* Trainee blocks */
.trainee-block {
  padding: 20px 18px;
  border-radius: 10px;
  transition: background 0.15s;
}
/* 奇数番目の受講者ブロックに薄い着色でメリハリ (2人目以降にも適用) */
#trainee-list > .trainee-block:nth-child(odd) {
  background: #dceadf;
}
.trainee-block + .trainee-block {
  margin-top: 20px;
  animation: pbFade 0.3s ease;
}

.trainee-block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.trainee-block-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--pb-primary);
}

.btn-remove-trainee {
  background: transparent;
  border: 1px solid var(--pb-error);
  color: var(--pb-error);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-remove-trainee:hover { background: var(--pb-error); color: #fff; }

.pb-add-area { margin-top: 22px; }

.pb-btn-add {
  width: 100%;
  padding: 13px;
  background: var(--pb-bg);
  border: 1px dashed var(--pb-primary);
  border-radius: 10px;
  color: var(--pb-primary);
  font-size: 0.92rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}

.pb-btn-add:hover { background: rgba(21, 130, 116, 0.06); }

.pb-link {
  color: var(--pb-primary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
}

.pb-link:hover { color: var(--pb-secondary); }

/* Confirmation (Step 4) */
.pb-confirm-note {
  color: var(--pb-muted);
  font-size: 0.92rem;
  margin-bottom: 24px;
}

.pb-confirm-section {
  margin-bottom: 28px;
  padding-bottom: 4px;
}

.pb-confirm-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--pb-primary);
  border-bottom: 1px solid var(--pb-border);
  padding-bottom: 8px;
  margin-bottom: 14px;
}

.pb-confirm-subhead {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--pb-primary);
  margin-top: 18px;
  margin-bottom: 10px;
}

.pb-confirm-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 8px 18px;
  font-size: 0.92rem;
  margin-bottom: 8px;
}

.pb-confirm-dl dt {
  color: var(--pb-muted);
  font-weight: 700;
  white-space: nowrap;
}

.pb-confirm-dl dd {
  color: var(--pb-text);
  word-break: break-word;
}

.pb-confirm-trainee {
  background: var(--pb-bg);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 10px;
}

.pb-confirm-trainee-title {
  font-weight: 700;
  color: var(--pb-primary);
  margin-bottom: 8px;
}

.pb-confirm-skipped {
  color: var(--pb-muted);
  background: var(--pb-bg);
  border-radius: 8px;
  padding: 14px 18px;
}

/* Buttons / nav */
.pb-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 28px;
}

.pb-nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pb-btn.pb-btn-autofill {
  background: #fff7e6;
  border: 1px dashed #d4901a;
  color: #a06d0e;
  padding: 10px 18px;
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.pb-btn.pb-btn-autofill:hover {
  background: #ffe9c4;
  border-style: solid;
}

.pb-btn {
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  border-radius: 10px;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.pb-btn-primary {
  background: linear-gradient(135deg, var(--pb-primary), var(--pb-secondary));
  color: #fff;
  padding: 14px 40px;
  font-size: 1rem;
  box-shadow: 0 4px 14px rgba(21, 130, 116, 0.3);
}

.pb-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(21, 130, 116, 0.4); }
.pb-btn-primary:disabled { opacity: 0.6; cursor: default; transform: none; box-shadow: none; }

.pb-btn-ghost {
  background: transparent;
  color: var(--pb-muted);
  border-color: var(--pb-border);
  padding: 14px 28px;
  font-size: 0.95rem;
}

.pb-btn-ghost:hover { border-color: var(--pb-primary); color: var(--pb-primary); }
.pb-btn-ghost[hidden] { display: none; }

.pb-btn-sub {
  background: #fff;
  border: 1px solid var(--pb-primary);
  color: var(--pb-primary);
  padding: 10px 18px;
  font-size: 0.88rem;
  white-space: nowrap;
}

.pb-btn-sub:hover { background: var(--pb-primary); color: #fff; }

/* Success */
.pb-done {
  background: var(--pb-surface);
  border-radius: 14px;
  padding: 64px 40px;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
}

.pb-done h1 { color: var(--pb-primary); margin: 16px 0; }
.pb-done p { color: var(--pb-muted); margin-bottom: 32px; }

.pb-footer {
  text-align: center;
  padding: 36px;
  color: var(--pb-muted);
  font-size: 0.82rem;
}

@media (max-width: 600px) {
  .pb-row { grid-template-columns: 1fr; }
  .pb-step-label { display: none; }
  .pb-btn-primary { padding: 14px 28px; }
}

/* 自治体テキスト検索 */
.pb-jis-search {
  position: relative;
  margin-top: 8px;
  margin-bottom: 12px;
}
.pb-jis-search[hidden] { display: none; }
.pb-jis-search input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--pb-border);
  border-radius: 8px;
  font-size: 0.95rem;
  box-sizing: border-box;
}
.pb-jis-search input:focus {
  outline: none;
  border-color: var(--pb-primary);
  box-shadow: 0 0 0 3px rgba(21, 130, 116, 0.15);
}
.pb-jis-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--pb-border);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  z-index: 20;
}
.pb-jis-search-results[hidden] { display: none; }
.pb-jis-search-item {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.92rem;
}
.pb-jis-search-item:hover { background: #f1f8f5; }
.pb-jis-code-badge {
  font-size: 0.75rem;
  color: var(--pb-muted);
  background: #f1f3f0;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: monospace;
}
.pb-jis-search-empty {
  padding: 12px 14px;
  color: var(--pb-muted);
  font-size: 0.9rem;
  font-style: italic;
}

/* CSV 一括登録の不備行編集ビュー */
.pb-csv-edit-view {
  margin-top: 16px;
  border: 1px solid var(--pb-border);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}
.pb-csv-edit-view[hidden] { display: none; }
.pb-csv-edit-header {
  padding: 12px 16px;
  background: #fff5f0;
  border-bottom: 1px solid #ffcdb2;
  color: #b34a13;
  font-weight: 600;
  font-size: 0.95rem;
}
.pb-csv-edit-list-wrap {
  max-height: 460px;
  overflow-y: auto;
}
.pb-csv-edit-list {
  display: flex;
  flex-direction: column;
}
/* 1レコード = 2行表示。1行目: 姓/名/セイ/メイ/課・グループ、2行目: メール/パスワード/状態 */
.pb-csv-edit-record {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
}
.pb-csv-edit-record.has-error { background: #fff8f5; }
.pb-csv-edit-line {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px 10px;
}
.pb-csv-edit-line + .pb-csv-edit-line { margin-top: 8px; }
.pb-csv-edit-num {
  align-self: flex-end;
  margin-bottom: 6px;
  min-width: 1.4em;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pb-muted);
}
/* 0910項目8: 2行目(メール/パスワード)の左端を、1行目の行番号ぶんインデントして
   1行目の「姓」欄と頭をそろえる(1.4em @ 0.8rem ≒ 1.12rem + gap 10px)。 */
.pb-csv-edit-line-2 { padding-left: calc(1.12rem + 10px); }
.pb-csv-edit-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1 1 90px;
  min-width: 72px;
}
/* 2行目のメール/パスワードは広めに */
.pb-csv-edit-line-2 .pb-csv-edit-field { flex-basis: 220px; }
.pb-csv-edit-field-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--pb-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pb-csv-edit-field input {
  width: 100%;
  padding: 6px 7px;
  border: 1px solid var(--pb-border);
  border-radius: 6px;
  font-size: 0.82rem;
  box-sizing: border-box;
}
.pb-csv-edit-field input.is-invalid {
  border-color: #e53935;
  background: #fff5f5;
}
.pb-csv-edit-status-cell {
  flex: 0 1 auto;
  min-width: 44px;
  align-self: flex-end;
  margin-bottom: 6px;
  font-size: 0.76rem;
  line-height: 1.35;
  color: #b34a13;
  white-space: normal;
}
.pb-csv-edit-status-cell.is-ok {
  color: #2e7d32;
  white-space: nowrap;
}

@media (max-width: 600px) {
  /* さらに狭い画面では各欄をほぼ全幅で折り返す */
  .pb-csv-edit-field,
  .pb-csv-edit-line-2 .pb-csv-edit-field { flex-basis: 100%; }
}
.pb-csv-edit-actions {
  padding: 12px 16px;
  border-top: 1px solid var(--pb-border);
  background: #fafafa;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* CSV 自動生成モーダル */
.pb-autogen-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(70,75,80,0.55);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.pb-autogen-modal-overlay[hidden] { display: none; }
.pb-autogen-modal {
  background: #fff;
  border-radius: 12px;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.pb-autogen-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--pb-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pb-autogen-header h3 { margin: 0; font-size: 1.05rem; color: var(--pb-primary); }
.pb-autogen-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--pb-muted);
  padding: 0 6px;
}
.pb-autogen-body { padding: 16px 20px; }
.pb-autogen-body p { margin: 0 0 12px 0; font-size: 0.9rem; color: var(--pb-muted); }
.pb-autogen-body textarea {
  width: 100%;
  min-height: 140px;
  padding: 10px;
  border: 1px solid var(--pb-border);
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.88rem;
  box-sizing: border-box;
  resize: vertical;
}
.pb-autogen-result {
  margin-top: 12px;
  background: #f7f9f7;
  border-radius: 8px;
  padding: 12px;
  font-family: monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  min-height: 60px;
  border: 1px solid var(--pb-border);
}
.pb-autogen-actions {
  padding: 12px 20px;
  border-top: 1px solid var(--pb-border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.pb-csv-autogen-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--pb-primary);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.9rem;
  background: none;
  border: none;
  padding: 0;
}
.pb-csv-autogen-link:hover { color: var(--pb-secondary); }

/* CSV アップロード確認ポップアップ内のチェックボックス */
.pb-csv-upload-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--pb-border);
  border-radius: 8px;
  background: #fafafa;
  cursor: pointer;
  transition: background 0.15s;
}
.pb-csv-upload-check:hover { background: #f1f8f5; }
.pb-csv-upload-check input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  cursor: pointer;
}
.pb-csv-upload-check strong {
  display: block;
  font-size: 0.95rem;
  color: var(--pb-text);
}
.pb-csv-upload-check em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 0.83rem;
  color: var(--pb-muted);
  line-height: 1.55;
}
