/* aiwa-content-generator.css — the AI Content Generator workspace.
 *
 * RENAMED 26 Sep 2026, after this file — then called aiwa-content.css — was found to have
 * overwritten the stylesheet of the same name that fourteen content pages depend on.
 * The generator shipped on 19 Sep and wrote its styles to a filename that was already in use;
 * `.content-shell`, `.content-hero` and `.content-body` stopped existing, and /tools.html,
 * /help.html, /about.html, the four policy pages and the rest rendered with no page container
 * for a week. Nothing failed: a browser ignores a class it has no rule for, in silence.
 *
 * Two different stylesheets must never share a filename. The content pages are on
 * aiwa-content-pages.css; this one is the generator's and nothing else loads it.
 */

/* AI Content Generator — the parts of the workspace that are its own.
   Everything else comes from the shared shell: aiwa-app-shell.css, aiwa-command.css,
   aiwa-paraphrase.css and aiwa-email.css, which this page loads in that order. Only the
   type picker, the per-type controls, the result cards and the details dialog are here. */

/* ------------------------------------------------------------- the shell --- */
/* The page reuses the email writer's shell, so these hooks mostly refine what it already sets.
   Every class the markup carries is defined here — a class with no rule renders as nothing at all
   and looks perfectly correct in the markup (Text Compare, 2 Sep 2026). */
.cg-app .pp-bar-inner { flex-wrap: wrap; row-gap: 8px; }
.cg-extras { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cg-output { position: relative; display: flex; flex-direction: column; min-height: 0; }
.cg-output.is-loading { opacity: .72; }
.cg-stat { color: var(--aiwa-muted); font-size: 12.5px; font-weight: 650; }
.cg-refine-menu { min-width: 190px; }

/* ---------------------------------------------------------- the type picker --- */
/* Eighteen types in four groups. Two columns on a desktop menu, one on a phone, and the
   list scrolls: a menu taller than the viewport puts the last group out of reach. */
.cg-type-menu { width: 560px; max-width: calc(100vw - 32px); }
.cg-type-list { grid-template-columns: 1fr 1fr; max-height: min(58vh, 460px); overflow-y: auto; overscroll-behavior: contain; }
.cg-type-group { grid-column: 1 / -1; margin: 8px 0 2px; padding: 0 6px; color: var(--aiwa-muted); font-size: 11px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.cg-type-group:first-child { margin-top: 0; }
.cg-type-note { margin: 0; padding: 10px 14px 0; border-top: 1px solid var(--aiwa-line); color: var(--aiwa-muted); font-size: 12px; line-height: 1.55; }
.cg-type-note b { color: var(--aiwa-text); }
.cg-type-dd .pp-mode-btn-text b { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-tone-menu { width: 320px; max-width: calc(100vw - 32px); }
.cg-tone-dd .pp-mode-btn-text b { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cg-tone-list { grid-template-columns: 1fr; }

/* ------------------------------------------------------- the type's controls --- */
.cg-length[hidden], .cg-count-wrap[hidden] { display: none; }
/* A fixed poetic form sets its own line count, so the slider is shown but inert rather than removed:
   a control that vanishes and returns as the reader changes a field is harder to follow than one that greys. */
.cg-length.is-fixed .pp-range { opacity: .45; pointer-events: none; }
.cg-count-wrap select { min-width: 104px; }
.cg-details-btn.is-set { border-color: var(--aiwa-brand); background: var(--aiwa-brand-soft); color: var(--aiwa-brand-dark); }
.cg-brief-label { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; background: var(--aiwa-brand-soft); color: var(--aiwa-brand-dark); font-size: 12px; font-weight: 700; }
/* The brief's label sits over the top-right corner of the input pane. An absolutely positioned overlay
   inherits the shell's own offsets, so all four are set here rather than two (the lesson from the
   citation generator), and the textarea is padded so the placeholder never runs under the chip. */
.cg-in-tools { position: absolute; top: 10px; right: 16px; bottom: auto; left: auto; z-index: 2; pointer-events: none; }
.content-generator-page .pp-pane-in .pp-input { padding-top: 46px; }

/* --------------------------------------------------------------- the result --- */
/* A long piece is one editable document; a set of names, slogans or acronyms is a list of
   cards, each editable in place and each with its own copy button. */
.cg-doc-head { flex: 0 0 auto; padding: 50px 26px 12px; border-bottom: 1px solid var(--aiwa-line); background: var(--aiwa-surface-2, #fbfcfb); }
.cg-doc-head[hidden] { display: none; }
.cg-doc-head input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--aiwa-ink); font: inherit; font-size: 17px; font-weight: 750; outline: 0; }
.cg-doc-head input:hover { border-color: var(--aiwa-line); background: var(--aiwa-surface, #fff); }
.cg-doc-head input:focus { border-color: var(--aiwa-brand); background: var(--aiwa-surface, #fff); box-shadow: 0 0 0 3px rgba(19, 122, 61, 0.14); }

.cg-list { flex: 1 1 auto; min-height: 0; padding: 50px 20px 28px; overflow: auto; display: grid; gap: 10px; align-content: start; }
.cg-list[hidden] { display: none; }
.cg-card { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; padding: 13px 14px; border: 1px solid var(--aiwa-line); border-radius: 13px; background: var(--aiwa-surface, #fff); }
.cg-card:hover { border-color: #9bc7aa; }
.cg-card-main { min-width: 0; }
.cg-card-label { display: block; color: var(--aiwa-ink); font-size: 15.5px; font-weight: 750; letter-spacing: .01em; }
.cg-card-text { color: var(--aiwa-text); font-size: 15px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; outline: 0; border-radius: 8px; }
.cg-card-label + .cg-card-text { margin-top: 3px; color: var(--aiwa-muted); font-size: 14px; }
.cg-card-text:focus { box-shadow: 0 0 0 2px rgba(19, 122, 61, 0.22); }
.cg-card-note { display: block; margin-top: 6px; color: var(--aiwa-muted); font-size: 12px; font-weight: 650; }
.cg-card-copy { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid transparent; border-radius: 9px; background: transparent; cursor: pointer; }
.cg-card-copy:hover { border-color: var(--aiwa-line); background: var(--aiwa-brand-soft); }
.cg-card-copy .aiwa-ui-icon { width: 15px; height: 15px; }

/* -------------------------------------------------------- the details dialog --- */
.cg-dialog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cg-dialog-grid label { display: grid; gap: 5px; min-width: 0; }
.cg-dialog-grid span { color: var(--aiwa-muted); font-size: 11.5px; font-weight: 700; }
.cg-dialog-grid input, .cg-dialog-grid select { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--aiwa-line); border-radius: 10px; background: var(--aiwa-surface, #fff); color: var(--aiwa-ink); font: inherit; font-size: 14px; }
.cg-dialog-grid input:focus, .cg-dialog-grid select:focus { border-color: var(--aiwa-brand); outline: 0; box-shadow: 0 0 0 3px rgba(19, 122, 61, 0.14); }

/* ------------------------------------------------------------------- narrow --- */
@media (max-width: 1500px) { .cg-type-dd .pp-mode-btn-text b { max-width: 130px; } }
@media (max-width: 900px) {
  /* On a phone the input pane is only about 270px tall: the empty state is centred in it and the
     placeholder starts at the top, so a three-line example ran underneath "What are we writing?".
     The empty state carries the same guidance, so the placeholder steps aside until there is text. */
  .content-generator-page .pp-input-wrap:not(.has-text) .pp-input::placeholder { color: transparent; }
  .content-generator-page .pp-pane-in .pp-input { padding-top: 40px; }
  .cg-type-menu, .cg-tone-menu { width: min(420px, calc(100vw - 24px)); }
  .cg-type-list { grid-template-columns: 1fr; max-height: 54vh; }
  .cg-dialog-grid { grid-template-columns: 1fr; }
  .cg-doc-head { padding: 16px 16px 10px; }
  .cg-list { padding: 16px 14px 26px; }
}

/* --------------------------------------------------------------- dark theme --- */
:root[data-theme="dark"] .cg-doc-head { background: #101a14; border-bottom-color: #1e2b23; }
:root[data-theme="dark"] .cg-doc-head input:hover, :root[data-theme="dark"] .cg-doc-head input:focus { background: #0c1410; }
:root[data-theme="dark"] .cg-card { background: #101a14; border-color: #1e2b23; }
:root[data-theme="dark"] .cg-card:hover { border-color: #2f5c42; }
:root[data-theme="dark"] .cg-dialog-grid input, :root[data-theme="dark"] .cg-dialog-grid select { background: #0c1410; border-color: #1e2b23; }
:root[data-theme="dark"] .cg-card-copy:hover { border-color: #2f5c42; background: #16231b; }

/* Type pages (/generator/<type>), plain-style rewrite 1 Oct 2026: the how-to guide is running prose, and the
   note under a real run is read as a paragraph, so both sit left-aligned at reading size. */
body.generator-type-page .wx-root .wx-prose { max-width: 720px; margin: 28px auto 0; text-align: left; }
body.generator-type-page .wx-root .wx-prose .wx-p { color: var(--aiwa-text); font-size: 16.5px; line-height: 1.75; }
body.generator-type-page .wx-root .wx-prose .wx-p + .wx-p { margin-top: 16px; }
body.generator-type-page .para-explainer .wx-note { max-width: 760px; font-size: 14.5px; line-height: 1.65; text-align: left; }
