/* The Rewriter page (26 Nov 2026; "the mirror" since 5 Dec 2026). Its own look, apart from the Humanizer's: your text
   and the rewrite are the two facing pages of one sheet ("the spread"), read across, their heads and feet lined up, on
   a cobalt band (.tool-band, app.css). The words Beni wrote carry cobalt, the colour of our own models; ink stays the
   one main action; no AI or human colours. Tokens from /assets/app.css only. Corners 6px (app.css rules). */
.rwp { --rwp-tint: color-mix(in srgb, var(--monal) 10%, var(--sheet)); }

/* ---------- headline: the key words carry the rewriter's mark, the one "Show changes" puts on new words. Two
   columns like the spread below: the headline over your page, the lead lined up with the rewrite's text. */
.rwp-hero { display: block; padding: 44px 0 30px; }   /* the title across the band (owner, 6 Dec 2026) */
.rwp-hero .rwp-lead { padding-left: 25px; }
.rwp-lead { margin: 0 0 8px; font-size: 17px; font-weight: 500; line-height: 1.55; color: var(--cobalt-l); max-width: none; text-wrap: pretty; }
.rwp-hero h1 { color: #fff; }

/* ---------- the spread: one sheet, two pages, a fold between; rows shared so heads and feet line up */
.rwp-spread { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto minmax(420px, 1fr) auto;
  background: var(--sheet); color: var(--ink); border-radius: var(--r-sheet); box-shadow: var(--shadow-cobalt); }
.rwp-spread:has(textarea:focus), .rwp-spread:has(#rwp-url:focus) { outline: 3px solid var(--focus-on-cobalt); outline-offset: 5px; }
.rwp-spread :focus-visible { outline-color: var(--focus); }
.rwp-page { grid-row: 1 / 4; display: grid; grid-template-rows: subgrid; min-width: 0; }
.rwp-out { border-left: 1px solid var(--line); }

.rwp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; min-height: 60px;
  padding: 9px 14px 9px 24px; border-bottom: 1px solid var(--line); }
.rwp-head h2 { font: 700 18px/1.2 var(--font-text); letter-spacing: -0.01em; }
.rwp-acts { display: inline-flex; gap: 8px; flex-wrap: wrap; }
#rwp-copy span { min-width: 3.2em; text-align: left; }        /* "Copy" -> "Copied" without the button jumping */

/* your page's tabs, Text | File | Link (6 Dec 2026): the checker's tabs, sitting on the head's rule */
.rwp-head-tabs { align-items: stretch; padding-top: 0; padding-bottom: 0; }
.rwp-tabs.tabs { padding: 0; border-bottom: 0; align-self: stretch; }
.rwp-tabs.tabs button { min-height: 59px; padding: 0; }
.rwp-tabs.tabs button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.rwp-body { display: flex; flex-direction: column; min-width: 0; }
.rwp-panel { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.rwp-panel[hidden] { display: none; }
#rwp-text { flex: 1 1 auto; min-height: 420px; resize: none; padding: 22px 24px 24px; field-sizing: content; }
.rwp-in.over .rwp-body { background: var(--paper); outline: 2px dashed var(--line-strong); outline-offset: -10px; border-radius: 4px; }
.rwp-drop { flex: 1 1 auto; display: grid; place-content: center; justify-items: center; gap: 6px; margin: 22px 24px; padding: 28px 20px;
  border: 1.5px dashed var(--line-strong); border-radius: var(--r); background: var(--paper); color: var(--ink-2); text-align: center; font-size: 15.5px; line-height: 1.5; }
.rwp-drop[hidden] { display: none; }
.rwp-drop p { margin: 0; }
.rwp-drop-ic { width: 28px; height: 28px; margin-bottom: 4px; color: var(--ink-3); }
.rwp-choose { padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: var(--cobalt-d); text-decoration: underline;
  text-underline-offset: 3px; cursor: pointer; }
.rwp-choose:hover { text-decoration-thickness: 2px; }
.rwp-small { font-size: 14px; color: var(--ink-3); }
.rwp-plink { padding: 22px 24px; gap: 8px; }
.rwp-label { font-size: 15px; font-weight: 600; color: var(--ink-2); }
#rwp-url { width: 100%; min-height: 48px; padding: 0 14px; font: inherit; font-size: 16px; color: var(--ink); background: var(--sheet);
  border: 1px solid var(--control-edge); border-radius: var(--r); }
#rwp-url:focus { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); }
.rwp-plink .rwp-small { margin: 2px 0 0; max-width: 46ch; line-height: 1.5; }
.rwp-picked { padding: 22px 24px; }
.rwp-picked .file-row { margin-top: 0; }
.rwp-picked-note { margin: 12px 0 0; font-size: 15px; color: var(--ink-2); max-width: 46ch; }
.rwp-file-err { margin: 0; padding: 0 24px 16px; color: var(--error); font-weight: 600; font-size: 15px; }

/* the rewrite reads like the text beside it: same face, size and measure */
.rwp-text { margin: 0; padding: 22px 24px 26px; font: 400 17.5px/1.75 var(--font-read); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.rwp-empty { margin: 0; padding: 22px 24px; font: 400 17.5px/1.75 var(--font-read); color: var(--ink-3); }
#rwp-text { caret-color: var(--cobalt); }
.rwp-msg { margin: 16px 24px 0; padding: 12px 14px; border-radius: var(--r); background: var(--cobalt-soft); color: var(--ink); font-weight: 500; font-size: 15px; }
.rwp-msg a { color: inherit; }

/* "Show changes": Beni's words on a monal tint with a soft rule; the words they replace struck, in grey */
.rwp-text ins.dx { text-decoration: none; background: var(--rwp-tint); box-shadow: inset 0 -2px 0 var(--monal-soft); border-radius: 2px; }
.rwp-text del.dx { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--control-edge); }
.rwp-text del.dx + ins.dx { margin-left: .25em; }
@media print { .rwp-text ins.dx { background: none; text-decoration: underline; } }

.rwp-wait { padding: 22px 24px; color: var(--ink-2); }
.rwp-wait p { margin: 0; }
.rwp-stage { font-weight: 600; color: var(--ink); }
.rwp-note { margin-top: 4px !important; font-size: 14px; color: var(--ink-3); }
.rwp-bar { display: block; max-width: 220px; height: 3px; margin: 0 0 16px; border-radius: 2px; background: var(--line); overflow: hidden; }
.rwp-bar i { display: block; width: 35%; height: 100%; border-radius: 2px; background: var(--monal); animation: rwp-slide 1.1s ease-in-out infinite; }
@keyframes rwp-slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

.rwp-foot { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; padding: 12px 16px 12px 24px; border-top: 1px solid var(--line); }
.rwp-count { margin-right: auto; font-size: 14px; color: var(--ink-3); }
.rwp-count b { color: var(--ink); font-weight: 600; }
.rwp-count.bad, .rwp-count.bad b { color: var(--error); }
.rwp-out .rwp-foot { flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 12px 24px; }
.rwp-out .rwp-foot p { margin: 0; font-size: 14px; line-height: 1.45; }
.rwp-meta { color: var(--ink-2); }
.rwp-meta .num { color: var(--ink); font-weight: 600; }
.rwp-notes { color: var(--ink); }
.rwp-honest { color: var(--ink-3); }

/* ---------- under the spread: the day's allowance under your text, the meaning question under the rewrite */
.rwp-under { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; padding: 18px 0 0; }
.rwp-allow { grid-column: 1; margin: 0; padding: 0 24px; font-size: 14.5px; color: var(--ink-2); }
.rwp-fb { grid-column: 2; padding: 6px 24px 0; }
.rwp-fb h3 { margin: 0 0 8px; font-size: 16px; }
.rwp-fb-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
#rwp-comment { display: block; width: 100%; min-height: 76px; resize: vertical; padding: 10px 12px; font: 400 16px/1.5 var(--font-text);
  background: var(--sheet); border: 1px solid var(--control-edge); border-radius: var(--r); }
#rwp-comment:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.rwp-fb-send { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.rwp-fb-msg { font-size: 14px; color: var(--ink-2); }

/* ---------- what changes and what stays: the "Show changes" view on a sheet, its key beside it */
/* 28 Nov 2026: section spacing and heading size come from home.css (.hs, .hs-h), the same on every tool page */
.rwp-sec { background: var(--paper-2); }
.rwp-eg { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; gap: 22px 56px; margin: var(--sec-gap, 40px) 0 0; }
/* the three steps in the rewriter's blue */
.rw-how { border-top: 1px solid var(--line); }
.rw-how .steps::before { background: var(--monal); }
.rw-how .step-n { background: var(--cobalt); color: #fff; }
.rw-how .step-art.lines b.rw { background: var(--rwp-tint); box-shadow: 0 2px 0 var(--monal); }
.rw-how .step-art .pill.num .icon { color: var(--monal); }
.rwp-eg-sheet { padding: 22px 26px 24px; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r-sheet); font-size: 18px; }
.rwp-eg figcaption { padding-top: 18px; font-size: 16px; color: var(--ink-2); max-width: 40ch; }
.rwp-eg figcaption p { margin: 0 0 10px; }

@media (prefers-reduced-motion: reduce) {
  .rwp-bar i { animation: none; width: 100%; opacity: .35; }
  .rwp-spread { transition: none; }
}
@media (max-width: 900px) {
  .rwp-hero { grid-template-columns: minmax(0, 1fr); padding: 30px 0 22px; }
  .rwp-hero .rwp-lead { margin: 0; padding-left: 0; }
  .rwp-eg { grid-template-columns: minmax(0, 1fr); }
  .rwp-eg figcaption { padding-top: 0; }
}
/* phones and narrow windows: the pages stack, your text first */
@media (max-width: 760px) {
  .rwp-spread { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; }
  .rwp-page { grid-row: auto; display: flex; flex-direction: column; }
  .rwp-page .rwp-body { flex: 1 1 auto; }
  .rwp-out { border-left: 0; border-top: 1px solid var(--line); }
  .rwp-head { padding: 8px 10px 8px 18px; min-height: 56px; }
  .rwp-head-tabs { padding-top: 0; padding-bottom: 0; }
  .rwp-tabs.tabs button { min-height: 55px; }
  .rwp-drop { margin: 16px 18px; }
  .rwp-plink { padding: 16px 18px 18px; }
  .rwp-acts .icon { display: none; }                           /* the title and both buttons on one line at 375px */
  #rwp-copy span { min-width: 0; }
  #rwp-text { min-height: 260px; padding: 16px 18px 18px; }
  .rwp-text, .rwp-empty, .rwp-wait, .rwp-picked { padding: 16px 18px 18px; }
  .rwp-msg { padding: 14px 18px 0; }
  .rwp-file-err { padding: 0 18px 14px; }
  .rwp-foot { padding: 10px 12px 12px 18px; }
  .rwp-in .rwp-foot .btn.primary { flex: 1 1 100%; }
  .rwp-out .rwp-foot { padding: 12px 18px; }
  .rwp-under { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .rwp-allow, .rwp-fb { grid-column: auto; padding: 0 2px; }
  .rwp-fb { order: -1; }
  .rwp-eg-sheet { padding: 16px 18px 18px; }
}
