/* Reset story tool: recognition first, then one small decision on the first screen. */
.story-page--tool {
  --reset-ink: var(--story-ink);
  --reset-muted: var(--story-muted);
  --reset-line: var(--story-line);
  --reset-warm-soft: #fff0df;
}

.story-page--tool .story-breadcrumbs { margin-bottom: 1.4rem; }
.story-page--tool .story-hero { margin-bottom: 1.4rem; }
.story-page--tool .story-hero h1 {
  max-width: 22ch;
  font-size: clamp(2.05rem, 4.2vw, 3.45rem);
  line-height: 1.02;
}
.story-page--tool .story-standfirst { margin-top: .8rem; }

.story-tool {
  margin: 0 0 4rem;
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid rgba(215,101,34,.22);
  border-radius: 1.6rem;
  background: linear-gradient(145deg, rgba(255,240,223,.92), rgba(255,255,255,.9));
  box-shadow: 0 18px 46px rgba(20,35,59,.07);
}

.story-tool-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  letter-spacing: -.035em;
  line-height: 1.05;
}
.story-tool-head p:not(.eyebrow) {
  max-width: 40rem;
  margin: .55rem 0 0;
  color: var(--story-muted);
  line-height: 1.55;
}
.story-tool-head .eyebrow { margin-bottom: .5rem; }

.story-tool-field {
  display: grid;
  gap: .4rem;
  max-width: 34rem;
  margin: 1.2rem 0 0;
  font-weight: 800;
  font-size: .92rem;
}
.story-tool-field input {
  min-height: 48px;
  padding: .7rem .9rem;
  border: 1px solid rgba(20,35,59,.2);
  border-radius: .85rem;
  background: #fff;
  color: var(--story-ink);
  font-weight: 500;
}

.story-tool-choices {
  margin: 1.2rem 0 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.story-tool-choices legend {
  margin-bottom: .6rem;
  padding: 0;
  font-weight: 800;
  font-size: .92rem;
}
.story-tool-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
  gap: .6rem;
}
.story-tool-choice {
  position: relative;
  display: flex;
  gap: .65rem;
  align-items: flex-start;
  padding: .85rem .95rem;
  border: 1px solid rgba(20,35,59,.14);
  border-radius: 1rem;
  background: rgba(255,255,255,.82);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease;
}
.story-tool-choice:hover { border-color: rgba(215,101,34,.45); }
.story-tool-choice:has(input:checked) {
  border-color: var(--story-orange);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(215,101,34,.18);
}
.story-tool-choice input { margin: .2rem 0 0; accent-color: var(--story-orange); flex: none; }
.story-tool-choice strong { display: block; font-size: .98rem; line-height: 1.25; }
.story-tool-choice small { display: block; margin-top: .25rem; color: var(--story-muted); font-size: .85rem; line-height: 1.4; }

.story-tool-result {
  margin-top: 1.3rem;
  padding: 1.15rem 1.25rem;
  border-radius: 1.1rem;
  background: var(--story-navy);
  color: #fff;
}
.story-tool-result[hidden] { display: none; }
.story-tool-result-label {
  margin: 0 0 .45rem;
  color: #f4c8a5;
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.story-tool-step {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(1.2rem, 2.3vw, 1.55rem);
  line-height: 1.35;
  white-space: pre-line;
}
.story-tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  margin-top: 1rem;
}
.story-tool-actions .primary { background: var(--story-orange); }
.story-tool-copied { color: rgba(255,255,255,.78); font-size: .88rem; }
.story-tool-privacy {
  margin: .9rem 0 0;
  color: var(--story-muted);
  font-size: .84rem;
}

.story-tool-hint {
  margin: 1rem 0 0;
  color: var(--story-muted);
  font-size: .9rem;
}
.story-tool[data-tool-ready="true"] .story-tool-hint { display: none; }

#story-poster-canvas {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  height: auto;
  background: white;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

.story-page--tool .story-opening { margin-bottom: 3.5rem; }
.story-page--tool .story-break { margin-bottom: 3.5rem; }

@media (max-width: 820px) {
  #story-poster-canvas { max-height: 62vh; }
}

@media (max-width: 620px) {
  .story-tool { margin-bottom: 3rem; border-radius: 1.3rem; }
  .story-tool-options { grid-template-columns: 1fr; }
  .story-tool-actions > * { flex: 1 1 auto; }
}
