/* IntellCRE Models — shared design system.
 * One stylesheet for single model pages and the archive/facet grids, so the
 * two can't drift. Previously this lived inline in each post's content, which
 * meant archives inherited none of it.
 */
:root{
    --bg:#FFFFFF; --alt:#F7F8FC; --ink:#1a1a2e; --ink-2:#4a4a6a; --ink-3:#8888aa;
    --rule:#e4e4f0; --brand:#5B5BF6; --brand-soft:#EEEDFE; --brand-dark:#4444d4;
    --ok:#0F766E; --ok-soft:#DEF1EE;
    --sans:"Inter",system-ui,-apple-system,"Segoe UI",sans-serif;
    --mono:"Inter",system-ui,-apple-system,"Segoe UI",sans-serif;
    --code:ui-monospace,"IBM Plex Mono",Menlo,monospace;
  }
  /* DEV-5239 (2026-11-05): no OS-dark palette here on purpose. intellcre.com is
     light-only, and the site-wide Customizer CSS (post 69, the 2026-09-09 /mcp/ fix)
     pins the light palette for prefers-color-scheme:dark with !important. That block
     sets --ink but NOT --alt, so an OS-dark palette here only half-applied: the .dl
     panel went dark (#171826) while the headings stayed forced near-black (#12141C),
     which is the invisible text Ozon reported on 11/2. The explicit [data-theme="dark"]
     opt-in below is kept for a future in-page toggle; nothing sets that attribute. */
  :root[data-theme="dark"]{
    --bg:#101018; --alt:#171826; --ink:#E9EAF4; --ink-2:#A8AEC4; --ink-3:#787E96;
    --rule:#272A3A; --brand:#8C8CFF; --brand-soft:#1D1F42; --brand-dark:#A5A5FF;
    --ok:#5EC5B8; --ok-soft:#12302C;}

  /* Everything below is scoped to #main-content. Bare body/h2/a/footer rules
     restyled the Divi header and site footer (wrong footer font, an extra
     rule line, recolored links). :where() adds no specificity, so the cascade
     inside the content area is unchanged. */
  :where(#main-content) *,:where(#main-content) *::before,:where(#main-content) *::after{box-sizing:border-box;}
  :where(#main-content){background:var(--bg);color:var(--ink);font-family:var(--sans);
       font-size:17px;line-height:1.68;-webkit-font-smoothing:antialiased;}
  :where(#main-content) .wrap{max-width:1000px;margin:0 auto;padding:0 24px 90px;}
  :where(#main-content) .col{max-width:70ch;}

  :where(#main-content) .breadcrumb{font-size:13.5px;color:var(--ink-3);padding:28px 0 20px;}
  /* DEV-5239 follow-up (2026-11-05): the Divi header is position:fixed at 95px tall and
     these templates render at the very top of #main-content, so the breadcrumb sat
     entirely behind it (top:0) and the hub h1 was sliced in half. Real selector, not
     :where(), because :where() is zero-specificity and the theme would win. */
  #main-content .breadcrumb{padding-top:123px;}
  :where(#main-content) .breadcrumb a{color:var(--ink-3);text-decoration:none;}
  :where(#main-content) .breadcrumb a:hover{color:var(--brand);}
  :where(#main-content) .badge{display:inline-block;font-family:var(--mono);font-size:10.5px;font-weight:500;
    letter-spacing:.12em;text-transform:uppercase;color:var(--brand);
    background:var(--brand-soft);padding:4px 10px;border-radius:3px;margin-bottom:16px;}
  :where(#main-content) h1{font-size:clamp(31px,4.6vw,45px);font-weight:700;letter-spacing:-.025em;
     line-height:1.1;margin:0 0 16px;text-wrap:balance;max-width:20ch;}
  :where(#main-content) .sub{font-size:19.5px;color:var(--ink-2);max-width:62ch;margin:0 0 22px;}
  :where(#main-content) .meta{font-family:var(--mono);font-size:12.5px;color:var(--ink-3);
        display:flex;flex-wrap:wrap;gap:8px 22px;padding-bottom:34px;border-bottom:1px solid var(--rule);}

  :where(#main-content) h2{font-size:26px;font-weight:700;letter-spacing:-.018em;margin:52px 0 12px;text-wrap:balance;}
  :where(#main-content) h3{font-size:17.5px;font-weight:700;margin:28px 0 8px;}
  :where(#main-content) p{margin:0 0 16px;}
  :where(#main-content) ul,:where(#main-content) ol{margin:0 0 16px;padding-left:22px;max-width:70ch;}
  :where(#main-content) li{margin-bottom:8px;}
  :where(#main-content) li::marker{color:var(--ink-3);}
  :where(#main-content) a{color:var(--brand);}
  :where(#main-content) strong{font-weight:700;}
  :where(#main-content) code{font-family:var(--code);font-size:.87em;background:var(--alt);
       border:1px solid var(--rule);border-radius:3px;padding:1px 5px;}

  :where(#main-content) .takeaways{background:var(--alt);border:1px solid var(--rule);border-radius:8px;
             padding:22px 26px;margin:30px 0;max-width:70ch;}
  :where(#main-content) .takeaways h4{font-family:var(--mono);font-size:11px;font-weight:500;letter-spacing:.14em;
    text-transform:uppercase;color:var(--ink-3);margin:0 0 12px;}
  :where(#main-content) .takeaways ul{margin:0;padding-left:20px;}

  :where(#main-content) .scroll{overflow-x:auto;margin:0 0 20px;}
  :where(#main-content) table{border-collapse:collapse;width:100%;font-size:15px;}
  :where(#main-content) th{font-family:var(--mono);font-size:10.5px;font-weight:500;letter-spacing:.1em;
     text-transform:uppercase;color:var(--ink-3);text-align:left;
     padding:0 16px 9px 0;border-bottom:1px solid var(--ink-3);white-space:nowrap;}
  :where(#main-content) td{padding:11px 16px 11px 0;border-bottom:1px solid var(--rule);vertical-align:top;color:var(--ink-2);}
  :where(#main-content) td:first-child{color:var(--ink);font-weight:500;}
  :where(#main-content) tr:last-child td{border-bottom:none;}

  :where(#main-content) .callout{border-left:3px solid var(--brand);background:var(--brand-soft);
    padding:18px 22px;border-radius:0 6px 6px 0;margin:0 0 22px;max-width:70ch;}
  :where(#main-content) .callout p:last-child{margin-bottom:0;}
  :where(#main-content) .callout.ok{border-left-color:var(--ok);background:var(--ok-soft);}
  :where(#main-content) .callout h4{margin:0 0 8px;font-size:16px;}

  :where(#main-content) /* download block */
  .dl{border:1px solid var(--rule);border-radius:10px;padding:28px;margin:34px 0;
      background:var(--alt);max-width:70ch;}
  :where(#main-content) .dl h3{margin:0 0 6px;font-size:21px;}
  :where(#main-content) .dl .lede{color:var(--ink-2);font-size:15.5px;margin:0 0 18px;}
  :where(#main-content) .grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:10px;}
  :where(#main-content) .dl input,:where(#main-content) .dl select{width:100%;padding:11px 13px;border:1px solid var(--rule);
    border-radius:6px;font-family:var(--sans);font-size:15px;background:var(--bg);color:var(--ink);
    margin-bottom:10px;}
  :where(#main-content) .dl input:focus,:where(#main-content) .dl select:focus{outline:2px solid var(--brand);outline-offset:1px;border-color:transparent;}
  :where(#main-content) .btn{display:inline-block;background:var(--brand);color:#fff;border:none;border-radius:6px;
    padding:13px 22px;font-family:var(--sans);font-size:15.5px;font-weight:700;cursor:pointer;
    text-decoration:none;}
  :where(#main-content) .btn:hover{background:var(--brand-dark);}
  :where(#main-content) .fine{font-size:13px;color:var(--ink-3);margin:10px 0 0;}

  :where(#main-content) .prompt{font-family:var(--code);font-size:14px;background:var(--alt);
    border:1px solid var(--rule);border-left:3px solid var(--brand);
    border-radius:0 6px 6px 0;padding:14px 18px;margin:0 0 18px;max-width:70ch;color:var(--ink);}

  :where(#main-content) details{border-bottom:1px solid var(--rule);padding:14px 0;max-width:70ch;}
  :where(#main-content) summary{cursor:pointer;font-weight:700;font-size:16.5px;list-style:none;}
  :where(#main-content) summary::-webkit-details-marker{display:none;}
  :where(#main-content) summary::before{content:"+";color:var(--brand);font-family:var(--mono);margin-right:10px;}
  :where(#main-content) details[open] summary::before{content:"−";}
  :where(#main-content) details p{margin:10px 0 0;color:var(--ink-2);}

  :where(#main-content) footer{margin-top:56px;padding-top:22px;border-top:1px solid var(--rule);
    font-family:var(--mono);font-size:12.5px;color:var(--ink-3);}
  @media (max-width:640px){:where(#main-content) .grid2{grid-template-columns:1fr;}}
  @media (prefers-reduced-motion:reduce){:where(#main-content) *{animation:none!important;transition:none!important;}}

/* ── Archive / facet grids ─────────────────────────────────────── */
.icre-archive{max-width:1000px;margin:0 auto;padding:0 24px 90px;}
.icre-archive__head{padding:128px 0 26px;border-bottom:1px solid var(--rule);margin-bottom:34px;}
.icre-archive h1{font-size:clamp(30px,4.4vw,44px);font-weight:700;letter-spacing:-.025em;
  line-height:1.1;margin:0 0 14px;max-width:22ch;}
.icre-archive__lede{font-size:19px;color:var(--ink-2);max-width:62ch;margin:0 0 20px;}
.icre-archive__count{font-family:var(--mono);font-size:12.5px;color:var(--ink-3);}

.icre-filters{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 30px;}
.icre-filters a{display:inline-block;font-size:14px;text-decoration:none;color:var(--ink-2);
  background:var(--alt);border:1px solid var(--rule);border-radius:999px;padding:6px 15px;}
.icre-filters a:hover{border-color:var(--brand);color:var(--brand);}
.icre-filters a[aria-current="page"]{background:var(--brand);border-color:var(--brand);color:#fff;}

/* max-width:none is load-bearing: the generic `ul{max-width:70ch}` rule above
   keeps body copy readable, but silently clamped this grid to ~632px and
   forced a single column. Class beats element selector only for properties
   the class actually declares. */
.icre-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:20px;
  list-style:none;margin:0;padding:0;max-width:none;}
.icre-grid > li{margin:0;max-width:none;}
.icre-card{display:flex;flex-direction:column;gap:10px;background:var(--bg);
  border:1px solid var(--rule);border-radius:12px;padding:24px;text-decoration:none;color:inherit;
  transition:box-shadow .15s,transform .15s,border-color .15s;}
.icre-card:hover{box-shadow:0 8px 28px rgba(91,91,246,.10);transform:translateY(-2px);
  border-color:var(--brand);}
.icre-card__tags{display:flex;flex-wrap:wrap;gap:6px;}
.icre-card__tag{font-family:var(--mono);font-size:10px;font-weight:500;letter-spacing:.1em;
  text-transform:uppercase;color:var(--brand);background:var(--brand-soft);
  padding:3px 8px;border-radius:3px;}
.icre-card h2{font-size:19px;font-weight:700;letter-spacing:-.012em;margin:0;line-height:1.25;}
.icre-card p{font-size:16px;line-height:1.55;color:var(--ink-2);margin:0;}
.icre-card__meta{margin-top:auto;padding-top:10px;font-family:var(--mono);font-size:11.5px;
  color:var(--ink-3);display:flex;flex-wrap:wrap;gap:6px 14px;}
.icre-card__cta{font-size:15.5px;font-weight:700;color:var(--brand);}
.icre-more{display:block;margin:28px auto 0;}
.icre-more[hidden],.icre-grid > li[hidden]{display:none;}

.icre-empty{color:var(--ink-2);padding:30px 0;}
@media (max-width:640px){.icre-grid{grid-template-columns:1fr;}.icre-archive{padding:0 20px 70px;}}


/* ── Winning the cascade against the theme ──────────────────────
   Divi sets heading font-family at a higher specificity than a bare element
   selector, so headings rendered in the theme face instead of DM Sans. The
   body class added by the plugin scopes ours above it without !important,
   and #main-content keeps it off the theme header and footer. */
.icre-models-screen #main-content h1,
.icre-models-screen #main-content h2,
.icre-models-screen #main-content h3,
.icre-models-screen #main-content h4,
.icre-models-screen #main-content .icre-card h2{font-family:var(--sans);color:var(--ink);}
.icre-models-screen #main-content .icre-archive__count,
.icre-models-screen #main-content .icre-card__meta,
.icre-models-screen #main-content .icre-card__tag,
.icre-models-screen #main-content .meta,
.icre-models-screen #main-content .prompt{font-family:var(--mono);}
.icre-single{max-width:none;}
.icre-single #left-area,.icre-single .et_post_meta_wrapper{padding:0;}

/* Secondary download buttons and the row they sit in */
:where(#main-content) .btnrow{display:flex;flex-wrap:wrap;gap:10px;margin:0 0 6px;}
:where(#main-content) .btn--ghost{background:transparent;color:var(--brand);border:1.5px solid var(--brand);}
:where(#main-content) .btn--ghost:hover{background:var(--brand-soft);color:var(--brand-dark);}
.icre-models-screen #main-content .btn{color:#fff;}
.icre-models-screen #main-content .btn--ghost{color:var(--brand);}
:where(#main-content) .prompt-block{font-family:var(--mono);font-size:13px;white-space:pre-wrap;background:var(--alt);
  border:1px solid var(--rule);border-radius:6px;padding:16px 18px;margin:0 0 18px;max-width:70ch;
  overflow-x:auto;color:var(--ink);}
