:root {
  color: #09254b;
  background: #fff;
  font-family: "Yu Gothic UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --blue: #0965d9;
  --ink: #09254b;
  --muted: #657284;
  --line: #d5dce5;
  --soft: #f5f8fc;
  --danger: #b42318;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body { margin: 0; min-height: 100vh; background: #fff; }
button, input, textarea, select { font: inherit; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid #98c5ff; outline-offset: 2px; }
.portal-header { height: 72px; padding: 0 max(24px, calc((100vw - 1340px) / 2)); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.portal-brand { color: var(--ink); font-size: 24px; font-weight: 850; text-decoration: none; }
.portal-header span { color: var(--ink); font-weight: 700; }
.portal-shell { width: min(1340px, calc(100% - 64px)); margin: 0 auto; padding: 40px 0 120px; }
.portal-title h1 { margin: 10px 0 5px; font-size: clamp(28px, 3.2vw, 42px); line-height: 1.35; letter-spacing: .06em; }
.portal-title>p:not(.status-line) { margin: 0; color: #445167; }
.status-line { margin: 0; color: var(--blue); font-size: 13px; font-weight: 750; }
.stepper { margin: 32px 0 38px; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); }
.stepper li { position: relative; text-align: center; color: #5f6977; font-weight: 700; }
.stepper li:not(:last-child)::after { content: ""; position: absolute; top: 21px; left: calc(50% + 24px); right: calc(-50% + 24px); height: 2px; background: #cbd2dc; z-index: -1; }
.stepper li.done:not(:last-child)::after, .stepper li.current:not(:last-child)::after { background: var(--blue); }
.stepper b { width: 44px; height: 44px; margin: 0 auto 9px; border: 2px solid #b9c1cb; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 19px; }
.stepper .current, .stepper .done { color: var(--blue); }
.stepper .current b { color: #fff; border-color: var(--blue); background: var(--blue); }
.stepper .done b { border-color: var(--blue); }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 56px; align-items: start; }
.portal-form { min-width: 0; }
.panel-heading { margin-bottom: 26px; }
.panel-heading h2 { margin: 0 0 4px; font-size: 28px; }
.panel-heading p { margin: 0; color: var(--muted); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: 7px; font-weight: 750; }
.field em { color: var(--blue); font-size: 11px; font-style: normal; }
.field input, .field textarea, .field select { width: 100%; min-height: 48px; border: 1px solid #bdc7d2; border-radius: 5px; padding: 10px 12px; color: var(--ink); background: #fff; }
.field textarea { resize: vertical; }
.repeat-list { display: grid; gap: 14px; }
.repeat-card { padding: 18px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); display: grid; gap: 12px; }
.upload-groups { display: grid; gap: 24px; }
.upload-group h3 { margin: 0 0 9px; }
.upload-area { min-height: 96px; padding: 14px; border: 1px dashed #8fa1b5; border-radius: 6px; background: #fbfdff; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.upload-area input { max-width: 100%; }
.asset-list { margin-top: 10px; display: grid; gap: 8px; }
.asset-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.asset-item button { border: 0; background: transparent; color: var(--danger); cursor: pointer; }
.checkbox-field { display: flex; align-items: flex-start; gap: 10px; }
.checkbox-field input { width: 20px; height: 20px; margin-top: 2px; }
.review-box { padding: 22px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); }
.review-box dl { margin: 0; }
.review-box div { padding: 10px 0; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 140px 1fr; gap: 20px; }
.review-box div:last-child { border: 0; }
.review-box dt { font-weight: 750; }
.review-box dd { margin: 0; white-space: pre-wrap; }
.progress-card { position: sticky; top: 24px; padding-left: 32px; border-left: 1px solid var(--line); }
.progress-card h2 { margin: 0 0 16px; font-size: 20px; }
.progress-row { min-height: 58px; padding: 0 2px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.progress-row span:first-child { font-weight: 700; }
.progress-row.done { color: var(--blue); }
.progress-meter { height: 8px; margin-top: 22px; border-radius: 999px; background: #e2e7ed; overflow: hidden; }
.progress-meter span { display: block; width: 0; height: 100%; background: var(--blue); transition: width .2s ease; }
.progress-card>strong { margin-top: 7px; display: block; text-align: right; }
.form-actions { margin-top: 32px; display: flex; justify-content: flex-end; gap: 12px; }
.button-primary, .button-secondary { min-height: 52px; padding: 0 32px; border-radius: 5px; font-weight: 800; cursor: pointer; }
.button-primary { min-width: 230px; border: 1px solid var(--blue); background: var(--blue); color: #fff; }
.button-secondary { border: 1px solid var(--blue); background: #fff; color: var(--blue); }
.button-primary:disabled, .button-secondary:disabled { opacity: .55; cursor: wait; }
.turnstile-wrap { margin-top: 22px; display: flex; justify-content: flex-end; }
.portal-footer { position: fixed; inset: auto 0 0; min-height: 58px; padding: 16px 24px; border-top: 1px solid var(--line); background: rgba(255,255,255,.97); color: #445167; text-align: center; }
.notice { padding: 12px 14px; border-radius: 5px; background: #edf6ff; color: #164f8d; }
.notice.error { background: #fff0ee; color: var(--danger); }
.review-shell { width: min(1380px, calc(100% - 64px)); margin: 0 auto; padding: 40px 0 110px; }
.review-pages { margin: 28px 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.review-pages button { min-height: 38px; padding: 0 16px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--ink); font-weight: 750; cursor: pointer; }
.review-pages button.is-active { border-color: var(--blue); background: var(--blue); color: #fff; }
.review-frame { width: 100%; min-height: 720px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.review-response { width: min(820px, 100%); margin: 28px auto 0; display: grid; gap: 18px; }

@media (max-width: 780px) {
  .portal-header { height: 62px; padding: 0 20px; }
  .portal-brand { font-size: 20px; }
  .portal-header span { font-size: 12px; }
  .portal-shell { width: min(100% - 32px, 680px); padding: 32px 0 110px; }
  .portal-title h1 { font-size: 28px; letter-spacing: .03em; }
  .stepper { margin: 28px 0 32px; }
  .stepper li { font-size: 11px; }
  .stepper b { width: 38px; height: 38px; font-size: 16px; }
  .stepper li:not(:last-child)::after { top: 18px; left: calc(50% + 20px); right: calc(-50% + 20px); }
  .portal-grid { display: block; }
  .progress-card { position: static; margin: 0 0 30px; padding: 18px; border: 1px solid var(--line); border-radius: 6px; }
  .progress-card { display: none; }
  .field-grid { grid-template-columns: 1fr; }
  .field-grid .full { grid-column: auto; }
  .panel-heading h2 { font-size: 23px; }
  .upload-area { align-items: flex-start; flex-direction: column; }
  .review-box div { grid-template-columns: 1fr; gap: 2px; }
  .form-actions { flex-direction: column; }
  .button-primary, .button-secondary { width: 100%; }
  .button-primary { order: -1; }
  .turnstile-wrap { justify-content: flex-start; }
  .portal-footer { font-size: 12px; }
  .review-shell { width: min(100% - 24px, 680px); padding: 28px 0 100px; }
  .review-frame { min-height: 620px; }
  .review-pages { display: grid; grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
