/* WowWriter Suite — dark skin.
   ---------------------------------------------------------------------------
   WHY EVERY RULE STARTS WITH body.ww-dark

   The Suite prints its CSS as <style> blocks inside each shortcode's output,
   which is in the body — after <head>, where this file is loaded. At equal
   specificity the later rule wins, so a plain .gaw-wrap rule here would lose
   to the .gaw-wrap rule printed further down the page. Prefixing with
   body.ww-dark adds a class and an element to every selector, so these rules
   win on weight rather than on order, and the file can stay in <head> where
   it belongs — no flash of the light theme before the dark one arrives.

   The class is put on <body> only when the skin is switched on, so none of
   this can match while it is off.

   WHY THERE IS ALMOST NO !important

   Three of the modules keep their colours in custom properties — the writer
   (--g-*), the tools rail (--ww-*) and the pricing table (--text, --muted,
   --green…). Those are turned dark by redefining the properties and nothing
   else, which also carries the writer's 35 !important rules along, because
   every one of them reads a property rather than a literal colour.

   Two places genuinely resist and are marked: .ggc-attach, which hardcodes
   background:#fff!important, and .hpg-level-note, whose colours are written
   as an inline style attribute from gemini.php.
   --------------------------------------------------------------------------- */

body.ww-dark {
  --d-bg:      #07060B;

  /* Nearly opaque on purpose.
     These started at .62, which looked right over a dark page and turned to
     grey mud over a light one — a translucent panel is only ever as dark as
     whatever a theme happens to paint behind it, and that is not something
     this stylesheet can control. At .94 a panel is dark on its own account,
     whatever the theme does, and the field still shows in the gaps between
     panels, which is where it was visible anyway. */
  --d-glass:   rgba(21,16,30,.94);
  --d-glass-2: rgba(30,23,42,.94);
  --d-solid:   #15111E;
  --d-raise:   rgba(40,31,54,.72);
  --d-line:    rgba(255,255,255,.14);
  --d-line-2:  rgba(255,255,255,.22);
  --d-ink:     #F4F1F7;
  --d-mut:     #BFB7C9;
  --d-faint:   #9A92A6;
  --d-brand:   #C2268F;
  --d-brand-lt:#E86FC0;
  --d-brand-dk:#9B1D75;
  --d-good:    #35C77E;
  --d-bad:     #FF7A6B;
  --d-amber:   #F0D9A8;
  --d-glow:    rgba(194,38,143,.42);
}

/* ── the ground ───────────────────────────────────────────────────────────
   This is the part that has to be certain. Everything else here assumes the
   page behind it is dark, and a theme paints its own backgrounds on wrappers
   whose names this stylesheet cannot know in advance.

   So it is done in two passes. First html and body are forced dark. Then any
   element that CONTAINS one of the Suite's own wrappers is made transparent —
   which is every layer the theme has wrapped the tools in, whatever it calls
   them, without having to name a single one. :has() is what makes that
   possible: it selects an ancestor by what is inside it.

   Text colour is deliberately NOT set on body: that leaks into any surface
   still drawn light and makes its text unreadable. Each wrapper sets its own. */

/* The dark colour goes on html, and body is cleared.
   This split is not cosmetic. The nebula canvas sits at z-index:-1, and the
   paint order inside the root stacking context is: the root's own background,
   then negative z-index children, then the backgrounds of everything in flow.
   body is in flow, so an opaque body background paints straight over the
   canvas — the field runs, costs its frames and is never seen. */
html:has(body.ww-dark) { background-color: #07060B !important; background-image: none !important; }
body.ww-dark          { background-color: transparent !important; background-image: none !important; }

/* The Suite's own wrappers are excluded by name. Without that they would be
   caught by their own children — the tools nav sits inside the humanizer
   sidebar, so the sidebar contains a listed wrapper and would have had its
   own panel stripped off it. */
/* .wws-paused is in both lists for a reason.
   The theme's wrappers are only cleared when they contain a tool, and the
   pause notice REPLACES the tool — so with the free plan switched off there
   was no .gaw-wrap or .ww-shell left on the page, nothing matched, and the
   wrappers kept their white. The page went white under a dark card with the
   nebula nowhere to be seen. Naming the notice puts it back. */
body.ww-dark :has(.gaw-wrap, .ww-shell, .ww-tools, .pp-wrap, .ggc,
                   .ggp-stage, .aidc-rep-wrap, .wws-paused, #humanizer-pro-main,
                   #humanizer-pro-sidebar):not(
                   .gaw-wrap, .ww-shell, .ww-tools, .ww-panel, .ww-side,
                   .pp-wrap, .pp-card, .ggc, .ggp-stage, .ggp-modal,
                   .aidc-rep-wrap, .aidc-rep-card, .wws-paused,
                   #humanizer-pro-main, #humanizer-pro-sidebar) {
  background-color: transparent !important;
  background-image: none !important;
}

/* Named as well, for anything that wraps the page without containing a tool —
   a header or footer strip either side of the content. */
body.ww-dark > .site,
body.ww-dark > #page,
body.ww-dark > .wrapper,
body.ww-dark > .site-wrapper,
body.ww-dark .site-content,
body.ww-dark .content-area,
body.ww-dark #content,
body.ww-dark #primary,
body.ww-dark main,
body.ww-dark .entry-content,
body.ww-dark .elementor-section,
body.ww-dark .elementor-container { background-color: transparent; }

/*
 * A page that carries no tool at all.
 *
 * The two rules above between them cover every dark page that has a tool on
 * it: the :has() rule clears whatever CONTAINS one, and the named list clears
 * the wrappers around it. Neither reaches a page of plain text.
 *
 * Kadence prints
 *     .content-bg, body.content-style-unboxed .site { background: var(--global-palette9) }
 * into an inline <style> AFTER this file. `body.content-style-unboxed .site`
 * weighs exactly as much as `body.ww-dark > .site`, so the tie goes to
 * whichever comes last, and that is Kadence. The frame has therefore been
 * white on every page all along -- it just never showed, because every dark
 * page had a tool whose own panel painted over it. A terms or privacy page
 * has nothing to paint over it, so the white is the whole page.
 *
 * #wrapper is an id. It outweighs the tie instead of joining it, which is why
 * this works without !important.
 */
body.ww-dark #wrapper,
body.ww-dark .content-bg,
body.ww-dark.content-style-unboxed .site,
body.ww-dark.content-style-boxed .content-bg {
  background-color: transparent;
  background-image: none;
}

/*
 * The page-title band.
 *
 * Kadence draws the title of a page set to "Title above content" inside
 * .entry-hero-container-inner, which carries its own fill from palette 7 --
 * a pale blue-grey, about 200px tall, right under the header. The tool pages
 * hide their titles, so this had never been seen either.
 */
body.ww-dark .entry-hero,
body.ww-dark .page-hero-section,
body.ww-dark .entry-hero-container-inner {
  background-color: transparent;
  background-image: none;
}

/*
 * The footer, which this list did not name.
 *
 * Everything above clears the wrappers *around* the content, and the page
 * went dark as far as the content reached — then stopped. A theme footer
 * carries its own opaque white background, so it painted a white strip
 * across the bottom of a black page, which is where the eye lands last and
 * is the most obvious place to see it.
 *
 * The header is deliberately not here. It is a dark navy bar by design, and
 * clearing it would take that away. Only the footer is named, and only as a
 * footer — a <footer> inside a card is left alone.
 */
body.ww-dark > footer,
body.ww-dark > .wp-site-blocks > footer,
body.ww-dark .site-footer,
body.ww-dark #colophon,
body.ww-dark .footer-wrapper,
body.ww-dark .wp-block-template-part--footer,
body.ww-dark footer.wp-block-template-part,
body.ww-dark footer.wp-block-group {
  background-color: transparent !important;
  background-image: none !important;
}

/* Native scrollbars, form controls and the list a <select> drops down.

   Declared on the document, not on a handful of wrappers. A dropdown's list
   is painted by the browser outside the page, so it takes no notice of the
   colours set on the select or on anything around it — the only thing that
   reaches it is color-scheme, and it reads that from the element's inherited
   value. Set on six wrappers, it missed every select that was not inside one
   of them: the list came up on the system's light background with dark text,
   which on a dark page looked like a blank menu where only the row under the
   pointer could be read.

   Declared on the root it covers every control on the page, including ones
   added later, and takes the scrollbars with it. */
html:has(body.ww-dark),
body.ww-dark { color-scheme: dark; }

/*
 * The empty paragraph WordPress leaves around a shortcode.
 *
 * A blank line either side of [humanizer_pro] in the editor becomes <p></p>
 * once wpautop has run, and a paragraph carries a margin whether or not it
 * has anything in it. That is why one tool page starts lower than the next
 * for no visible reason — the gap is a paragraph you cannot see, and it
 * depends on how each page happened to be typed.
 *
 * Removing it here rather than asking for every page to be retyped, because
 * the next page added will be typed the same way.
 */
body.ww-dark .entry-content p:empty,
body.ww-dark .entry-content p.wp-block-paragraph:empty,
body.ww-dark .wp-block-pmpro-membership > p:empty,
body.ww-dark .entry-content p:has(> br:only-child),
body.ww-dark .ww-shell + p:empty { display: none; }

/*
 * The scrollbar is always there, so its width never changes.
 *
 * The theme measures it and publishes it on <html>:
 *
 *     --scrollbar-offset: 15px   (a page that scrolls)
 *     --scrollbar-offset: 0px    (one that does not)
 *
 * and then builds its page width from it:
 *
 *     --global-vw: calc( 100vw - ( 0.5 * var(--scrollbar-offset)) )
 *
 * So every container sized from --global-vw is 7.5px narrower on a long page
 * than on a short one, and everything centred in it moves by half of that.
 * That is the wordmark drifting between tools, the sidebar sitting a few
 * pixels further in on one page than the next, and the panel appearing to
 * nudge up and down — one variable, three symptoms.
 *
 * overflow-y: scroll keeps a real scrollbar on every page, so the theme
 * measures the same 15px everywhere and --global-vw stops changing.
 *
 * Deliberately NOT scrollbar-gutter: stable, which was tried and reverted.
 * That reserves the space without a scrollbar in it, so the viewport and the
 * measured width disagree — which is exactly what broke the landing page's
 * full-bleed maths. A real scrollbar cannot disagree with itself.
 */
html:has(body.ww-dark) { overflow-y: scroll; }

/*
 * scrollbar-gutter: stable was here, to stop the wordmark shifting a few
 * pixels between a page that scrolls and one that does not.
 *
 * Removed. The home page lays its sections out full-bleed with
 * calc(100vw - var(--ww-sb)) against a scrollbar width it measures in
 * script, and reserving the gutter changed what that measurement means — the
 * sections came out narrower than the window and left a pale strip down both
 * edges. A logo that moves by a few pixels is a blemish; a white frame around
 * the landing page is a fault, and the fix caused the worse of the two.
 *
 * If the drift is worth another attempt, it belongs in the home plugin's own
 * width maths rather than in a rule that changes the viewport under it.
 */

/* Belt and braces for the controls themselves, in case a theme or a plugin
   sets color-scheme back to light somewhere in between. */
body.ww-dark select,
body.ww-dark input,
body.ww-dark textarea,
body.ww-dark option,
body.ww-dark optgroup { color-scheme: dark; }


/* ══ writer — properties only ═══════════════════════════════════════════ */

body.ww-dark .gaw-wrap {
  --g-ink:        #F4F1F7;
  --g-mute:       #BFB7C9;
  --g-faint:      #9A92A6;
  --g-line:       rgba(255,255,255,.14);
  --g-bg:         rgba(20,15,28,.62);
  --g-soft:       rgba(29,22,40,.60);
  --g-brand:      #C2268F;
  --g-brand-2:    #9B1D75;
  --g-brand-ink:  #FFFFFF;
  --g-brand-soft: rgba(194,38,143,.18);
  --g-brand-text: #E86FC0;
  --g-good:       #35C77E;
  --g-bad:        #FF7A6B;
  --g-bad-soft:   rgba(255,122,107,.14);
  --g-shadow:     0 1px 2px rgba(0,0,0,.5), 0 16px 38px -20px rgba(0,0,0,.9);
}

/* .gaw-sys button.on — the selected half of the Simple / Advanced switch — is
   deliberately NOT here. It is filled with a gradient built from --g-brand and
   --g-brand-2, both of which this file already flips, so it comes out pink on
   dark without any help. It was in this list, which replaced that gradient
   with a flat dark panel and made the selected option look exactly like the
   unselected one. Same mistake as the current tool in the nav: a state drawn
   from tokens needs leaving alone, not overriding. */

/* the few writer rules that hardcode a fill rather than read a token */
body.ww-dark .gaw-imp-drop.on,
body.ww-dark .gaw-imp-key,
body.ww-dark .gaw-imp-doc,
body.ww-dark .gaw-ib.lk,
body.ww-dark .gaw-imp-key.lk,
body.ww-dark .gaw-drop-ic,
body.ww-dark .gaw-bubble {
  background: var(--d-glass-2);
  color: var(--d-ink);
  border-color: var(--d-line);
}
body.ww-dark .gaw-hist-item:hover { background: var(--d-raise); }
body.ww-dark .gaw-hist-list::-webkit-scrollbar-track { background: var(--d-solid); }
body.ww-dark .gaw-hist-x:hover { background: rgba(255,122,107,.2); }
body.ww-dark #gawPdfBar button,
body.ww-dark .gaw-pdf-slot,
body.ww-dark .gaw-pdf-page,
body.ww-dark .gaw-aidc-note,
body.ww-dark .gaw-hist-toggle,
body.ww-dark .gaw-hist-item,
body.ww-dark .gaw-hist-item.is-open {
  background: var(--d-glass-2);
  color: var(--d-ink);
  border-color: var(--d-line);
}
body.ww-dark .gaw-rail-tab { color: var(--d-mut); }
body.ww-dark .gaw-rail-tab.on { color: var(--d-ink); }


/* ══ tools rail and shell ═══════════════════════════════════════════════ */

/* The nav keeps its colours in properties AND paints a white card of its own.
   Flipping only the properties left a white box with pink-tinted pills on it
   and near-white labels on top of those — invisible. It needs both. */
body.ww-dark .ww-tools {
  --ww-a:    #C2268F;
  --ww-b:    #9B1D75;
  --ww-soft: rgba(194,38,143,.16);
  --ww-line: rgba(232,111,192,.30);
  background: var(--d-glass);
  border-color: var(--d-line);
  color: var(--d-ink);
}
/* --ww-a is both the heading colour and the fill of the active pill, so it
   cannot simply be lightened. As text on the dark panel it measures 3.53:1,
   under the 4.5:1 needed to read comfortably; the lighter brand pink is
   6.64:1, so the headings are given that and the pill keeps the fill. */
body.ww-dark .ww-tools-title { color: var(--d-brand-lt); }

body.ww-dark span.ww-tool { background: var(--d-glass-2); color: var(--d-mut); }
body.ww-dark .ww-update { background: var(--d-glass-2); border-color: var(--d-line); color: var(--d-ink); }
body.ww-dark .ww-update-ver { background: var(--d-raise); color: var(--d-mut); }
body.ww-dark .ww-update-date { color: var(--d-faint); }
body.ww-dark .ww-update-title { color: var(--d-ink); }
body.ww-dark .ww-shell,
body.ww-dark .ww-body { background: transparent; color: var(--d-ink); }

/* .ww-shell .ww-side .ww-panel is the deepest the Suite goes here, so the
   chain is matched rather than out-weighted by the prefix alone. */
/*
 * .ww-side is NOT painted. It used to be, and that was the sharp corner.
 *
 * It is the <aside> that positions the column — no border-radius, because it
 * was never meant to be a surface. Giving it the glass background drew a
 * square panel directly behind the rounded .ww-panel, and the corners stuck
 * out past the curve. The Humanizer page looked right only because it builds
 * its sidebar as #humanizer-pro-sidebar and has no .ww-side to paint.
 *
 * The panel inside is the surface, and it has the radius.
 */
body.ww-dark .ww-side,
body.ww-dark .ww-shell .ww-side {
  background: transparent;
  border-color: transparent;
  color: var(--d-ink);
}

body.ww-dark .ww-panel,
body.ww-dark .ww-shell .ww-panel,
body.ww-dark .ww-shell .ww-side .ww-panel {
  background: var(--d-glass);
  border-color: var(--d-line);
  color: var(--d-ink);
}
body.ww-dark .ww-panel-title { color: var(--d-brand-lt); }
body.ww-dark .ww-tool { color: var(--d-ink); border-color: var(--d-line); }

/* The tool you are on is marked by a pink gradient drawn in .ww-tool::before,
   with the pill's own text turned white and its border removed so the fill
   reads as one solid shape. The rule above is more specific than the Suite's
   .ww-tool.is-current, so it was putting the border back and overriding that
   white — which is what made the current tool stop standing out. Restated
   here, above the Suite's own weight. */
body.ww-dark .ww-tool.is-current,
body.ww-dark a.ww-tool.is-current {
  color: #fff;
  border-color: transparent;
}
body.ww-dark .ww-tool-badge { background: var(--d-raise); color: var(--d-mut); }


/* ══ humanizer ══════════════════════════════════════════════════════════ */

/* The sidebar is marked: tools-nav.php carries
   #humanizer-pro-sidebar{background:#fff!important}, which no amount of
   specificity can out-rank, so this has to be marked in turn. */
body.ww-dark #humanizer-pro-sidebar {
  background: var(--d-glass) !important;
  border-color: var(--d-line);
  color: var(--d-ink);
}
body.ww-dark #humanizer-pro-main {
  background: var(--d-glass);
  border-color: var(--d-line);
  color: var(--d-ink);
}
body.ww-dark #hp_output,
body.ww-dark #hp_input,
body.ww-dark .hp-history-toggle-btn,
body.ww-dark .hp-history-item,
body.ww-dark .hp-update-item,
body.ww-dark .hp-update-version,
body.ww-dark .hp-clear-btn,
body.ww-dark .hp-config-indicator,
body.ww-dark .hp-control select,
body.ww-dark .hp-control input,
body.ww-dark .hp-control textarea {
  background: var(--d-glass-2);
  color: var(--d-ink);
  border-color: var(--d-line);
}
body.ww-dark .hp-history-item:hover,
body.ww-dark .hp-update-item:hover,
body.ww-dark .hp-control select:hover,
body.ww-dark .hp-control select:focus { background: var(--d-raise); }
body.ww-dark .hp-history-delete:hover { background: rgba(255,122,107,.2); }
body.ww-dark .hp-form-section,
body.ww-dark .hp-sidebar-section { background: transparent; color: var(--d-ink); }
body.ww-dark .hp-control label,
body.ww-dark .hp-usage-details { color: var(--d-mut); }
body.ww-dark .humanizer-pro-restricted { background: var(--d-glass-2); color: var(--d-mut); }

/* #hp_send is deliberately left alone: its gradient is already built on
   --hp-primary (#ba328d), which is the brand pink and reads correctly on
   dark. Overriding it would only fight its own :hover rule. */
body.ww-dark .humanizer-pro-button {
  background: linear-gradient(135deg, var(--d-brand), var(--d-brand-dk));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 10px 28px -14px var(--d-glow);
}
body.ww-dark .hp-usage-bar { background: rgba(255,255,255,.1); }
body.ww-dark .hp-level-control .slider-container input[type="range"]::-webkit-slider-thumb,
body.ww-dark .hp-level-control .slider-container input[type="range"]::-moz-range-thumb {
  background: #FFF; border-color: var(--d-brand);
}


/* ══ the amber notices ══════════════════════════════════════════════════
   The credits bar, the "keep this tab open" card, chat favourites and the
   reports footnote all share one cream fill. */

body.ww-dark .hp-usage-info,
body.ww-dark .gaw-wait,
body.ww-dark .gaw-wait.gaw-queue,
body.ww-dark .ggc-favs,
body.ww-dark .aidc-rep-note {
  background: rgba(231,178,88,.13);
  border-color: rgba(231,178,88,.34);
  color: var(--d-amber);
}
/* written as a style attribute in modules/humanizer/gemini.php, so an
   ordinary rule cannot reach it */
body.ww-dark .hpg-level-note {
  background: rgba(231,178,88,.13) !important;
  border-color: rgba(231,178,88,.34) !important;
  color: var(--d-amber) !important;
}
body.ww-dark .hp-usage-info strong,
body.ww-dark .gaw-wait-head,
body.ww-dark .aidc-rep-note b,
body.ww-dark .aidc-rep-note .h { color: #FBE6BC; }
body.ww-dark #hp-reset-note { color: #D9C49A; }


/* ══ AI chat ════════════════════════════════════════════════════════════ */

/* The chat keeps its colours in two local blocks of its own — one on .ggc for
   the conversation, one on .ggc-rail for the history beside it — using short
   names (--ink, --mut, --line, --soft) rather than the Suite's --g-* or
   --ww-*. Being local they were invisible to everything above, so every
   piece of text in the rail stayed --ink: #1d1d2b, which against this panel
   is the same colour as the panel. The history was being drawn; it could not
   be seen.

   --a is the brand pink. Kept as a fill, lightened where it carries words:
   #c2268f measures 3.56:1 on this surface, the lighter pink 6.69:1. */
body.ww-dark .ggc,
body.ww-dark .ggc-rail {
  --ink:  #F4F1F7;
  --mut:  #BFB7C9;
  --line: rgba(255,255,255,.14);
  --soft: rgba(30,23,42,.94);
  --a:    #E86FC0;
  --b:    #9B8CFF;
}

body.ww-dark .ggc {
  background: var(--d-glass);
  border-color: var(--d-line);
  color: var(--d-ink);
}

/* The AI reports screen does the same thing with --rep-* names. */
body.ww-dark .aidc-rep {
  --rep-ink:  #F4F1F7;
  --rep-dim:  #BFB7C9;
  --rep-line: rgba(255,255,255,.14);
  --rep-key:  #E86FC0;
}
body.ww-dark .ggc-burger,
body.ww-dark .ggc-more,
body.ww-dark .ggc-new,
body.ww-dark .ggc-save-menu,
body.ww-dark .ggc-comp,
body.ww-dark .ggc-bar select,
body.ww-dark .ggc-size,
body.ww-dark .ggc-fab,
body.ww-dark .ggc-sw i {
  background: var(--d-glass-2);
  color: var(--d-ink);
  border-color: var(--d-line);
}
/* hardcodes background:#fff!important */
body.ww-dark .ggc-attach {
  background: var(--d-glass-2) !important;
  color: var(--d-ink) !important;
}
body.ww-dark .ggc-attach svg { stroke: var(--d-mut) !important; }
body.ww-dark .ggc-rail { background: var(--d-glass-2); border-color: var(--d-line); }
body.ww-dark .ggc-msg,
body.ww-dark .ggc-txt { color: var(--d-ink); }
body.ww-dark .ggc-item button:hover { background: var(--d-raise); }
body.ww-dark .ggc-chip { background: var(--d-raise); color: var(--d-mut); border-color: var(--d-line); }
body.ww-dark .ggc-send {
  background: linear-gradient(135deg, var(--d-brand), var(--d-brand-dk));
  color: #fff; border-color: transparent;
}
body.ww-dark .ggc-pic a,
body.ww-dark .ggc-pic button { background: var(--d-raise); color: var(--d-ink); }


/* ══ PPT maker ══════════════════════════════════════════════════════════
   The largest surface here: 222 colour uses, 105 of them distinct. */

body.ww-dark .ggp-stage,
body.ww-dark .ggp-modal {
  background: var(--d-glass);
  border-color: var(--d-line);
  color: var(--d-ink);
}
body.ww-dark .ggp-h,
body.ww-dark .ggp-card,
body.ww-dark .ggp-text,
body.ww-dark .ggp-in,
body.ww-dark .ggp-ghost,
body.ww-dark .ggp-hint,
body.ww-dark .ggp-vbar,
body.ww-dark .ggp-add,
body.ww-dark .ggp-sn,
body.ww-dark .ggp-stools button,
body.ww-dark .ggp-vbar button,
body.ww-dark .ggp-vbar a {
  background: var(--d-glass-2);
  color: var(--d-ink);
  border-color: var(--d-line);
}
body.ww-dark .ggp-h:hover { border-color: var(--d-brand-lt); }
body.ww-dark .ggp-text:focus,
body.ww-dark .ggp-in:focus { outline: 2px solid rgba(232,111,192,.45); border-color: var(--d-brand); }
body.ww-dark .ggp-btn,
body.ww-dark .ggp-done .a a,
body.ww-dark .ggp-done .a button,
body.ww-dark .ggp-vbar a.pri,
body.ww-dark .ggp-add .r button {
  background: linear-gradient(135deg, var(--d-brand), var(--d-brand-dk));
  color: #fff; border-color: transparent;
}
body.ww-dark .ggp-done .a button.alt,
body.ww-dark .ggp-vbar button.x { background: var(--d-raise); color: var(--d-ink); }
body.ww-dark .ggp-ins span { background: var(--d-raise); color: var(--d-mut); }
body.ww-dark .ggp-tx.on { background: rgba(194,38,143,.24); color: var(--d-ink); }
body.ww-dark .ggp-add p,
body.ww-dark .ggp-add .r span { color: var(--d-mut); }
body.ww-dark .ggp-add textarea,
body.ww-dark .ggp-add input[type=number] {
  background: var(--d-solid); color: var(--d-ink); border-color: var(--d-line);
}

/* .ggp-slide is left alone on purpose: it is already #000, because a slide
   is a letterboxed canvas, not a panel. Repainting it would be wrong. */


/* ══ AI detector reports ════════════════════════════════════════════════ */

body.ww-dark .aidc-rep-wrap { color: var(--d-ink); }
body.ww-dark .aidc-rep-card,
body.ww-dark .aidc-rep-drop,
body.ww-dark .aidc-rep-list,
body.ww-dark .aidc-files-table {
  background: var(--d-glass);
  color: var(--d-ink);
  border-color: var(--d-line);
}
body.ww-dark .aidc-rep-pill,
body.ww-dark .aidc-rep-pager button {
  background: var(--d-glass-2); color: var(--d-ink); border-color: var(--d-line);
}
body.ww-dark .aidc-rep-wrap tbody tr,
body.ww-dark .aidc-rep-wrap tbody tr:nth-child(odd) { background: transparent; }
body.ww-dark .aidc-rep-wrap tbody tr:hover { background: var(--d-raise); }
body.ww-dark .aidc-rep-msg { color: var(--d-mut); }
body.ww-dark .aidc-rep-track { background: rgba(255,255,255,.1); }
body.ww-dark .aidc-rep-bar { background: linear-gradient(90deg, var(--d-brand-dk), var(--d-brand-lt)); }


/* ══ pricing — properties, then the four surfaces that hardcode ═════════ */

body.ww-dark .pp-wrap {
  --text:   #F4F1F7;
  --muted:  #BFB7C9;
  --border: rgba(255,255,255,.14);
  --green:  #35C77E;
  --purple: #9B8CFF;
  --red:    #FF7A6B;
}
body.ww-dark .pp-card,
body.ww-dark .pp-panel .pp-card {
  background: var(--d-glass);
  border-color: var(--d-line);
  color: var(--d-ink);
  box-shadow: 0 30px 70px -36px rgba(0,0,0,.9);
}
/* The strip across the top of each card. The monthly one is a hardcoded
   navy gradient (#1a2035 → #3d4565) that all but disappears on a dark card,
   so it is given the brand instead. The yearly and invalid strips are built
   from --purple and --red and still read. */
body.ww-dark .pp-card.pp-monthly-card::before {
  background: linear-gradient(90deg, var(--d-brand-dk), var(--d-brand-lt));
}

body.ww-dark .pp-name { color: var(--d-ink); }

/* The figure itself in brand pink — it is the one thing on the card a visitor
   is looking for. The lighter pink, not #C2268F: at this size either reads,
   but the lighter one measures 6.69:1 against the card instead of 3.56:1, so
   it stays comfortable at the smaller sizes too. The currency symbol follows
   the number; the "/mo" stays muted so it does not compete with it. */
body.ww-dark .pp-price { color: var(--d-brand-lt); }

/* The figure is written by ppRenderCard() as a style attribute on the span,
   so no ordinary rule can reach it — an inline style outranks any stylesheet.
   Marked here, and scoped to the monthly card so the yearly and invalid tabs
   keep the accents that distinguish them. The lighter pink rather than the
   #c2268f the script writes: 6.69:1 against the card instead of 3.56:1. */
body.ww-dark .pp-monthly-card .pp-amt,
body.ww-dark .pp-monthly-card .pp-csym { color: var(--d-brand-lt) !important; }
body.ww-dark .pp-tab-btn {
  background: var(--d-glass-2); border-color: var(--d-line); color: var(--d-mut);
}
body.ww-dark .pp-tab-btn:hover { border-color: var(--d-line-2); color: var(--d-ink); }
body.ww-dark .pp-tab-btn.active,
body.ww-dark .pp-tab-btn.active.pp-monthly,
body.ww-dark .pp-tab-btn.active.pp-yearly {
  background: linear-gradient(135deg, var(--d-brand), var(--d-brand-dk));
  border-color: transparent; color: #fff;
}
body.ww-dark .pp-track-line { background: rgba(255,255,255,.14); }
body.ww-dark .pp-track-filled { background: linear-gradient(90deg, var(--d-brand-dk), var(--d-brand-lt)); }
body.ww-dark .pp-track-thumb { background: #fff; border-color: var(--d-brand); }
body.ww-dark .pp-stop-dot { background: rgba(255,255,255,.3); }
/* The coupon strip is the only other hardcoded light fill in the pricing
   CSS (#f8f7ff). The code chip inside it is left alone: it is filled with
   --purple, which stays saturated through the flip. */
body.ww-dark .pp-coupon-line {
  background: rgba(155, 140, 255, .12);
  border-color: rgba(155, 140, 255, .32);
}

/* The monthly call-to-action is filled with var(--text) — the same property
   that carries body text. Flipping --text to near-white for dark mode would
   turn this button white with white text on it, so it is given the brand
   gradient instead. The yearly and invalid buttons use --purple and --red,
   which stay saturated, so they are left as they are. */
body.ww-dark .pp-cta.pp-monthly,
body.ww-dark .pp-cta.pp-monthly:hover {
  background: linear-gradient(135deg, var(--d-brand), var(--d-brand-dk));
  color: #fff;
}
body.ww-dark .pp-abuser { background: var(--d-raise); color: var(--d-ink); }


/* ══ the Suite's form controls ══════════════════════════════════════════ */

/* background-COLOR, not the background shorthand.

   .gaw-sel draws its own dropdown chevron as a background-image, and the
   shorthand resets background-image to none — so every select styled here
   silently lost its arrow and became a plain box. Setting only the colour
   leaves the chevron where it is. */
body.ww-dark .ww-body input:not([type=range]),
body.ww-dark .ww-body textarea,
body.ww-dark .ww-body select,
body.ww-dark .gaw-wrap input:not([type=range]),
body.ww-dark .gaw-wrap textarea,
body.ww-dark .gaw-wrap select {
  background-color: var(--d-solid);
  color: var(--d-ink);
  border-color: var(--d-line);
}
body.ww-dark .ww-body ::placeholder,
body.ww-dark .gaw-wrap ::placeholder { color: var(--d-faint); }

/* The rows inside an open dropdown, everywhere — the writer's "Which writer"
   list, the humanizer's modes, the detector's, the slide maker's.

   color-scheme on the root already makes the browser paint this list dark,
   but only where the browser draws the list itself. Naming the colours here
   as well covers every engine, and covers a select whose own colours were
   set by the module rather than inherited. Written unscoped on purpose: an
   <option> belongs to the control, not to whichever panel the control
   happens to sit in, and scoping it to six wrappers is exactly what left
   these unreadable in the first place. */
/* Solid hex, and marked. Three reasons, all specific to this one widget:

   A dropdown's list is drawn by the operating system, not by the page. There
   is nothing behind it to blend with, so a translucent fill does not come out
   darker — it composites against the popup's own white and comes out pale.
   The selected row used rgba(40,31,54,.72) and rendered as a white band
   across the top of an otherwise dark list.

   Custom properties are resolved against the element's inherited values, and
   an <option> in a popup is far enough outside the normal flow that relying
   on that is not worth it here. Literal values cannot fail that way.

   And the marks: an option's colours are the one place a theme's own rules
   routinely reach, since nothing else on a page is styled this way. */
body.ww-dark option,
body.ww-dark optgroup {
  background-color: #15111E !important;
  color: #F4F1F7 !important;
}
body.ww-dark option:checked,
body.ww-dark option[selected] {
  background-color: #2A2139 !important;
  color: #FFFFFF !important;
}
body.ww-dark option:disabled {
  color: #8E8699 !important;
}


/* ══ inherited text colour ══════════════════════════════════════════════
   Some of the Suite's text has no colour rule anywhere — the price figure is
   the clearest case — so it inherits whatever the theme set on body. On a
   light theme that is near-black, which on these dark panels is unreadable.

   Setting a colour on body would fix it and was the first thing I tried; it
   also leaks into every surface still drawn light and makes THAT text
   invisible instead. So the colour is set on each tool's own wrapper, where
   it reaches the same text without escaping into the rest of the page. */
body.ww-dark .gaw-wrap,
body.ww-dark .pp-wrap,
body.ww-dark .ww-body,
body.ww-dark .ggp-stage,
body.ww-dark .aidc-wrap { color: var(--d-ink); }


/* ══ the currency toggle ════════════════════════════════════════════════
   Written as style attributes in the markup rather than as rules, so this is
   the one group here that has to be marked throughout. The active button is
   filled with var(--text) and lettered in white — the same inversion as the
   monthly call-to-action, and with --text flipped it was white on white. */
body.ww-dark #pp-currency-toggle { background: var(--d-glass-2) !important; }
body.ww-dark .pp-cur-btn {
  background: transparent !important;
  color: var(--d-mut) !important;
}
body.ww-dark .pp-cur-btn.active {
  background: linear-gradient(135deg, var(--d-brand), var(--d-brand-dk)) !important;
  color: #fff !important;
}


/* ══ AI detector — front end ════════════════════════════════════════════
   This module's front end was missing from the skin altogether: its CSS is
   in ai-detector/frontend.php, which was not in the list of files I read.
   Thirty-six surfaces, grouped the same way as the rest. */

body.ww-dark .aidc-card,
body.ww-dark .aidc-popup-content,
body.ww-dark .aidc-pdf-modal-content,
body.ww-dark .aidc-progress-content,
body.ww-dark .aidc-split-modal-content,
body.ww-dark .aidc-file-info,
body.ww-dark .aidc-login-msg,
body.ww-dark .aidc-daily-limit,
body.ww-dark .aidc-hz-info,
body.ww-dark .aidc-hz-queue,
body.ww-dark .aidc-split-pane-label,
body.ww-dark .aidc-split-format-bar,
body.ww-dark .aidc-split-fmt-select,
body.ww-dark .aidc-split-fmt-color,
body.ww-dark .aidc-split-fmt-btn,
body.ww-dark .aidc-hz-select,
body.ww-dark .aidc-rep-ico {
  background: var(--d-glass-2);
  border-color: var(--d-line);
  color: var(--d-ink);
}
body.ww-dark .aidc-split-fmt-btn:hover { background: var(--d-raise); }

/* Row hovers. These are the ones that show up as a white band under the
   cursor and nowhere else, so they look like a rendering glitch rather than a
   missed colour — and they hid from the audit too, because the selector they
   belong to ends in a bare `tr:hover` with no class on it to match against. */
body.ww-dark .aidc-files-table tbody tr:hover,
body.ww-dark .aidc-rep-wrap tbody tr:hover { background: var(--d-raise); }
body.ww-dark .aidc-files-table td .aidc-delete-btn {
  color: var(--d-mut);
  border-color: var(--d-line);
}
body.ww-dark .aidc-split-fmt-btn:active { background: var(--d-line-2); }
body.ww-dark .aidc-row-deleted td { background: var(--d-glass-2); color: var(--d-faint); }

/* tracks, rails and dividers */
body.ww-dark .aidc-progress-bar,
body.ww-dark .aidc-hz-slider,
body.ww-dark .aidc-hz-timer-bar,
body.ww-dark .aidc-split-resizer,
body.ww-dark .aidc-split-fmt-sep { background: rgba(255,255,255,.12); }
body.ww-dark .aidc-split-resizer:hover::after,
body.ww-dark .aidc-split-resizer.aidc-resizing::after { background: var(--d-brand-lt); }

/* the detector's verdict colours: low AI is good, high AI is not */
body.ww-dark .aidc-ai-pct.low,
body.ww-dark .aidc-validity-info {
  background: rgba(53,199,126,.14); border-color: rgba(53,199,126,.32); color: var(--d-good);
}
body.ww-dark .aidc-ai-pct.medium,
body.ww-dark .aidc-unauthorized-banner {
  background: rgba(231,178,88,.13); border-color: rgba(231,178,88,.34); color: var(--d-amber);
}
body.ww-dark .aidc-ai-pct.high,
body.ww-dark .aidc-hz-error,
body.ww-dark .aidc-hz-btn-clear {
  background: rgba(255,122,107,.14); border-color: rgba(255,122,107,.32); color: var(--d-bad);
}
body.ww-dark .aidc-hz-btn-clear:hover { background: rgba(255,122,107,.26); }
body.ww-dark .aidc-hz-btn-add {
  background: rgba(155,140,255,.18); border-color: rgba(155,140,255,.34); color: #C3B6FF;
}


/* ══ text that was written for a white page ════════════════════════════
   Found by measuring every hardcoded text colour in the modules against the
   panel colour and keeping the ones below 4.5:1 — the point at which ordinary
   text stops being comfortable to read. Fifty-two of them, from near-black
   headings down to the greys used for dates, word counts and hints.

   Grouped the way the modules use them rather than fixed one at a time, so a
   status stays a status: success is green, failure red, a warning amber, the
   queue blue, and anything that was merely grey becomes the muted token. */

/* headings and labels drawn in near-black */
body.ww-dark .ggp,
body.ww-dark .ggp-h2,
body.ww-dark .ggp-arr,
body.ww-dark .ggp-lab,
body.ww-dark .gaw-hist-title,
body.ww-dark .gaw-imp-busy-row,
body.ww-dark .aidc-files-table td:nth-child(1),
body.ww-dark .aidc-popup-content h3,
body.ww-dark .aidc-progress-content h3,
body.ww-dark .aidc-cooldown-timer,
body.ww-dark .aidc-split-checking,
body.ww-dark .aidc-hz-queue-item { color: var(--d-ink); }

/* secondary text: dates, counts, hints, captions */
body.ww-dark .gaw-pdf-fb,
body.ww-dark .hp-history-item-text,
body.ww-dark .hp-update-description,
body.ww-dark .ggc-txt blockquote,
body.ww-dark #hp_word_count,
body.ww-dark #hp_output_word_count,
body.ww-dark .ggp-sub,
body.ww-dark .ggp-note,
body.ww-dark .ggp-cost,
body.ww-dark .ggp-job-s,
body.ww-dark .ggp-done .m,
body.ww-dark .ggp-plus,
body.ww-dark .aidc-files-table td:nth-child(2)::before,
body.ww-dark .aidc-files-table td:nth-child(5),
body.ww-dark .aidc-files-table td:nth-child(6),
body.ww-dark .aidc-hz-wordcount,
body.ww-dark .aidc-split-page-info,
body.ww-dark .aidc-rep-wrap tbody td::before { color: var(--d-mut); }

/* success */
body.ww-dark .gaw-mst[data-s="done"] { color: var(--d-good); }

/* failure */
body.ww-dark .gaw-mst[data-s="failed"],
body.ww-dark .gaw-mx:hover,
body.ww-dark .gaw-busy-x,
body.ww-dark .ggc-chip button:hover,
body.ww-dark .hp-error,
body.ww-dark .humanizer-pro-restricted h3,
body.ww-dark .aidc-word-error,
body.ww-dark .aidc-hz-queue-remove { color: var(--d-bad); }

/* warnings, and a job that has stalled */
body.ww-dark .gaw-wait-sub,
body.ww-dark .gaw-hist-item.is-stalled .gaw-hist-meta,
body.ww-dark .ggc-favs-h,
body.ww-dark .pp-offer-divider h4 { color: var(--d-amber); }

/* waiting in a queue */
body.ww-dark .gaw-queue .gaw-wait-sub,
body.ww-dark .ww-update-body { color: #A9CBEC; }

/* brand pink as text: #C2268F measures 3.56:1 on the panel, so the lighter
   brand pink is used wherever it carries words rather than fills a shape */
body.ww-dark .ggp-ghost:hover,
body.ww-dark .ggp-vbar button:hover,
body.ww-dark .ggp-vbar a:hover,
body.ww-dark .ggp-h.is-live span,
body.ww-dark .gaw-hist-item.is-live .gaw-hist-meta { color: var(--d-brand-lt); }

/* Rules whose subject is a bare element — `label`, `td`, `p`, `a`, `span` —
   rather than a class. These slipped past the first sweep, which matched on
   the subject's class name and so saw nothing to match at all. The field
   labels beside the Humanize-with and Power dropdowns were among them, at
   1.50:1 against the panel: present, but effectively invisible. */
body.ww-dark .gaw-imp-mode label,
body.ww-dark .aidc-hz-row label,
body.ww-dark .aidc-files-table td,
body.ww-dark .ggc-save-menu a { color: var(--d-ink); }

body.ww-dark .aidc-file-info p,
body.ww-dark .ggp-tp p { color: var(--d-mut); }

body.ww-dark .ggp-h.is-bad span { color: var(--d-bad); }


/* ══ the remaining tinted surfaces ══════════════════════════════════════
   Found by parsing every <style> block in the modules for a background whose
   luminance is above 0.80 and which nothing above already answers — fifty of
   them. They are not arbitrary: the modules use a pink tint for a resting
   surface, amber for a warning, green for success, red for failure and blue
   for waiting, so they are answered here as five families rather than fifty
   separate colours, which is also what keeps them consistent with each other. */

/* resting surfaces — the pink and lilac tints */
body.ww-dark .ggp-job,
body.ww-dark .ggp-done,
body.ww-dark .ggp-credits,
body.ww-dark .ggp-note-bar,
body.ww-dark .ggp-bar,
body.ww-dark .ggp-t,
body.ww-dark .ggp-tp,
body.ww-dark .ggp-hdel:hover,
body.ww-dark .ggp-arr:hover:not([disabled]),
body.ww-dark .ggc-note,
body.ww-dark .ggc-pic img,
body.ww-dark .ggc-txt code,
body.ww-dark .ggc-chip .ic,
body.ww-dark .ggc-comp.drag,
body.ww-dark .aidc-rep-list .doc,
body.ww-dark #gawPdfBar,
body.ww-dark .ww-tool-row,
body.ww-dark .gaw-fl-card.is-done,
body.ww-dark .gaw-imp-out,
body.ww-dark .gaw-imp-drop.is-reading,
body.ww-dark .ggc-msg.user .ggc-txt,
body.ww-dark .ggp-t .sw.auto {
  background: var(--d-glass-2);
  border-color: var(--d-line);
  color: var(--d-ink);
}
body.ww-dark .gaw-bar { background: rgba(255,255,255,.12); }

/* Selects and tab buttons whose rule ends in a bare element — `select`,
   `button` — rather than a class. The Power and Mode dropdowns are among
   them: white boxes, so the level you picked and the list of levels behind it
   were both unreadable. */
body.ww-dark .gaw-imp-mode select,
body.ww-dark .gaw-imp-tabs button,
body.ww-dark .ggp-tabs button,
body.ww-dark .ggp-chips button {
  background: var(--d-glass-2);
  color: var(--d-ink);
  border-color: var(--d-line);
}
body.ww-dark .gaw-imp-tabs button.on,
body.ww-dark .ggp-tabs button.on {
  background: var(--d-brand);
  border-color: var(--d-brand);
  color: #fff;
}

/* The level slider's track is one gradient: brand up to the chosen level,
   then #ddd for the remainder. Only the remainder needs changing, so the
   gradient is restated with a dark tail and the same --slider-progress stop
   the Suite's own script writes. */
body.ww-dark .hp-level-control .slider-container input[type="range"]::-webkit-slider-runnable-track,
body.ww-dark .hp-level-control .slider-container input[type="range"]::-moz-range-track {
  background: linear-gradient(to right,
    var(--hp-primary) 0%,
    var(--hp-primary) var(--slider-progress, 70%),
    rgba(255,255,255,.14) var(--slider-progress, 70%),
    rgba(255,255,255,.14) 100%);
}
body.ww-dark .ggp-t.on,
body.ww-dark .ggc-item:hover,
body.ww-dark .ggc-item.on,
body.ww-dark .ggc-rail .ggc-item:hover,
body.ww-dark .ggc-save-menu a:hover {
  background: var(--d-raise);
  color: var(--d-ink);
}

/* warnings and the queue — amber */
body.ww-dark .gaw-mt-admin,
body.ww-dark .gaw-nothz,
body.ww-dark .gaw-busy-note,
body.ww-dark .ggc-adminbar,
body.ww-dark .ggc-item.fav,
body.ww-dark .gaw-ib.hz,
body.ww-dark .gaw-imp-key.hz {
  background: rgba(231,178,88,.13);
  border-color: rgba(231,178,88,.34);
  color: var(--d-amber);
}
body.ww-dark .ggc-item.fav:hover,
body.ww-dark .ggc-rail .ggc-item.fav:hover { background: rgba(231,178,88,.22); color: var(--d-amber); }
body.ww-dark .ggc-item.fav.on { background: rgba(231,178,88,.34); color: #FBE6BC; }
body.ww-dark .ggc-sw,
body.ww-dark .gaw-wait-bar { background: rgba(231,178,88,.30); }

/* success — green */
body.ww-dark .gaw-promise,
body.ww-dark .aidc-rep-msg.good {
  background: rgba(53,199,126,.14);
  border-color: rgba(53,199,126,.32);
  color: var(--d-good);
}

/* failure — red */
body.ww-dark .ggp-msg.bad,
body.ww-dark .ggp-done.bad,
body.ww-dark .ggc-err,
body.ww-dark .aidc-rep-msg.bad {
  background: rgba(255,122,107,.14);
  border-color: rgba(255,122,107,.32);
  color: var(--d-bad);
}

/* The two reader tabs are the one place the Suite marks a hardcoded light
   fill !important, and its own comment says why: which version you are
   reading — the one to hand in, or the raw one — is the thing on that screen
   you must not get wrong. So these are the only two colour rules here that
   have to be marked in turn. The inset ring the Suite draws around each tab
   is already a saturated green or red and is left to carry over. */
body.ww-dark .gaw-wrap .gaw-tab.is-human.on,
body.ww-dark .gaw-wrap .gaw-tab.is-human.on:hover {
  background: rgba(53,199,126,.16) !important;
  color: #6FE0AC !important;
}
body.ww-dark .gaw-wrap .gaw-tab.is-ai.on,
body.ww-dark .gaw-wrap .gaw-tab.is-ai.on:hover {
  background: rgba(255,122,107,.16) !important;
  color: #FF9E92 !important;
}

/* waiting — the blue bar and timer */
body.ww-dark .hp-countdown-timer {
  background: rgba(104,160,222,.14);
  border-color: rgba(104,160,222,.32);
  color: #A9CBEC;
}
body.ww-dark .gaw-queue .gaw-wait-bar { background: rgba(104,160,222,.34); }

/* plain greys: tracks, rails and the thin progress bars behind a fill */
body.ww-dark .hp-timer-bar,
body.ww-dark .gaw-fl-bars i,
body.ww-dark #hp_history_list::-webkit-scrollbar-track { background: rgba(255,255,255,.12); }
body.ww-dark .gaw-fl-bars i.drawing { background: rgba(255,255,255,.22); }


