/* CEOACC Clarity • Theme and layout only. No endpoint, data, or payment changes. */
:root {
  --cc-canvas:#f3f6fc;
  --cc-surface:#fff;
  --cc-raised:#f6f8fc;
  --cc-ink:#18283f;
  --cc-muted:#4e607a;
  --cc-accent:#1d56a7;
  --cc-active:#e6efff;
  --cc-line:#ced9ea;
  --cc-control:#8495af;
  --cc-focus:#2058b3;
  --cc-focus-halo:#fff;
  --cc-success:#126346;
  --cc-danger:#9b263b;
  --cc-pad:clamp(.875rem, 1.65vw, 1.75rem);
  --cc-radius:.875rem;
  --cc-scroll-top:6rem;
}
:is(html.cg-dark,html[data-theme="dark"],html:has(body:is(.dark,.dark-mode,.color-dark))) {
  --cc-canvas:#101823;
  --cc-surface:#1a2637;
  --cc-raised:#202e42;
  --cc-ink:#edf4ff;
  --cc-muted:#b3c1d7;
  --cc-accent:#a8cbff;
  --cc-active:#243b5c;
  --cc-line:#3f5571;
  --cc-control:#7892b4;
  --cc-focus:#b5d5ff;
  --cc-focus-halo:#142035;
  --cc-success:#9ce6c4;
  --cc-danger:#ffb0be;
  color-scheme:dark;
}
:root:not(.cg-dark):not([data-theme="dark"]):not(:has(body:is(.dark,.dark-mode,.color-dark))) { color-scheme:light; }
/* Preserve the existing navigation system, funding colors and status styles. */
html[data-cg-surface] body :is(.content-page,.content-wrapper) {
  min-inline-size:0;
  scroll-margin-top:var(--cc-scroll-top);
}
html[data-cg-surface] body :is(.content-page,.content-wrapper) > .container-fluid { min-inline-size:0; }
html[data-cg-surface] body :is(.content-page,.content-wrapper) :is(.card,.modal-content) { min-inline-size:0; }
html[data-cg-surface] body :is(.content-page,.content-wrapper) :is(.card-title,h1,h2) { overflow-wrap:anywhere; }
html[data-cg-surface] body :is(.content-page,.content-wrapper) :is(h1,h2) { text-wrap:pretty; }
html[data-cg-surface] body :is(.content-page,.content-wrapper) :is(.content-header,.order-filter-panel,.tool-nav-wrap) { max-inline-size:100%; }
html[data-cg-surface] body :is(.content-page,.content-wrapper) :is(.form-text,.text-muted:not(.badge),.ctools-privacy) { color:var(--cc-muted)!important; }
html[data-cg-surface] body :is(.content-page,.content-wrapper,.modal) :is(input,textarea).form-control::placeholder { color:var(--cc-muted)!important; opacity:1; }
html[data-cg-surface] body :is(.content-page,.content-wrapper,.modal) :is(.form-control,.custom-select) { max-inline-size:100%; }
html[data-cg-surface] body :is(.content-page,.content-wrapper) :is(.table-responsive,.dataTables_scrollBody) { min-inline-size:0; max-inline-size:100%; }
html[data-cg-surface] body .ceo-clarity-scroll:focus-visible { outline-offset:-3px!important; }
html[data-cg-surface] body :is(.iq-sidebar-menu,.main-sidebar,.tool-nav-wrap) a[aria-current="page"] {
  box-shadow:inset 3px 0 0 var(--cc-accent);
}
html[data-cg-surface] body :is(.iq-top-navbar,.main-header) { box-shadow:0 1px 0 var(--cc-line),0 4px 14px rgba(24,40,63,.06); }
html[data-cg-surface] body :is(.content-page,.content-wrapper) .form-control:not([readonly]):not(:disabled) {
  border-color:var(--cc-control);
}
html[data-cg-surface] body :is(.content-page,.content-wrapper) .btn-outline-secondary:not(:hover):not(:active):not(.active):not(:disabled) {
  color:var(--cc-muted)!important;
  border-color:var(--cc-control)!important;
}
html[data-cg-surface] body :is(a,button,input:not([type="hidden"]),textarea,select,summary,[tabindex]):focus-visible {
  outline:2px solid var(--cc-focus)!important;
  outline-offset:2px!important;
  box-shadow:0 0 0 1px var(--cc-focus-halo)!important;
  scroll-margin-block-start:var(--cc-scroll-top);
  scroll-margin-block-end:3rem;
}
html[data-cg-surface] body #dark-mode:focus-visible + label {
  outline:2px solid var(--cc-focus)!important;
  outline-offset:3px;
}
.ceo-clarity-skip {
  position:fixed; inset:0 auto auto 0; z-index:2147480000;
  padding:.7rem 1rem; transform:translateY(-180%);
  background:var(--cc-surface); color:var(--cc-accent);
  border:2px solid var(--cc-focus); border-radius:0 0 var(--cc-radius) 0;
  font-weight:700; text-decoration:underline;
}
.ceo-clarity-skip:focus { transform:none; }
html[data-cg-surface] body .ctools-shell :is(.ctools-intro,.tool-nav-wrap,.tab-content>.tab-pane>.card) {
  border-radius:var(--cc-radius);
}
html[data-cg-surface] body .ctools-shell .tool-nav-item { gap:.4rem; min-block-size:2.5rem; }
html[data-cg-surface] body .ctools-shell .tool-nav-item.active {
  box-shadow:inset 0 -2px 0 var(--cc-accent);
}
/* Tools historically used .bg-white on read-only results even in dark mode. */
html[data-cg-surface] body .ctools-shell :is(textarea.form-control.bg-white,textarea.form-control[readonly]) {
  color:var(--cc-ink)!important;
  background:var(--cc-raised)!important;
  border-color:var(--cc-control)!important;
  opacity:1;
}
:is(html.cg-dark,html[data-theme="dark"],html:has(body:is(.dark,.dark-mode,.color-dark)))[data-cg-surface] body .ctools-shell .card:has(textarea[readonly]) {
  background:var(--cc-surface)!important;
  color:var(--cc-ink);
}
:is(html.cg-dark,html[data-theme="dark"],html:has(body:is(.dark,.dark-mode,.color-dark)))[data-cg-surface] body .ctools-shell :is(h5,h6,.btn-outline-secondary):not(:hover):not(.active).text-secondary {
  color:var(--cc-muted)!important;
}
:is(html.cg-dark,html[data-theme="dark"],html:has(body:is(.dark,.dark-mode,.color-dark)))[data-cg-surface] body .ctools-shell :is(h5,h6).text-success { color:var(--cc-success)!important; }
:is(html.cg-dark,html[data-theme="dark"],html:has(body:is(.dark,.dark-mode,.color-dark)))[data-cg-surface] body .ctools-shell :is(h5,h6).text-danger { color:var(--cc-danger)!important; }
html[data-cg-surface] body .product-order-page .account-filter-row { gap:.625rem; }
html[data-cg-surface] body .product-order-page .order-filter-panel { border-radius:var(--cc-radius); }
html[data-cg-surface] body :is(.content-wrapper,.content-page) .table :is(th,td) { scroll-margin-inline:.5rem; }
html[data-cg-surface] body:is(.ceo-glass-client,.ceo-glass-backoffice) :is(.content-page,.content-wrapper) :is(.card,.order-filter-panel) {
  box-shadow:0 1px 2px rgba(24,40,63,.05),0 6px 20px rgba(24,40,63,.045);
}
@media (max-width: 991.98px) {
  /* On compact widths the drawer overlays, never permanently reserves a column. */
  html.ceo-glass[data-cg-navigation="sidebar"][data-cg-surface="client"] body :is(.content-page,.iq-footer),
  html[data-cg-surface="client"] body :is(.content-page,.iq-footer) { margin-inline:0!important; inline-size:auto!important; max-inline-size:100%; }
  html.ceo-glass[data-cg-navigation="sidebar"][data-cg-surface="client"] body .iq-top-navbar,
  html[data-cg-surface="client"] body .iq-top-navbar {
    left:0!important; right:0!important; width:auto!important; max-width:100%;
    padding-inline:var(--cc-pad)!important;
  }
  html[data-cg-surface="client"] body .iq-top-navbar .navbar { min-inline-size:0; gap:.25rem; }
  html[data-cg-surface="client"] body .iq-top-navbar .top-nav-actions { min-inline-size:0; gap:.25rem; flex-wrap:nowrap; }
  html[data-cg-surface="client"] body .iq-top-navbar :is(.top-nav-leading,.top-nav-theme) { flex:none; }
  html[data-cg-surface="client"] body :is(.content-page,.iq-footer) > .container-fluid { padding-inline:var(--cc-pad); }
  html[data-cg-surface="backoffice"] body :is(.content-wrapper,.main-header,.main-footer) { margin-inline-start:0!important; }
  html[data-cg-surface="backoffice"] body .content-wrapper .container-fluid { min-width:0; }
  html[data-cg-surface] body .ctools-shell .ctools-intro { grid-template-columns:minmax(0,1fr); gap:.75rem; }
}
@media (max-width: 767.98px) {
  :root { --cc-scroll-top:5.5rem; }
  html[data-cg-surface] body :is(.main-header .nav-link,.iq-top-navbar .top-nav-control,.iq-top-navbar .top-nav-leading .wrapper-menu,.iq-top-navbar label[for="dark-mode"],.ctools-shell .tool-nav-item,.product-order-page .account-filter-actions>.btn) {
    min-block-size:44px!important;
    min-inline-size:44px!important;
  }
  html[data-cg-surface="client"] body .iq-top-navbar .top-nav-leading .wrapper-menu {
    display:inline-grid; place-items:center;
    border-radius:.625rem; cursor:pointer;
  }
  html[data-cg-surface] body .ctools-shell .tool-nav-wrap { overflow:visible; }
  html[data-cg-surface] body .ctools-shell .tool-nav-wrap :is(.tool-nav,.nav) { flex-wrap:wrap; gap:.25rem; }
  html[data-cg-surface] body .ctools-shell .tool-nav-item span { display:inline; white-space:normal; }
  html[data-cg-surface] body .product-order-page .account-filter-row>.account-filter-field { flex:1 1 8rem; min-inline-size:0; }
  html[data-cg-surface] body .product-order-page .account-filter-row>.account-filter-actions { flex:1 1 100%; }
  html[data-cg-surface="backoffice"] body .content-wrapper>.content>.container-fluid { padding-inline:.65rem; }
}
@media (max-width: 359.98px) {
  html[data-cg-surface="client"] body .iq-top-navbar { padding-inline:.35rem!important; }
  html[data-cg-surface="client"] body .iq-top-navbar .top-nav-actions { gap:.125rem; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-cg-surface] body :is(.iq-sidebar,.iq-top-navbar,.content-page,.main-sidebar,.main-header,.content-wrapper,.tool-nav-item) {
    transition-duration:.01ms!important;
    animation-duration:.01ms!important;
    scroll-behavior:auto!important;
  }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  html[data-cg-surface] body :is(.iq-top-navbar,.main-header) {
    background:var(--cc-surface)!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
  }
}
@media (forced-colors:active) {
  html[data-cg-surface] body :is(a,button,input,textarea,select,[tabindex]):focus-visible { outline-color:Highlight!important; }
}
/* Independent recovery / not-found documents use the system preference. */
html[data-ceo-standalone] body :is(main,#notfound) { overflow-wrap:anywhere; }
html[data-ceo-standalone] body :is(a,button,input):focus-visible { outline:2px solid var(--cc-focus); outline-offset:3px; }
html[data-ceo-standalone="error"] body { margin:0; min-height:100vh; background:var(--cc-canvas); color:var(--cc-ink); }
html[data-ceo-standalone="error"] #notfound { position:static; height:auto; min-height:100vh; display:grid; place-items:center; padding:1.25rem; box-sizing:border-box; }
html[data-ceo-standalone="error"] #notfound .notfound { position:static; transform:none; inline-size:min(100%,34rem); max-width:none; box-sizing:border-box; padding:clamp(1rem,5vw,2rem); background:var(--cc-surface); border:1px solid var(--cc-line); border-radius:var(--cc-radius); }
html[data-ceo-standalone="error"] #notfound .notfound-404 { position:static; height:auto; }
html[data-ceo-standalone="error"] #notfound .notfound-404 h1 { position:static; transform:none; margin:0; font:800 clamp(3rem,14vw,6rem)/1 system-ui,sans-serif; color:var(--cc-accent); }
html[data-ceo-standalone="error"] #notfound .notfound-404 h1 span { color:inherit; }
html[data-ceo-standalone="error"] #notfound .notfound p { color:var(--cc-muted); }
html[data-ceo-standalone="error"] #notfound .notfound a { display:inline-flex; align-items:center; min-height:44px; justify-content:center; background:var(--cc-active); color:var(--cc-accent); }
@media (prefers-color-scheme:dark) {
  html[data-ceo-standalone="error"] { --cc-canvas:#101823;--cc-surface:#1a2637;--cc-ink:#edf4ff;--cc-muted:#b3c1d7;--cc-accent:#a8cbff;--cc-active:#243b5c;--cc-line:#3f5571;--cc-focus:#b5d5ff;color-scheme:dark; }
}
/* Heading hierarchy and data precision, while keeping the CEOACC blue identity. */
html[data-cg-surface] body :is(.content-header h1,.ctools-shell h1,.product-order-page .order-center-title) {
  font-weight:750;
  letter-spacing:-.022em;
  line-height:1.2;
}
html[data-cg-surface] body:is(.ceo-glass-client,.ceo-glass-backoffice) :is(.content-page,.content-wrapper) :is(.card,.order-filter-panel):not(.ctools-intro) {
  border-radius:var(--cc-radius);
}
html[data-cg-surface] body .ctools-shell .ctools-intro {
  background:linear-gradient(112deg,var(--cc-surface),var(--cc-raised))!important;
  border:1px solid var(--cc-line);
  color:var(--cc-ink);
}
html[data-cg-surface] body .ctools-shell .ctools-intro-copy :is(h1,p) { color:var(--cc-ink)!important; }
html[data-cg-surface] body .ctools-shell .ctools-privacy { background:var(--cc-surface)!important;border-color:var(--cc-line)!important; }
html[data-cg-surface] body :is(.price,.amount,.total,.account-order-stats,.order-summary) { font-variant-numeric:tabular-nums; }
:is(html.cg-dark,html[data-theme="dark"],html:has(body:is(.dark,.dark-mode,.color-dark)))[data-cg-surface] body
:is(.content-page,.content-wrapper,.modal) :is(input,textarea).form-control.bg-white {
  background:var(--cc-raised)!important;color:var(--cc-ink)!important;border-color:var(--cc-control)!important;
}
