/* Writing style tile on the AI playground page (js/tone-game.js). Sits in the same well as the
   colour-system tile (.pg-media--system) and reuses its slider, chip and button styles. */

.wg { --tg-draft: var(--primary); }

/* the EmptyState preview */
.wg-preview {
  display: grid; justify-items: center; gap: 6px; padding: 22px 16px 18px; text-align: center;
  border: 1px solid var(--line); border-radius: 12px; background: var(--pg-tile);
  box-shadow: 0 1px 2px rgb(var(--ink-rgb) / .05);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.wg-preview.has-hit { border-color: var(--tg-bad); box-shadow: 0 0 0 1px var(--tg-bad); }
.wg-title { margin: 0; font-family: var(--font-display); font-size: 19px; font-weight: 400; line-height: 1.15; letter-spacing: -.03em; color: var(--ink); text-wrap: balance; }
.wg-body { max-width: 34ch; margin: 0; font-size: 13px; line-height: 1.45; color: var(--body); text-wrap: pretty; }
.wg-cta {
  display: inline-flex; align-items: center; min-height: 30px; margin-top: 6px; padding: 0 14px;
  border-radius: 999px; background: var(--primary); color: var(--on-primary); font-size: 12.5px; font-weight: 500;
}
.wg-hit { padding: 0 2px; border-radius: 4px; background: var(--tg-bad); color: #fff; }

.wg-meta { margin: 0; font-family: var(--font-mono); font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wg-checks { display: grid; gap: 6px; }
.wg .tg-actions .tg-btn { max-width: none; }

/* a small rewrite button above the message: brings the next suggestion */
.wg-rewrite {
  justify-self: start; display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--pg-tile); color: var(--ink);
  font-family: var(--font-sans); font-size: 12px; font-weight: 500; cursor: pointer;
  transition: background-color .14s var(--ease), border-color .14s var(--ease);
}
.wg-rewrite svg { transition: transform .5s var(--pg-ease); }
.wg-rewrite:hover:not(:disabled) { background: var(--bg-sage); border-color: rgb(var(--ink-rgb) / .2); }
.wg-rewrite:hover:not(:disabled) svg { transform: rotate(180deg); }
.wg-rewrite:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wg-rewrite:disabled { cursor: default; opacity: .55; }

/* 2. the writing-rule message: green while the copy passes, red with the reason when it breaks */
.wg-rule {
  display: grid; gap: 2px; padding: 10px 12px; border-left: 3px solid var(--tg-ok); border-radius: 6px;
  background: var(--pg-tile); box-shadow: inset 0 0 0 1px var(--line-soft);
}
.wg-rule.is-broken { border-left-color: var(--tg-bad); background: rgb(180 35 24 / .06); box-shadow: none; }
.wg-rule__name { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--tg-ok); }
.wg-rule.is-broken .wg-rule__name { color: var(--tg-bad); }
.wg-rule__name::before { content: "✓ "; }
.wg-rule.is-broken .wg-rule__name::before { content: "✕ "; }
.wg-rule__why { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--body); text-wrap: pretty; }

/* 3. the fix button stays off until there is something to fix */
.wg .tg-btn-primary:disabled { border-color: var(--line); background: var(--line-soft); color: var(--muted); opacity: 1; }

/* the tone slider's scale under the track */
.wg-scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .04em; color: var(--label); }
.wg-out { text-transform: capitalize; }

/* the assembled prompt, in the details panel */
.wg-prompt {
  margin: 0; padding: 12px 14px; overflow-x: auto; white-space: pre-wrap;
  border-radius: 10px; background: var(--pg-well); box-shadow: inset 0 0 0 1px var(--line);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.55; color: var(--ink-2);
}

@media (prefers-reduced-motion: reduce) {
  .wg-preview, .wg-rewrite, .wg-rewrite svg { transition: none; }
}
