:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-soft: #f9fbfd;
  --text: #182230;
  --muted: #667085;
  --line: #d9e0ea;
  --accent: #1769aa;
  --accent-dark: #0f4d7c;
  --accent-soft: #e8f3fb;
  --success: #16835f;
  --danger: #c24132;
  --shadow: 0 18px 50px rgba(28, 43, 64, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", "Noto Sans JP", "Yu Gothic", system-ui, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef4f8 0%, var(--bg) 46%, #ffffff 100%);
}

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

.page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  width: min(1180px, calc(100% - 32px));
  margin: 32px auto;
  align-items: start;
}

.form-panel,
.preview-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.form-panel {
  border-radius: 8px;
  overflow: hidden;
}

.form-header {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 32px;
  background: #102a43;
  color: #ffffff;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ed0f0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
}

.lead {
  max-width: 680px;
  margin-bottom: 0;
  color: #d8e7f3;
  line-height: 1.7;
}

.status-card {
  min-width: 136px;
  height: 100px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
}

.status-label {
  display: block;
  color: #c7d8e6;
  font-size: 13px;
  margin-bottom: 12px;
}

.status-card strong {
  font-size: 28px;
}

form {
  padding: 8px 32px 32px;
}

.section-block {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.section-block:last-of-type {
  border-bottom: 0;
}

.section-title {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.section-title.compact {
  margin-bottom: 14px;
}

.section-title p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.step {
  display: inline-grid;
  place-items: center;
  flex: 0 0 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 700;
}

.grid {
  display: grid;
  gap: 18px;
}

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

.request-card {
  display: flex;
  gap: 12px;
  min-height: 104px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
}

.request-card:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.1);
}

.request-card input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  padding: 0;
  flex: 0 0 auto;
}

.request-card strong,
.request-card small {
  display: block;
}

.request-card strong {
  margin-bottom: 6px;
  color: #182230;
}

.request-card small {
  color: var(--muted);
  line-height: 1.5;
}

.is-hidden {
  display: none;
}

.success-view {
  min-height: 720px;
  padding: 48px 32px;
  background: #ffffff;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: #e7f6ef;
  color: var(--success);
  font-size: 34px;
  font-weight: 800;
}

.success-view .eyebrow {
  color: var(--success);
}

.success-view h1 {
  margin-bottom: 8px;
  color: var(--text);
}

.success-lead {
  margin-bottom: 28px;
  color: var(--muted);
}

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

.success-card {
  min-height: 92px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.success-card dt {
  margin-bottom: 8px;
}

.success-card dd {
  font-weight: 700;
}

.success-note {
  margin: 28px 0 0;
  padding: 18px;
  border-radius: 8px;
  background: #eff8f4;
  color: #23614d;
  font-weight: 700;
  line-height: 1.6;
}

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

.field {
  display: grid;
  gap: 8px;
}

.detail-textarea {
  margin-top: 18px;
}

.field span {
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

.required > span::after {
  content: " 必須";
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cfd7e3;
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  outline: none;
}

input,
select {
  height: 46px;
  padding: 0 13px;
}

textarea {
  resize: vertical;
  min-height: 142px;
  padding: 12px 13px;
  line-height: 1.6;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.14);
}

.field.is-invalid input,
.field.is-invalid select,
.field.is-invalid textarea {
  border-color: var(--danger);
  background: #fff8f7;
}

.field.is-invalid input:focus,
.field.is-invalid select:focus,
.field.is-invalid textarea:focus {
  box-shadow: 0 0 0 3px rgba(194, 65, 50, 0.14);
}

.field-error {
  color: var(--danger);
  font-size: 12px;
  font-weight: 700;
}

.request-kind-grid.is-invalid {
  padding: 12px;
  border: 1px solid var(--danger);
  border-radius: 8px;
  background: #fff8f7;
}

.dynamic-fields {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.dynamic-fields.empty-state {
  color: var(--muted);
}

.radio-group,
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: #344054;
}

.choice input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.upload-box {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed #9bb6cf;
  border-radius: 8px;
  background: #f5faff;
  cursor: pointer;
}

.upload-box input {
  display: none;
}

.upload-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  font-size: 24px;
}

.upload-box strong,
.upload-box small {
  display: block;
}

.upload-box small {
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.5;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 24px;
}

button {
  min-width: 136px;
  height: 46px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 700;
}

.primary {
  background: var(--accent);
  color: #ffffff;
}

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  background: #eef2f6;
  color: #344054;
}

.preview-panel {
  position: sticky;
  top: 24px;
  padding: 24px;
  border-radius: 8px;
}

.preview-panel h2 {
  margin-bottom: 18px;
}

dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

dl div {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.note {
  margin: 22px 0 0;
  padding: 14px;
  border-radius: 8px;
  background: #eff8f4;
  color: #23614d;
  line-height: 1.65;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #102a43;
  color: #ffffff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .page-shell {
    grid-template-columns: 1fr;
    margin-top: 16px;
  }

  .preview-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
  }

  .form-header {
    display: grid;
    padding: 24px;
  }

  form {
    padding: 4px 20px 24px;
  }

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

  .request-kind-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    display: grid;
  }

  button {
    width: 100%;
  }
}
