/*
 * Cool Web Tools — unified theme
 * Red / White / Blue. Light + dark.
 *
 * Brand reds and blues are anchored on the official US flag colors:
 *   Old Glory Red  #B22234
 *   Old Glory Blue #3C3B6E
 * Dark mode brightens the accents for contrast against a deep navy background.
 */

/* -------------------------------------------------------------------------- */
/* Tokens                                                                      */
/* -------------------------------------------------------------------------- */

:root,
[data-theme="light"] {
  color-scheme: light;

  /* Surfaces */
  --cwt-bg:           #ffffff;
  --cwt-bg-elevated:  #ffffff;
  --cwt-bg-muted:     #f4f6fa;
  --cwt-bg-subtle:    #eaeef5;
  --cwt-bg-inverse:   #0a1228;

  /* Borders */
  --cwt-border:        #d8dde7;
  --cwt-border-strong: #b3bccd;

  /* Text */
  --cwt-text:         #0a1a3a;
  --cwt-text-muted:   #4b5870;
  --cwt-text-subtle:  #8593ab;
  --cwt-text-inverse: #ffffff;

  /* Brand */
  --cwt-red:          #b22234;
  --cwt-red-hover:    #8c1a29;
  --cwt-red-soft:     #fde7ea;
  --cwt-blue:         #3c3b6e;
  --cwt-blue-hover:   #2a2952;
  --cwt-blue-soft:    #e6e7f1;
  --cwt-white:        #ffffff;

  /* Semantic accents (red is primary, blue is secondary) */
  --cwt-accent:         var(--cwt-red);
  --cwt-accent-hover:   var(--cwt-red-hover);
  --cwt-accent-soft:    var(--cwt-red-soft);
  --cwt-accent-fg:      #ffffff;

  --cwt-secondary:       var(--cwt-blue);
  --cwt-secondary-hover: var(--cwt-blue-hover);
  --cwt-secondary-soft:  var(--cwt-blue-soft);
  --cwt-secondary-fg:    #ffffff;

  /* Status */
  --cwt-success:      #1f7a3a;
  --cwt-success-soft: #dff5e4;
  --cwt-warning:      #b97300;
  --cwt-warning-soft: #fff1d6;
  --cwt-error:        #b22234;
  --cwt-error-soft:   #fde7ea;

  /* Effects */
  --cwt-focus-ring:   0 0 0 3px rgba(60, 59, 110, 0.35);
  --cwt-shadow-sm:    0 1px 2px rgba(10, 18, 40, 0.06);
  --cwt-shadow:       0 2px 6px rgba(10, 18, 40, 0.08), 0 1px 2px rgba(10, 18, 40, 0.04);
  --cwt-shadow-lg:    0 12px 24px rgba(10, 18, 40, 0.10), 0 4px 8px rgba(10, 18, 40, 0.06);

  /* Header chrome */
  --cwt-header-bg:    rgba(255, 255, 255, 0.85);
  --cwt-header-border: var(--cwt-border);
}

[data-theme="dark"] {
  color-scheme: dark;

  /* Surfaces */
  --cwt-bg:           #0a1228;
  --cwt-bg-elevated:  #101a36;
  --cwt-bg-muted:     #15234a;
  --cwt-bg-subtle:    #1c2c5b;
  --cwt-bg-inverse:   #ffffff;

  /* Borders */
  --cwt-border:        #243259;
  --cwt-border-strong: #3b4d80;

  /* Text */
  --cwt-text:         #f4f7ff;
  --cwt-text-muted:   #cdd6e8;
  --cwt-text-subtle:  #94a3b8;
  --cwt-text-inverse: #0a1228;

  /* Brand — brightened for dark contrast */
  --cwt-red:          #ef4655;
  --cwt-red-hover:    #ff6573;
  --cwt-red-soft:     rgba(239, 70, 85, 0.12);
  --cwt-blue:         #7d8dd8;
  --cwt-blue-hover:   #98a6e6;
  --cwt-blue-soft:    rgba(125, 141, 216, 0.14);
  --cwt-white:        #ffffff;

  --cwt-accent:         var(--cwt-red);
  --cwt-accent-hover:   var(--cwt-red-hover);
  --cwt-accent-soft:    var(--cwt-red-soft);
  --cwt-accent-fg:      #ffffff;

  --cwt-secondary:       var(--cwt-blue);
  --cwt-secondary-hover: var(--cwt-blue-hover);
  --cwt-secondary-soft:  var(--cwt-blue-soft);
  --cwt-secondary-fg:    #0a1228;

  --cwt-success:      #4caf50;
  --cwt-success-soft: rgba(76, 175, 80, 0.14);
  --cwt-warning:      #ffb547;
  --cwt-warning-soft: rgba(255, 181, 71, 0.14);
  --cwt-error:        #ef5350;
  --cwt-error-soft:   rgba(239, 83, 80, 0.14);

  --cwt-focus-ring:   0 0 0 3px rgba(125, 141, 216, 0.45);
  --cwt-shadow-sm:    0 1px 2px rgba(0, 0, 0, 0.4);
  --cwt-shadow:       0 4px 12px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.3);
  --cwt-shadow-lg:    0 16px 36px rgba(0, 0, 0, 0.55), 0 6px 12px rgba(0, 0, 0, 0.4);

  --cwt-header-bg:    rgba(10, 18, 40, 0.85);
  --cwt-header-border: var(--cwt-border);
}

/* Typography + scale (mode-independent) */
:root {
  --cwt-font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --cwt-font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --cwt-radius-sm:   4px;
  --cwt-radius:      8px;
  --cwt-radius-lg:   12px;
  --cwt-radius-xl:   16px;
  --cwt-radius-pill: 9999px;

  --cwt-space-1:  4px;
  --cwt-space-2:  8px;
  --cwt-space-3:  12px;
  --cwt-space-4:  16px;
  --cwt-space-5:  20px;
  --cwt-space-6:  24px;
  --cwt-space-8:  32px;
  --cwt-space-10: 40px;
  --cwt-space-12: 48px;

  --cwt-header-height: 64px;
  --cwt-content-max:   1100px;
}

/* -------------------------------------------------------------------------- */
/* Base                                                                        */
/* -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background-color: var(--cwt-bg);
  color: var(--cwt-text);
}

body {
  margin: 0;
  font-family: var(--cwt-font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--cwt-text);
  background-color: var(--cwt-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--cwt-font-sans);
  color: var(--cwt-text);
  margin: 0 0 var(--cwt-space-4);
  letter-spacing: -0.01em;
  line-height: 1.2;
}
h1 { font-size: 2.25rem; font-weight: 700; letter-spacing: -0.02em; }
h2 { font-size: 1.75rem; font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 600; }
h4 { font-size: 1.05rem; font-weight: 600; }

p { margin: 0 0 var(--cwt-space-4); }

a {
  color: var(--cwt-secondary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
a:hover { color: var(--cwt-secondary-hover); border-bottom-color: currentColor; }
a:focus-visible { outline: none; box-shadow: var(--cwt-focus-ring); border-radius: 2px; }

code, kbd, samp, pre {
  font-family: var(--cwt-font-mono);
  font-size: 0.92em;
}

code {
  background: var(--cwt-bg-muted);
  border: 1px solid var(--cwt-border);
  border-radius: var(--cwt-radius-sm);
  padding: 2px 6px;
}

pre {
  background: var(--cwt-bg-muted);
  border: 1px solid var(--cwt-border);
  border-radius: var(--cwt-radius);
  padding: var(--cwt-space-4);
  overflow: auto;
  margin: 0 0 var(--cwt-space-4);
}
pre code { background: transparent; border: 0; padding: 0; }

hr {
  border: 0;
  border-top: 1px solid var(--cwt-border);
  margin: var(--cwt-space-6) 0;
}

::selection { background: var(--cwt-accent); color: var(--cwt-accent-fg); }

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--cwt-border-strong) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: var(--cwt-border-strong);
  border-radius: var(--cwt-radius-pill);
  border: 2px solid var(--cwt-bg);
}
*::-webkit-scrollbar-thumb:hover { background: var(--cwt-secondary); }

/* -------------------------------------------------------------------------- */
/* Layout helpers                                                              */
/* -------------------------------------------------------------------------- */

.cwt-container {
  width: 100%;
  max-width: var(--cwt-content-max);
  margin: 0 auto;
  padding: 0 var(--cwt-space-6);
}

.cwt-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cwt-bg);
}

.cwt-main {
  flex: 1;
  padding: var(--cwt-space-8) 0 var(--cwt-space-12);
}

/* -------------------------------------------------------------------------- */
/* Header                                                                      */
/* -------------------------------------------------------------------------- */

.cwt-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--cwt-header-height);
  background: var(--cwt-header-bg);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--cwt-header-border);
}

.cwt-header__inner {
  display: flex;
  align-items: center;
  gap: var(--cwt-space-4);
  height: 100%;
  max-width: var(--cwt-content-max);
  margin: 0 auto;
  padding: 0 var(--cwt-space-6);
}

.cwt-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  border: 0;
  color: var(--cwt-text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.cwt-brand:hover { color: var(--cwt-text); border: 0; }

.cwt-brand__mark {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--cwt-blue);
  box-shadow: var(--cwt-shadow-sm);
  flex-shrink: 0;
}
.cwt-brand__mark::before,
.cwt-brand__mark::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 0;
  background: var(--cwt-red);
}
.cwt-brand__mark::before { top: 0; height: 9px; }
.cwt-brand__mark::after  { top: 18px; height: 10px; background: var(--cwt-red); }
.cwt-brand__mark > span {
  position: absolute;
  left: 11px;
  right: 0;
  top: 9px;
  height: 9px;
  background: var(--cwt-white);
}
.cwt-brand__mark > i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 11px;
  background: var(--cwt-blue);
}

/* Search */
.cwt-search {
  position: relative;
  flex: 1;
  max-width: 460px;
  margin: 0 auto;
}
.cwt-search__input {
  width: 100%;
  height: 38px;
  padding: 0 14px 0 38px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--cwt-text);
  background: var(--cwt-bg-muted);
  border: 1px solid var(--cwt-border);
  border-radius: var(--cwt-radius-pill);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.cwt-search__input::placeholder { color: var(--cwt-text-subtle); }
.cwt-search__input:hover { border-color: var(--cwt-border-strong); }
.cwt-search__input:focus {
  border-color: var(--cwt-secondary);
  background: var(--cwt-bg-elevated);
  box-shadow: var(--cwt-focus-ring);
}
.cwt-search__icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--cwt-text-subtle);
  pointer-events: none;
}
.cwt-search__kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--cwt-font-mono);
  font-size: 0.72rem;
  color: var(--cwt-text-subtle);
  background: var(--cwt-bg);
  border: 1px solid var(--cwt-border);
  border-radius: var(--cwt-radius-sm);
  padding: 2px 6px;
  pointer-events: none;
}
.cwt-search__results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: min(70vh, 480px);
  overflow-y: auto;
  background: var(--cwt-bg-elevated);
  border: 1px solid var(--cwt-border);
  border-radius: var(--cwt-radius-lg);
  box-shadow: var(--cwt-shadow-lg);
  padding: var(--cwt-space-2);
  display: none;
}
.cwt-search.is-open .cwt-search__results { display: block; }

.cwt-search__group {
  padding: var(--cwt-space-2) var(--cwt-space-3) var(--cwt-space-1);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cwt-text-subtle);
}
.cwt-search__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--cwt-space-3);
  padding: var(--cwt-space-2) var(--cwt-space-3);
  border-radius: var(--cwt-radius);
  color: var(--cwt-text);
  cursor: pointer;
  border: 0;
  text-decoration: none;
}
.cwt-search__item:hover,
.cwt-search__item.is-active {
  background: var(--cwt-bg-muted);
  color: var(--cwt-text);
}
.cwt-search__item-name { font-weight: 500; }
.cwt-search__item-cat {
  font-size: 0.78rem;
  color: var(--cwt-text-subtle);
  white-space: nowrap;
}
.cwt-search__empty {
  padding: var(--cwt-space-4);
  text-align: center;
  color: var(--cwt-text-subtle);
  font-size: 0.9rem;
}

/* Theme toggle */
.cwt-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: var(--cwt-bg-muted);
  border: 1px solid var(--cwt-border);
  border-radius: var(--cwt-radius-pill);
  color: var(--cwt-text);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
  flex-shrink: 0;
}
.cwt-theme-toggle:hover { background: var(--cwt-bg-subtle); border-color: var(--cwt-border-strong); }
.cwt-theme-toggle:focus-visible { outline: none; box-shadow: var(--cwt-focus-ring); }
.cwt-theme-toggle__icon-sun  { display: none; }
.cwt-theme-toggle__icon-moon { display: block; }
[data-theme="dark"] .cwt-theme-toggle__icon-sun  { display: block; }
[data-theme="dark"] .cwt-theme-toggle__icon-moon { display: none; }

/* -------------------------------------------------------------------------- */
/* Components                                                                  */
/* -------------------------------------------------------------------------- */

.cwt-card {
  background: var(--cwt-bg-elevated);
  border: 1px solid var(--cwt-border);
  border-radius: var(--cwt-radius-lg);
  padding: var(--cwt-space-6);
  box-shadow: var(--cwt-shadow-sm);
}

.cwt-card--accent {
  border-top: 3px solid var(--cwt-accent);
}

.cwt-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cwt-text-muted);
  margin-bottom: var(--cwt-space-3);
}

/* Buttons */
.cwt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1;
  color: var(--cwt-text);
  background: var(--cwt-bg-elevated);
  border: 1px solid var(--cwt-border);
  border-radius: var(--cwt-radius);
  cursor: pointer;
  text-decoration: none;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 60ms ease;
  user-select: none;
}
.cwt-btn:hover { background: var(--cwt-bg-muted); border-color: var(--cwt-border-strong); }
.cwt-btn:active { transform: translateY(1px); }
.cwt-btn:focus-visible { outline: none; box-shadow: var(--cwt-focus-ring); }
.cwt-btn[disabled] { opacity: 0.55; cursor: not-allowed; }

.cwt-btn--primary {
  background: var(--cwt-accent);
  color: var(--cwt-accent-fg);
  border-color: var(--cwt-accent);
}
.cwt-btn--primary:hover {
  background: var(--cwt-accent-hover);
  border-color: var(--cwt-accent-hover);
  color: var(--cwt-accent-fg);
}

.cwt-btn--secondary {
  background: var(--cwt-secondary);
  color: var(--cwt-secondary-fg);
  border-color: var(--cwt-secondary);
}
.cwt-btn--secondary:hover {
  background: var(--cwt-secondary-hover);
  border-color: var(--cwt-secondary-hover);
  color: var(--cwt-secondary-fg);
}

.cwt-btn--ghost {
  background: transparent;
  border-color: transparent;
}
.cwt-btn--ghost:hover { background: var(--cwt-bg-muted); border-color: var(--cwt-border); }

.cwt-btn--sm { height: 32px; padding: 0 12px; font-size: 0.85rem; border-radius: var(--cwt-radius-sm); }
.cwt-btn--lg { height: 48px; padding: 0 22px; font-size: 1rem; }

/* Inputs */
.cwt-input,
.cwt-select,
.cwt-textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--cwt-text);
  background: var(--cwt-bg-elevated);
  border: 1px solid var(--cwt-border);
  border-radius: var(--cwt-radius);
  padding: 10px 12px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.cwt-input:hover,
.cwt-select:hover,
.cwt-textarea:hover { border-color: var(--cwt-border-strong); }
.cwt-input:focus,
.cwt-select:focus,
.cwt-textarea:focus {
  border-color: var(--cwt-secondary);
  box-shadow: var(--cwt-focus-ring);
}
.cwt-input::placeholder,
.cwt-textarea::placeholder { color: var(--cwt-text-subtle); }
.cwt-textarea { min-height: 120px; resize: vertical; font-family: var(--cwt-font-mono); }

.cwt-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cwt-text-muted);
  margin-bottom: var(--cwt-space-2);
}

/* Tags / pills */
.cwt-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--cwt-radius-pill);
  background: var(--cwt-bg-muted);
  color: var(--cwt-text-muted);
  border: 1px solid var(--cwt-border);
}
.cwt-tag--red    { background: var(--cwt-accent-soft);    color: var(--cwt-accent);    border-color: transparent; }
.cwt-tag--blue   { background: var(--cwt-secondary-soft); color: var(--cwt-secondary); border-color: transparent; }
.cwt-tag--success{ background: var(--cwt-success-soft);   color: var(--cwt-success);   border-color: transparent; }
.cwt-tag--warning{ background: var(--cwt-warning-soft);   color: var(--cwt-warning);   border-color: transparent; }
.cwt-tag--error  { background: var(--cwt-error-soft);     color: var(--cwt-error);     border-color: transparent; }

/* Footer */
.cwt-footer {
  border-top: 1px solid var(--cwt-border);
  padding: var(--cwt-space-8) 0;
  color: var(--cwt-text-muted);
  font-size: 0.88rem;
  background: var(--cwt-bg);
}
.cwt-footer__stripes {
  height: 4px;
  background: linear-gradient(
    to right,
    var(--cwt-red) 0%, var(--cwt-red) 33.333%,
    var(--cwt-white) 33.333%, var(--cwt-white) 66.666%,
    var(--cwt-blue) 66.666%, var(--cwt-blue) 100%
  );
}

/* Utility */
.cwt-stack    { display: flex; flex-direction: column; gap: var(--cwt-space-4); }
.cwt-row      { display: flex; align-items: center; gap: var(--cwt-space-3); flex-wrap: wrap; }
.cwt-grid     { display: grid; gap: var(--cwt-space-4); }
.cwt-grid-2   { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.cwt-grid-3   { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.cwt-muted    { color: var(--cwt-text-muted); }
.cwt-mono     { font-family: var(--cwt-font-mono); }
.cwt-spacer   { flex: 1; }
.cwt-hide-sm  { }
@media (max-width: 720px) {
  .cwt-hide-sm { display: none !important; }
  .cwt-search { max-width: none; }
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.45rem; }
  .cwt-main { padding: var(--cwt-space-6) 0; }
}

/* -------------------------------------------------------------------------- */
/* Tailwind utility overrides for dark mode                                    */
/*                                                                             */
/* assets/tailwind-theme.js remaps every Tailwind color family that maps onto  */
/* a token (slate, gray, indigo, blue, etc.). It cannot remap the standalone   */
/* `white` and `black` classes because some pages use them for printable       */
/* "paper" surfaces that must stay literal white-on-black to print correctly.  */
/* So we override only when [data-theme="dark"] is active, and exempt anything */
/* inside a .print-only / .print-preview / [data-print] container.             */
/* -------------------------------------------------------------------------- */

[data-theme="dark"] .bg-white     { background-color: var(--cwt-bg-elevated); }
[data-theme="dark"] .text-black   { color: var(--cwt-text); }
[data-theme="dark"] .border-white { border-color: var(--cwt-border); }
[data-theme="dark"] .divide-white > :where(:not([hidden])) ~ :where(:not([hidden])) { border-color: var(--cwt-border); }

/* Anything in a print-preview / print-only surface is the literal "page" the
   user will print. Always keep it true white-on-black, regardless of theme. */
.print-only,
.print-preview,
[data-print] {
  background-color: #ffffff;
  color: #111111;
}
.print-only .bg-white,
.print-preview .bg-white,
[data-print] .bg-white,
.print-only.bg-white,
.print-preview.bg-white,
[data-print].bg-white {
  background-color: #ffffff !important;
}
.print-only .text-black,
.print-preview .text-black,
[data-print] .text-black,
.print-only.text-black,
.print-preview.text-black,
[data-print].text-black {
  color: #111111 !important;
}

/* -------------------------------------------------------------------------- */
/* Tailwind text-utility overrides — readable text in both modes              */
/*                                                                             */
/* assets/tailwind-theme.js remaps every gray-family color to a *surface*      */
/* token (so bg-slate-900 etc. work as backgrounds). But the same color value  */
/* compiled for `text-slate-100` would render text the same shade as the page  */
/* surface — invisible. These rules force text-{family}-{shade} to a readable  */
/* token from our scale instead, regardless of whether the active theme is     */
/* light or dark.                                                              */
/*                                                                             */
/* Attribute selectors with [class*=" text-slate-100"] also catch hover/group  */
/* variants like .hover\:text-slate-100, since the element class string still  */
/* contains the shade name as a substring.                                     */
/* -------------------------------------------------------------------------- */

[class*="text-slate-50"], [class*="text-gray-50"], [class*="text-zinc-50"], [class*="text-neutral-50"], [class*="text-stone-50"],
[class*="text-slate-100"], [class*="text-gray-100"], [class*="text-zinc-100"], [class*="text-neutral-100"], [class*="text-stone-100"],
[class*="text-slate-200"], [class*="text-gray-200"], [class*="text-zinc-200"], [class*="text-neutral-200"], [class*="text-stone-200"]
{ color: var(--cwt-text) !important; }

[class*="text-slate-300"], [class*="text-gray-300"], [class*="text-zinc-300"], [class*="text-neutral-300"], [class*="text-stone-300"]
{ color: var(--cwt-text-muted) !important; }

[class*="text-slate-400"], [class*="text-gray-400"], [class*="text-zinc-400"], [class*="text-neutral-400"], [class*="text-stone-400"]
{ color: var(--cwt-text-subtle) !important; }

[class*="text-slate-500"], [class*="text-gray-500"], [class*="text-zinc-500"], [class*="text-neutral-500"], [class*="text-stone-500"]
{ color: var(--cwt-text-muted) !important; }

[class*="text-slate-600"], [class*="text-gray-600"], [class*="text-zinc-600"], [class*="text-neutral-600"], [class*="text-stone-600"]
{ color: var(--cwt-text-muted) !important; }

[class*="text-slate-700"], [class*="text-gray-700"], [class*="text-zinc-700"], [class*="text-neutral-700"], [class*="text-stone-700"],
[class*="text-slate-800"], [class*="text-gray-800"], [class*="text-zinc-800"], [class*="text-neutral-800"], [class*="text-stone-800"],
[class*="text-slate-900"], [class*="text-gray-900"], [class*="text-zinc-900"], [class*="text-neutral-900"], [class*="text-stone-900"],
[class*="text-slate-950"], [class*="text-gray-950"], [class*="text-zinc-950"], [class*="text-neutral-950"], [class*="text-stone-950"]
{ color: var(--cwt-text) !important; }

/* Hover-on-white still needs to read; let it inherit. */
[class*="hover:text-white"]:hover { color: var(--cwt-text) !important; }

/* Print preview text colors must stay literal — re-assert here so the !important
   overrides above don't hijack a printed page's text. */
.print-only [class*="text-slate-"],
.print-only [class*="text-gray-"],
.print-preview [class*="text-slate-"],
.print-preview [class*="text-gray-"],
[data-print] [class*="text-slate-"],
[data-print] [class*="text-gray-"] {
  color: inherit !important;
}
