/* =========================================================
   Cliphorium Global Shell
   Header/footer standard for all public + ops pages.
   This file must load LAST.
   ========================================================= */

html body .ch-footer {
  width: 100% !important;
  margin-top: 96px !important;
  padding: 42px 22px 32px !important;
  background:
    radial-gradient(circle at 20% 0%, rgba(0,229,168,.08), transparent 30%),
    linear-gradient(180deg, rgba(2,6,23,.96), rgba(2,6,23,1)) !important;
  border-top: 1px solid rgba(125,211,252,.14) !important;
  color: #AAB7C4 !important;
}

html body .ch-footer-inner {
  width: 100% !important;
  max-width: 1180px !important;
  margin: 0 auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 18px !important;
  text-align: center !important;
}

html body .ch-footer .ao-logo-mark {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  text-decoration: none !important;
  color: #F4F7FB !important;
}

html body .ch-footer .ao-logo-icon {
  display: none !important;
}

html body .ch-footer .ao-logo-text {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  line-height: 1 !important;
}

html body .ch-footer .ao-logo-text strong {
  color: #F4F7FB !important;
  font-size: 17px !important;
  font-weight: 900 !important;
  letter-spacing: -0.02em !important;
}

html body .ch-footer .ao-logo-text em {
  color: #00E5A8 !important;
  margin-top: 4px !important;
  font-style: normal !important;
  font-size: 8.5px !important;
  font-weight: 900 !important;
  letter-spacing: .18em !important;
  text-transform: uppercase !important;
}

html body .ch-footer-links {
  width: 100% !important;
  max-width: 920px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px 18px !important;
  list-style: none !important;
  line-height: 1.2 !important;
}

html body .ch-footer-links a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #AAB7C4 !important;
  text-decoration: none !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  padding: 5px 0 !important;
  white-space: nowrap !important;
}

html body .ch-footer-links a:hover {
  color: #00E5A8 !important;
}

html body .ch-footer p {
  margin: 0 !important;
  color: #667789 !important;
  font-size: 13px !important;
}

@media (max-width: 640px) {
  html body .ch-footer {
    margin-top: 72px !important;
    padding: 34px 18px 26px !important;
  }

  html body .ch-footer-inner {
    gap: 16px !important;
  }

  html body .ch-footer-links {
    gap: 8px 14px !important;
  }

  html body .ch-footer-links a {
    font-size: 13px !important;
  }
}

/* =========================================================
   FINAL GLOBAL FOOTER FORCE
   Highest specificity for public + ops pages.
   ========================================================= */

html body footer.ch-footer,
html body .ops-shell ~ footer.ch-footer,
html body main ~ footer.ch-footer {
  position: relative !important;
  display: block !important;
  width: 100% !important;
  margin: 96px 0 0 0 !important;
  padding: 44px 22px 34px !important;
  clear: both !important;
  float: none !important;
  background:
    radial-gradient(circle at 20% 0%, rgba(0,229,168,.08), transparent 30%),
    linear-gradient(180deg, rgba(2,6,23,.96), rgba(2,6,23,1)) !important;
  border-top: 1px solid rgba(125,211,252,.14) !important;
  color: #AAB7C4 !important;
  text-align: center !important;
}

html body footer.ch-footer > .ch-footer-inner {
  width: min(1180px, calc(100% - 44px)) !important;
  max-width: 1180px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 18px !important;
  text-align: center !important;
}

html body footer.ch-footer .ao-logo-mark {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  margin: 0 auto !important;
  text-decoration: none !important;
  color: #F4F7FB !important;
}

html body footer.ch-footer .ao-logo-icon {
  display: none !important;
}

html body footer.ch-footer .ao-logo-text {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  line-height: 1 !important;
}

html body footer.ch-footer .ao-logo-text strong {
  color: #F4F7FB !important;
  font-size: 17px !important;
  font-weight: 900 !important;
  letter-spacing: -0.02em !important;
}

html body footer.ch-footer .ao-logo-text em {
  color: #00E5A8 !important;
  margin-top: 4px !important;
  font-style: normal !important;
  font-size: 8.5px !important;
  font-weight: 900 !important;
  letter-spacing: .18em !important;
  text-transform: uppercase !important;
}

html body footer.ch-footer nav.ch-footer-links {
  width: 100% !important;
  max-width: 940px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px 18px !important;
  line-height: 1.2 !important;
  text-align: center !important;
}

html body footer.ch-footer nav.ch-footer-links a {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #AAB7C4 !important;
  text-decoration: none !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  padding: 5px 0 !important;
  white-space: nowrap !important;
}

html body footer.ch-footer nav.ch-footer-links a:hover {
  color: #00E5A8 !important;
}

html body footer.ch-footer p {
  display: block !important;
  margin: 0 !important;
  color: #667789 !important;
  font-size: 13px !important;
  text-align: center !important;
}

@media (max-width: 640px) {
  html body footer.ch-footer {
    margin-top: 72px !important;
    padding: 34px 18px 26px !important;
  }

  html body footer.ch-footer > .ch-footer-inner {
    width: 100% !important;
    gap: 16px !important;
  }

  html body footer.ch-footer nav.ch-footer-links {
    gap: 8px 14px !important;
  }

  html body footer.ch-footer nav.ch-footer-links a {
    font-size: 13px !important;
  }
}

/* =========================================================
   TRUST / LEGAL PAGE FOOTER POSITION
   Keeps footer at bottom on short pages like Status.
   Applies only to pages using .legal-shell.
   ========================================================= */

html body:has(.legal-shell) {
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  background: #020617 !important;
}

html body:has(.legal-shell) .legal-shell {
  flex: 1 0 auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding-top: 128px !important;
  padding-bottom: 72px !important;
}

html body:has(.legal-shell) footer.ch-footer {
  flex-shrink: 0 !important;
  margin-top: auto !important;
}

@media (max-width: 720px) {
  html body:has(.legal-shell) .legal-shell {
    padding-top: 104px !important;
    padding-bottom: 56px !important;
  }
}

/* =========================================================
   STATUS PAGE FOOTER REAL FIX
   status.html uses .status-shell, not .legal-shell.
   ========================================================= */

html body:has(.status-shell) {
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  background: #020617 !important;
}

html body:has(.status-shell) .status-shell {
  flex: 1 0 auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding-top: 128px !important;
  padding-bottom: 88px !important;
}

html body:has(.status-shell) footer.ch-footer {
  flex-shrink: 0 !important;
  margin-top: auto !important;
}

/* Also support any future trust page shells */
html body:has(.trust-shell),
html body:has(.privacy-shell),
html body:has(.terms-shell) {
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  background: #020617 !important;
}

html body:has(.trust-shell) .trust-shell,
html body:has(.privacy-shell) .privacy-shell,
html body:has(.terms-shell) .terms-shell {
  flex: 1 0 auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding-top: 128px !important;
  padding-bottom: 88px !important;
}

html body:has(.trust-shell) footer.ch-footer,
html body:has(.privacy-shell) footer.ch-footer,
html body:has(.terms-shell) footer.ch-footer {
  flex-shrink: 0 !important;
  margin-top: auto !important;
}

@media (max-width: 720px) {
  html body:has(.status-shell) .status-shell,
  html body:has(.trust-shell) .trust-shell,
  html body:has(.privacy-shell) .privacy-shell,
  html body:has(.terms-shell) .terms-shell {
    padding-top: 104px !important;
    padding-bottom: 64px !important;
  }
}


/* =========================================================
   GLOBAL PAGE / FOOTER PLACEMENT
   One rule for public, legal, audit, and ops pages.
   Keeps footer below content and bottom-aligned on short pages.
   ========================================================= */

html {
  min-height: 100%;
  background: #020617;
}

html body {
  min-height: 100vh !important;
  display: flex !important;
  flex-direction: column !important;
  background: #020617 !important;
}

/* All main content areas grow to push footer down on short pages */
html body main,
html body .legal-shell,
html body .audit-shell,
html body .ops-shell,
html body .admin-shell,
html body .ao-body > main {
  flex: 1 0 auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Footer always follows content; it should not float high */
html body footer.ch-footer {
  flex-shrink: 0 !important;
  width: 100% !important;
  margin-top: 56px !important;
}

/* Legal/status/contact pages need enough top/bottom breathing room */
html body .legal-shell {
  padding-top: 128px !important;
  padding-bottom: 72px !important;
}

/* Audit page spacing */
html body .audit-shell {
  padding-bottom: 80px !important;
}

/* Ops/admin page spacing — do not over-push footer */
html body .ops-shell,
html body .admin-shell {
  padding-bottom: 48px !important;
  min-height: auto !important;
}

/* Homepage already has its own sections; keep footer normal */
html body .ao-final-cta + footer.ch-footer,
html body footer.ch-footer {
  clear: both !important;
}

@media (max-width: 760px) {
  html body footer.ch-footer {
    margin-top: 42px !important;
  }

  html body .legal-shell {
    padding-top: 104px !important;
    padding-bottom: 56px !important;
  }

  html body .audit-shell {
    padding-bottom: 60px !important;
  }

  html body .ops-shell,
  html body .admin-shell {
    padding-bottom: 36px !important;
  }
}


/* =========================================================
   FINAL GLOBAL FOOTER PUSH-DOWN RULE
   Footer stays at bottom on short pages and below content on long pages.
   ========================================================= */

html {
  min-height: 100% !important;
  background: #020617 !important;
}

html body {
  min-height: 100vh !important;
  min-height: 100dvh !important;
  display: flex !important;
  flex-direction: column !important;
  background: #020617 !important;
}

/* Header never stretches */
html body > header.ch-navbar {
  flex: 0 0 auto !important;
}

/* Main content grows and pushes footer down */
html body > main,
html body .legal-shell,
html body .audit-shell,
html body .ops-shell,
html body .admin-shell {
  flex: 1 0 auto !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Footer sits at the bottom on short pages */
html body > footer.ch-footer,
html body footer.ch-footer {
  flex: 0 0 auto !important;
  margin-top: auto !important;
  width: 100% !important;
  clear: both !important;
}

/* Keep enough breathing room above footer when content is long */
html body > main + footer.ch-footer,
html body .legal-shell + footer.ch-footer,
html body .audit-shell + footer.ch-footer,
html body .ops-shell + footer.ch-footer,
html body .admin-shell + footer.ch-footer {
  margin-top: 56px !important;
}

/* Legal/status pages */
html body .legal-shell {
  padding-top: 128px !important;
  padding-bottom: 72px !important;
}

/* Ops/admin pages */
html body .ops-shell,
html body .admin-shell {
  padding-bottom: 48px !important;
}

@media (max-width: 760px) {
  html body > main + footer.ch-footer,
  html body .legal-shell + footer.ch-footer,
  html body .audit-shell + footer.ch-footer,
  html body .ops-shell + footer.ch-footer,
  html body .admin-shell + footer.ch-footer {
    margin-top: 42px !important;
  }

  html body .legal-shell {
    padding-top: 104px !important;
    padding-bottom: 56px !important;
  }

  html body .ops-shell,
  html body .admin-shell {
    padding-bottom: 36px !important;
  }
}

/* Workflow Agent decision queue button spacing */
html body .workflow-queue-actions,
html body td.workflow-queue-actions,
html body .decision-queue-actions,
html body td.decision-queue-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  align-items: center !important;
}

html body .workflow-queue-actions button,
html body td.workflow-queue-actions button,
html body .decision-queue-actions button,
html body td.decision-queue-actions button {
  margin: 0 !important;
}

/* Fallback for current Workflow Agent table action cell */
html body table td:last-child button + button {
  margin-left: 10px !important;
}

/* Workflow Agent decision queue button spacing */
html body .workflow-queue-actions,
html body td.workflow-queue-actions,
html body .decision-queue-actions,
html body td.decision-queue-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  align-items: center !important;
}

html body .workflow-queue-actions button,
html body td.workflow-queue-actions button,
html body .decision-queue-actions button,
html body td.decision-queue-actions button {
  margin: 0 !important;
}

/* Fallback for current Workflow Agent table action cell */
html body table td:last-child button + button {
  margin-left: 10px !important;
}

/* Workflow Agent generated draft polish */
html body .generated-draft-card,
html body #generatedDraft,
html body #generated-draft,
html body .workflow-generated-draft {
  display: grid !important;
  gap: 14px !important;
}

html body .generated-draft-grid,
html body .draft-preview-grid,
html body .workflow-draft-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
}

html body .generated-draft-row,
html body .draft-preview-row,
html body .workflow-draft-row {
  display: grid !important;
  gap: 6px !important;
  padding: 14px !important;
  border: 1px solid rgba(125,211,252,.14) !important;
  border-radius: 16px !important;
  background: rgba(7,17,31,.54) !important;
}

html body .generated-draft-label,
html body .draft-preview-label,
html body .workflow-draft-label {
  color: #7DD3FC !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: .08em !important;
  text-transform: uppercase !important;
}

html body .generated-draft-value,
html body .draft-preview-value,
html body .workflow-draft-value {
  color: #F4F7FB !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
  white-space: pre-wrap !important;
}

html body .generated-draft-actions,
html body .draft-preview-actions,
html body .workflow-draft-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin-top: 12px !important;
}

@media (max-width: 760px) {
  html body .generated-draft-grid,
  html body .draft-preview-grid,
  html body .workflow-draft-grid {
    grid-template-columns: 1fr !important;
  }
}

/* =========================================================
   Workflow Agent Generated Draft real layout fix
   Targets actual rendered markup: .wf-status-box + draft IDs.
   ========================================================= */

html body .wf-generated-draft,
html body .wf-draft-preview,
html body .wf-preview-card {
  width: 100% !important;
  box-sizing: border-box !important;
}

html body .wf-status-box {
  display: grid !important;
  grid-template-columns: 150px minmax(0, 1fr) !important;
  gap: 12px 18px !important;
  align-items: start !important;
  padding: 14px 0 !important;
  border-bottom: 1px solid rgba(125, 211, 252, .12) !important;
  line-height: 1.55 !important;
}

html body .wf-status-box:last-of-type {
  border-bottom: 0 !important;
}

html body .wf-status-box span,
html body .wf-status-box small {
  display: block !important;
  margin: 0 !important;
  color: #7DD3FC !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  letter-spacing: .12em !important;
  text-transform: uppercase !important;
  line-height: 1.25 !important;
}

html body .wf-status-box strong,
html body #draftSubject,
html body #draftMessage,
html body #draftNextAction,
html body #draftRisk,
html body #draftDecision {
  display: block !important;
  margin: 0 !important;
  color: #F4F7FB !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  line-height: 1.55 !important;
  min-width: 0 !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
}

html body #draftMessage {
  padding: 12px 14px !important;
  border: 1px solid rgba(125, 211, 252, .14) !important;
  border-radius: 14px !important;
  background: rgba(2, 6, 23, .32) !important;
}

html body .wf-draft-actions,
html body .wf-generated-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  align-items: center !important;
  margin-top: 18px !important;
}

html body .wf-draft-actions button,
html body .wf-generated-actions button {
  margin: 0 !important;
}

@media (max-width: 720px) {
  html body .wf-status-box {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    padding: 13px 0 !important;
  }
}
