/* ApexCMS v2.1.208 — Premium Unified Design System
   Scope: public tool pages only. No DOM restructuring or tool behavior changes. */

body[data-apex-tool-slug][data-apex-design-system="2.1.208"]{
  --apx208-accent:var(--a1,var(--accent-1,var(--primary,#2563eb)));
  --apx208-accent-2:var(--a2,var(--accent-2,#7c3aed));
  --apx208-page:#f6f8fc;
  --apx208-surface:rgba(255,255,255,.88);
  --apx208-surface-solid:#fff;
  --apx208-surface-soft:#f8fafc;
  --apx208-line:rgba(15,23,42,.11);
  --apx208-line-strong:rgba(15,23,42,.18);
  --apx208-text:#122033;
  --apx208-muted:#64748b;
  --apx208-shadow:0 18px 55px rgba(15,23,42,.08);
  --apx208-shadow-hover:0 22px 65px rgba(15,23,42,.12);
  --apx208-radius-xl:24px;
  --apx208-radius-lg:18px;
  --apx208-radius-md:14px;
  --apx208-control-h:46px;
  --apx208-focus:0 0 0 4px color-mix(in srgb,var(--apx208-accent) 16%,transparent);
  background-color:var(--apx208-page);
  color:var(--apx208-text);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}

:root[data-theme="dark"] body[data-apex-tool-slug][data-apex-design-system="2.1.208"]{
  --apx208-page:#07111f;
  --apx208-surface:rgba(13,29,49,.88);
  --apx208-surface-solid:#0d1d31;
  --apx208-surface-soft:#10243b;
  --apx208-line:rgba(148,184,216,.15);
  --apx208-line-strong:rgba(148,184,216,.24);
  --apx208-text:#eef6ff;
  --apx208-muted:#9bb0c4;
  --apx208-shadow:0 20px 60px rgba(0,0,0,.24);
  --apx208-shadow-hover:0 26px 72px rgba(0,0,0,.34);
  color-scheme:dark;
}

/* Typography and page rhythm: preserve each tool's sizes while aligning tone. */
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(h1,h2,h3,h4){
  font-family:"Space Grotesk",Inter,ui-sans-serif,system-ui,sans-serif;
  text-wrap:balance;
}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(p,li,dd){text-wrap:pretty}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(main,.p3-body) {scroll-margin-top:118px}

/* Site-wide header/navigation bridge receives one consistent SaaS treatment. */
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] header.apx204-site-header{
  border:1px solid var(--apx208-line)!important;
  background:color-mix(in srgb,var(--apx208-surface-solid) 88%,transparent)!important;
  box-shadow:0 12px 38px rgba(15,23,42,.08)!important;
  backdrop-filter:blur(20px) saturate(1.18)!important;
  -webkit-backdrop-filter:blur(20px) saturate(1.18)!important;
}
:root[data-theme="dark"] body[data-apex-tool-slug][data-apex-design-system="2.1.208"] header.apx204-site-header{
  box-shadow:0 14px 46px rgba(0,0,0,.25)!important;
}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] .apx204-site-nav{
  border-color:var(--apx208-line)!important;
  background:color-mix(in srgb,var(--apx208-surface-solid) 92%,transparent)!important;
  box-shadow:0 10px 32px rgba(15,23,42,.055)!important;
}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(.apx204-nav-link,.apx204-nav-search){
  min-height:42px!important;
  border-radius:12px!important;
  font-weight:700!important;
}

/* Shared content surfaces. Restrict to outer card/panel/workspace tokens so
   nested headings and component internals keep their original layout. */
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(section,article,aside,div)[class$="-card"],
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(section,article,aside,div)[class$="-panel"],
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(section,article,aside,div)[class$="-workspace"],
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(section,article,aside,div)[class$="-result"],
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(.box,.workspace,.preview-shell,.related-card,.p3-section,.p3-workspace,.p3-result){
  border-radius:var(--apx208-radius-xl)!important;
  border-color:var(--apx208-line)!important;
  box-shadow:var(--apx208-shadow)!important;
}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(section,article,aside,div)[class$="-card"],
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(section,article,aside,div)[class$="-panel"],
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(.box,.workspace,.preview-shell,.related-card,.p3-section,.p3-workspace){
  background-color:var(--apx208-surface)!important;
}
:root[data-theme="dark"] body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(section,article,aside,div)[class$="-card"],
:root[data-theme="dark"] body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(section,article,aside,div)[class$="-panel"],
:root[data-theme="dark"] body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(.box,.workspace,.preview-shell,.related-card,.p3-section,.p3-workspace){
  background-color:color-mix(in srgb,var(--apx208-surface-solid) 92%,transparent)!important;
}

/* Gentle hover lift only where the component is already interactive. */
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(a,button)[class$="-card"]:hover,
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] a.related-card:hover{
  transform:translateY(-3px);
  box-shadow:var(--apx208-shadow-hover)!important;
}

/* Buttons and actions: same control height/radius without overwriting each tool's
   primary accent/gradient or semantic danger/success colors. */
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(button,[role="button"],a.primary,a.secondary,.p3-btn,a[class$="-btn"],button[class$="-btn"],a[class$="-button"],button[class$="-button"]){
  min-height:var(--apx208-control-h);
  font-family:Inter,ui-sans-serif,system-ui,sans-serif;
  font-weight:750;
  letter-spacing:-.01em;
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease,background-color .18s ease,color .18s ease;
}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(a.primary,a.secondary,.p3-btn,a[class$="-btn"],button[class$="-btn"],a[class$="-button"],button[class$="-button"],button:not(.round):not([aria-label*="close" i]):not([aria-label*="remove" i]):not([aria-label*="theme" i]):not([aria-label*="back to top" i]):not([aria-label*="scroll to top" i])){
  border-radius:var(--apx208-radius-md)!important;
}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(button,[role="button"],a.primary,a.secondary,.p3-btn,a[class$="-btn"],button[class$="-btn"],a[class$="-button"],button[class$="-button"]):not(:disabled):hover{
  transform:translateY(-1px);
}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(button,[role="button"],a,input,select,textarea,summary):focus-visible{
  outline:2px solid color-mix(in srgb,var(--apx208-accent) 74%,white)!important;
  outline-offset:2px!important;
  box-shadow:var(--apx208-focus)!important;
}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(button,input,select,textarea):disabled{cursor:not-allowed;opacity:.58}

/* Form controls: normalize touch target, border and focus behavior. */
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),select,textarea){
  border-radius:var(--apx208-radius-md)!important;
  border-color:var(--apx208-line-strong)!important;
  background-color:var(--apx208-surface-solid)!important;
  color:var(--apx208-text)!important;
  font-family:Inter,ui-sans-serif,system-ui,sans-serif!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.18);
}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),select){
  min-height:var(--apx208-control-h);
}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] textarea{min-height:112px}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(input,textarea)::placeholder{color:var(--apx208-muted)!important;opacity:.82}
:root[data-theme="dark"] body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),select,textarea){
  background-color:var(--apx208-surface-soft)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.025);
}

/* Results/outputs get a recognisable professional report surface. */
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(section,article,aside,div)[class$="-result"],
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(section,article,aside,div)[class$="-output"],
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(.process-result,.p3-result){
  border:1px solid var(--apx208-line)!important;
  background:linear-gradient(180deg,color-mix(in srgb,var(--apx208-surface-solid) 96%,var(--apx208-accent) 4%),var(--apx208-surface-solid))!important;
  color:var(--apx208-text)!important;
}
:root[data-theme="dark"] body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(section,article,aside,div)[class$="-result"],
:root[data-theme="dark"] body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(section,article,aside,div)[class$="-output"],
:root[data-theme="dark"] body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(.process-result,.p3-result){
  background:linear-gradient(180deg,color-mix(in srgb,var(--apx208-surface-solid) 91%,var(--apx208-accent) 9%),var(--apx208-surface-solid))!important;
}

/* Tool/section icon holders share shape and visual depth. Never style the
   Font Awesome <i> itself, which protects icon metrics and glyph alignment. */
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(div,span)[class$="-icon"],
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(.tool-icon,.upload-zone-icon,.p3-icon){
  border-radius:18px!important;
  border-color:var(--apx208-line)!important;
  box-shadow:0 10px 28px color-mix(in srgb,var(--apx208-accent) 10%,transparent)!important;
}

/* Tables and code/report blocks finish the SaaS visual language without changing data. */
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] table{border-collapse:separate;border-spacing:0;border:1px solid var(--apx208-line);border-radius:16px;overflow:hidden;background:var(--apx208-surface-solid)}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(th,td){border-color:var(--apx208-line)!important}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] th{background:color-mix(in srgb,var(--apx208-surface-soft) 92%,var(--apx208-accent) 8%);font-weight:800}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(pre,code,kbd){font-family:"SFMono-Regular",Consolas,"Liberation Mono",monospace}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] pre{border-radius:16px;border-color:var(--apx208-line)!important}

/* Shared footer refinement only; content remains Dashboard-authoritative. */
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] .apx204-site-footer{
  border-color:var(--apx208-line)!important;
}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] .apx204-footer-column :where(a),
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] .apx204-social-link{
  transition:color .18s ease,transform .18s ease,border-color .18s ease,background-color .18s ease!important;
}
body[data-apex-tool-slug][data-apex-design-system="2.1.208"] .apx204-footer-column a:hover{color:var(--apx208-accent)!important}

/* Responsive rhythm: preserve custom grids while tightening shared surface/control geometry. */
@media(max-width:760px){
  body[data-apex-tool-slug][data-apex-design-system="2.1.208"]{--apx208-radius-xl:20px;--apx208-radius-lg:16px;--apx208-control-h:44px}
  body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(section,article,aside,div)[class$="-card"],
  body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(section,article,aside,div)[class$="-panel"],
  body[data-apex-tool-slug][data-apex-design-system="2.1.208"] :where(.box,.workspace,.p3-section,.p3-workspace){box-shadow:0 12px 38px rgba(15,23,42,.065)!important}
}
@media(max-width:520px){
  body[data-apex-tool-slug][data-apex-design-system="2.1.208"]{--apx208-radius-xl:18px;--apx208-radius-md:12px}
  body[data-apex-tool-slug][data-apex-design-system="2.1.208"] .apx204-site-nav{border-radius:16px!important}
}
@media(prefers-reduced-motion:reduce){
  body[data-apex-tool-slug][data-apex-design-system="2.1.208"] *,
  body[data-apex-tool-slug][data-apex-design-system="2.1.208"] *::before,
  body[data-apex-tool-slug][data-apex-design-system="2.1.208"] *::after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important}
}
