:root {
  color-scheme: light;
  --bg: #f2f4f7;
  --surface: #ffffff;
  --surface-muted: #f7f8fa;
  --line: #d6dde6;
  --line-strong: #b3bfcd;
  --text: #1a2433;
  --text-muted: #5e6b7a;
  --accent: #00c853;
  --accent-soft: #ecfff3;
  --shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
  --radius-lg: 12px;
  --radius-md: 10px;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --sans: "Zen Kaku Gothic New", "Hiragino Sans", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 24px;
  line-height: 1.72;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 88px;
}

.topbar {
  margin-bottom: 28px;
  text-align: center;
}

.topbar-copy h1 {
  margin: 0;
  font-size: clamp(2.8rem, 4vw, 3.4rem);
  line-height: 1.2;
}

.eyebrow,
.section-label,
.subsection-label {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.copy-status,
.steps-list,
.example-caption,
.example-meta,
.tweak-chip {
  color: var(--text-muted);
}

.workspace {
  display: grid;
  gap: 24px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}

.section-header h2,
.help-block h2 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.2;
}

.form-grid,
.field,
.choice-field,
.subsection,
.subsection-body,
.help-body,
.help-block,
.secondary-details-body {
  display: grid;
  gap: 24px;
}

.field span,
.choice-field legend,
.output-label {
  font-weight: 700;
  font-size: 1.3rem;
}

.field input,
.field textarea,
.output-box {
  width: 100%;
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1.15rem;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field textarea,
.output-box {
  resize: vertical;
}

.field input:hover,
.field textarea:hover,
.output-box:hover {
  border-color: var(--line-strong);
}

.field input:focus,
.field textarea:focus,
.output-box:focus,
.button:focus-visible,
.example-button:focus-visible,
.example-apply:focus-visible,
.tweak-chip:focus-visible,
.choice-card:focus-within,
.subsection summary:focus-visible,
.secondary-details summary:focus-visible,
.help-panel summary:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 200, 83, 0.16);
}

.choice-field {
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-grid {
  display: grid;
  gap: 14px;
}

.choice-card {
  position: relative;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

.choice-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.choice-indicator {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.choice-card.is-selected {
  border-color: rgba(0, 200, 83, 0.42);
  background: var(--accent-soft);
}

.choice-card.is-selected .choice-indicator {
  border-color: var(--accent);
  background: radial-gradient(circle, var(--accent) 0 46%, transparent 47%);
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: baseline;
  margin-bottom: 8px;
}

.choice-title {
  margin: 0;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1.45;
}

.choice-note,
.choice-detail,
.example-caption,
.example-meta,
.tweak-chip {
  font-size: 1rem;
}

.choice-note {
  font-family: var(--mono);
}

.choice-detail {
  margin: 0;
}

.custom-field {
  padding: 18px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.custom-field[hidden] {
  display: none;
}

.subsection {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.subsection summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

.subsection summary::-webkit-details-marker {
  display: none;
}

.subsection summary::after {
  content: "+";
  margin-left: 8px;
  color: var(--text-muted);
}

.subsection[open] summary::after {
  content: "−";
}

.subsection-body {
  margin-top: 18px;
}

.example-button-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.example-button,
.button,
.example-apply,
.tweak-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.example-button:hover,
.button:hover,
.example-apply:hover,
.tweak-chip:hover {
  border-color: var(--line-strong);
}

.example-button {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
}

.example-button.is-active {
  border-color: rgba(0, 200, 83, 0.36);
  background: var(--accent-soft);
  color: var(--accent);
}

.card-output {
  display: grid;
  gap: 24px;
}

.start-here {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.start-here strong,
.start-here p {
  margin: 0;
}

.start-here strong {
  font-size: 1.15rem;
}

.start-here p {
  color: var(--text-muted);
  font-size: 1rem;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1.05rem;
}

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

.button-secondary,
.button-ghost {
  background: var(--surface);
}

.copy-status {
  min-height: 1.5em;
  margin: 4px 0 0;
  font-size: 1rem;
}

.output-label {
  display: block;
  margin-bottom: 12px;
}

.output-box {
  min-height: 440px;
  font-family: var(--mono);
  font-size: 1rem;
  line-height: 1.7;
}

.output-box-secondary {
  min-height: 180px;
}

.secondary-details,
.help-panel {
  margin-top: 12px;
}

.secondary-details summary,
.help-panel summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
}

.secondary-details summary::-webkit-details-marker,
.help-panel summary::-webkit-details-marker {
  display: none;
}

.secondary-details summary::after,
.help-panel summary::after {
  content: "+";
  margin-left: 8px;
  color: var(--text-muted);
}

.secondary-details[open] summary::after,
.help-panel[open] summary::after {
  content: "−";
}

.secondary-details-body {
  margin-top: 20px;
}

.help-panel {
  margin-top: 28px;
}

.help-body {
  margin-top: 24px;
}

.steps-list {
  margin: 0;
  padding-left: 1.2rem;
}

.steps-list li + li {
  margin-top: 12px;
}

.example-card-grid {
  display: grid;
  gap: 16px;
}

.example-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
}

.example-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.example-card h3 {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.4;
}

.example-caption,
.example-meta {
  margin: 0;
}

.example-meta strong {
  color: var(--text);
}

.example-apply {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
}

.tweak-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tweak-chip {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 1rem;
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 20px, 1120px);
    padding-top: 24px;
  }

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

  .card {
    padding: 24px;
  }

  .section-header {
    margin-bottom: 20px;
  }

  .action-row {
    flex-direction: column;
  }

  .button {
    width: 100%;
  }

  .example-card-top {
    flex-direction: column;
  }

  .output-box {
    min-height: 320px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
