:root {
  color-scheme: light;
  --ink: #1e252b;
  --muted: #66717d;
  --line: #d9e0e7;
  --panel: #ffffff;
  --soft: #f4f7f8;
  --soft-2: #edf5f2;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --warn: #a15c00;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(27, 38, 49, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #f7faf9 0%, #edf4f6 46%, #f8f4ec 100%);
  color: var(--ink);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  letter-spacing: 0;
}

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

.app-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 28px 20px;
  background: rgba(255, 255, 255, 0.86);
  border-right: 1px solid rgba(217, 224, 231, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  padding: 8px 8px 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.35;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 26px;
}

h3 {
  font-size: 18px;
}

.step-nav {
  display: grid;
  gap: 8px;
}

.step-button {
  width: 100%;
  min-height: 48px;
  display: grid;
  grid-template-columns: 30px 1fr;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
  padding: 10px;
}

.step-button span:first-child {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.step-button.active {
  border-color: rgba(15, 118, 110, 0.28);
  background: var(--soft-2);
  color: var(--ink);
  font-weight: 700;
}

.side-panel {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.side-panel label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.side-panel input {
  width: 100%;
}

.side-panel p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.main {
  min-width: 0;
  padding: 32px;
}

.topbar,
.form-panel,
.review-panel,
.actions {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  margin-bottom: 20px;
}

.progress-wrap {
  width: min(280px, 38vw);
}

.progress-label {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe8ea;
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

.form-panel,
.review-panel {
  min-height: 60vh;
  padding: 24px;
  border: 1px solid rgba(217, 224, 231, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

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

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

.field.wide {
  grid-column: 1 / -1;
}

.field label,
.field legend {
  color: #26313b;
  font-weight: 700;
  line-height: 1.55;
}

.hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.example-box,
.support-box {
  border: 1px solid #d7e6e3;
  border-radius: 8px;
  background: #f7fbfa;
  color: var(--muted);
  font-size: 13px;
}

.support-box {
  border-color: #e7dcc8;
  background: #fffbf3;
}

.example-box summary,
.support-box summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 700;
  list-style-position: inside;
  padding: 9px 11px;
}

.support-box summary {
  color: var(--warn);
}

.example-box ul,
.support-box ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0 14px 12px 32px;
  line-height: 1.7;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cbd5dd;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
  padding: 12px 13px;
  transition: border 140ms ease, box-shadow 140ms ease;
}

textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.75;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.15);
}

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

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.choice input {
  width: auto;
}

.file-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.file-item {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.file-item img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.file-meta {
  min-width: 0;
}

.file-meta strong,
.file-meta span {
  display: block;
  overflow-wrap: anywhere;
}

.file-meta span {
  color: var(--muted);
  font-size: 12px;
}

.mini-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--danger);
  cursor: pointer;
  padding: 8px 10px;
}

.actions {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 16px 0 2px;
  background: linear-gradient(180deg, rgba(247, 250, 249, 0), rgba(247, 250, 249, 0.96) 28%);
}

.action-group {
  display: flex;
  gap: 10px;
}

.button {
  min-height: 46px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  padding: 11px 18px;
}

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

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

.button.secondary {
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

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

.review-content {
  display: grid;
  gap: 18px;
}

.review-section {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.review-list {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 10px 16px;
  margin-top: 12px;
}

.review-list dt {
  color: var(--muted);
  font-weight: 700;
}

.review-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 420px;
  border-radius: 8px;
  background: #1f2933;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  padding: 13px 16px;
  transform: translateY(8px);
  transition: opacity 160ms ease, transform 160ms ease;
}

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

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 20px;
  }

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

  .main {
    padding: 22px 16px 28px;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .progress-wrap {
    width: 100%;
  }

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

  .review-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .step-nav {
    grid-template-columns: 1fr;
  }

  .form-panel,
  .review-panel {
    padding: 18px;
  }

  .actions,
  .action-group {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }
}
