.tool-page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 96px;
}

.tool-intro {
  max-width: 820px;
  margin-bottom: 44px;
}

.tool-intro h1 {
  font-size: clamp(40px, 7vw, 72px);
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: start;
}

.score-form,
.result-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.score-form {
  padding: 8px 24px 24px;
}

.score-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin: 0;
  padding: 20px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.score-row legend {
  padding: 0;
  font-weight: 700;
}

.radio-group {
  display: grid;
  grid-template-columns: repeat(5, 42px);
  gap: 8px;
}

.radio-group label {
  position: relative;
}

.radio-group input {
  position: absolute;
  opacity: 0;
}

.radio-group span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.radio-group input:checked + span {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.score-form .button {
  margin-top: 24px;
}

.result-panel {
  position: sticky;
  top: 20px;
  padding: 28px;
}

.result-label {
  margin: 0;
  color: var(--accent-dark);
  font-weight: 700;
}

.result-score {
  margin: 8px 0 16px;
  font-size: 64px;
  line-height: 1;
  font-weight: 800;
}

.result-score span {
  margin-left: 4px;
  font-size: 20px;
  color: var(--muted);
}

.result-message {
  margin: 0;
  line-height: 1.8;
  color: var(--muted);
}

.result-actions {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f7f7f8;
}

.result-actions h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.result-actions ol {
  margin: 0;
  padding-left: 1.25em;
}

.result-actions li {
  margin: 8px 0;
  line-height: 1.7;
  color: var(--muted);
}

.result-links {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.result-links a {
  display: block;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
  background: #ffffff;
}

.checklist-form {
  padding-top: 12px;
}

.check-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  line-height: 1.6;
}

.check-row input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.choice-block {
  margin: 0;
  padding: 22px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.choice-block legend {
  margin-bottom: 14px;
  padding: 0;
  font-weight: 800;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.choice-card {
  position: relative;
}

.choice-card input {
  position: absolute;
  opacity: 0;
}

.choice-card span {
  min-height: 54px;
  display: grid;
  place-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  background: #ffffff;
}

.choice-card input:checked + span {
  border-color: var(--accent);
  color: #ffffff;
  background: var(--accent);
}

.plan-result .result-title {
  margin: 8px 0 14px;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 800;
  color: var(--ink-strong);
}

.plan-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.plan-day {
  min-height: 196px;
  padding: 22px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(23, 32, 38, 0.06);
}

.plan-day span {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  background: var(--accent);
}

.plan-day h2 {
  font-size: 20px;
}

.plan-day p {
  margin: 12px 0 0;
  line-height: 1.75;
  color: var(--muted);
}

.motion-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
}

.motion-panel,
.motion-preview-wrap,
.code-output {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 14px 36px rgba(23, 32, 38, 0.06);
}

.motion-panel {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.motion-panel label {
  display: grid;
  gap: 8px;
  color: var(--ink-strong);
  font-weight: 800;
}

.motion-panel select,
.motion-panel input[type="range"],
.motion-panel input[type="color"] {
  width: 100%;
}

.motion-panel select {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding-inline: 12px;
  color: var(--ink-strong);
  background: #ffffff;
}

.motion-panel input[type="color"] {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.motion-preview-wrap {
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  overflow: hidden;
}

.motion-preview {
  min-height: 320px;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    radial-gradient(circle at 74% 22%, rgba(139, 17, 24, 0.12), transparent 24%),
    linear-gradient(135deg, #ffffff 0%, #f7f7f8 100%);
}

.motion-target {
  min-width: min(420px, 78vw);
  padding: 38px 42px;
  border: 1px solid rgba(139, 17, 24, 0.16);
  border-radius: 8px;
  color: #ffffff;
  font-size: clamp(34px, 6vw, 78px);
  font-weight: 800;
  text-align: center;
  background: var(--motion-color, var(--accent));
  box-shadow: 0 24px 70px rgba(139, 17, 24, 0.22);
  overflow: hidden;
}

.code-output {
  margin-top: 28px;
  padding: 28px;
}

.code-output pre {
  max-height: 420px;
  overflow: auto;
  margin: 22px 0 0;
  padding: 20px;
  border-radius: 8px;
  color: #f8fafc;
  background: #111827;
}

.code-output code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.7;
}

@media (max-width: 820px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }

  .motion-layout {
    grid-template-columns: 1fr;
  }

  .result-panel {
    position: static;
  }
}

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

  .radio-group {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .radio-group span {
    width: 100%;
  }
}
