@layer grist-custom {
  :root {
    --digital-apache-ink: #101828;
    --digital-apache-blue: #1f5eff;
    --digital-apache-cyan: #08b6d8;
    --digital-apache-soft: #eef5ff;
    --icon-GristLogo: url("data:image/svg+xml,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\"%3E%3Cdefs%3E%3ClinearGradient id=\"g\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\"%3E%3Cstop stop-color=\"%231f5eff\"/%3E%3Cstop offset=\"1\" stop-color=\"%2308b6d8\"/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width=\"48\" height=\"48\" rx=\"12\" fill=\"url(%23g)\"/%3E%3Cpath d=\"M14 34 24 10l10 24h-6l-1.8-5h-8.4l-1.8 5h-2zm5.5-10h5l-2.5-7-2.5 7z\" fill=\"white\"/%3E%3Cpath d=\"M31 16h3v18h-3z\" fill=\"white\" opacity=\".85\"/%3E%3C/svg%3E");
    --grist-theme-logo-bg: #ffffff;
    --grist-theme-logo-size: 28px 28px;
  }

  :root[data-grist-theme="GristLight"] {
    --grist-theme-body: var(--digital-apache-ink);
    --grist-theme-emphasis: #061633;
    --grist-theme-bg-default: #ffffff;
    --grist-theme-bg-secondary: #f6f9ff;
    --grist-theme-bg-tertiary: #e8f0ff;
    --grist-theme-bg-emphasis: var(--digital-apache-ink);
    --grist-theme-decoration: #d8e2f0;
    --grist-theme-decoration-secondary: #e6edf7;
    --grist-theme-decoration-tertiary: #edf2fa;
    --grist-theme-primary: var(--digital-apache-blue);
    --grist-theme-primary-muted: #174bd1;
    --grist-theme-primary-dim: #10389f;
    --grist-theme-primary-emphasis: #dce8ff;
    --grist-theme-token-cursor: var(--digital-apache-blue);
    --grist-theme-token-selection: #1f5eff22;
    --grist-theme-token-selection-opaque: #e9f0ff;
    --grist-theme-token-selection-darker-opaque: #dce8ff;
    --grist-theme-token-selection-darker: #1f5eff38;
    --grist-theme-token-selection-darkest: #1f5eff55;
    --grist-theme-info: var(--digital-apache-cyan);
  }

}


@layer grist-custom {
  [aria-labelledby="grist-resources-heading"],
  #grist-resources-heading,
  #grist-resources-logo {
    display: none !important;
  }
}


@layer grist-custom {
  /* Digital Apache white-label cleanup: avoid overlay text near the workspace switcher. */
  [aria-labelledby=grist-resources-heading],
  #grist-resources-heading,
  #grist-resources-logo {
    display: none !important;
  }

  /* Hide Grist onboarding cards that expose vendor branding on the home page. */
  [data-test-id=tutorial],
  [data-test-id=dm-basic-tutorial],
  [data-test-id=dm-templates-page],
  a[href*=getgrist.com],
  a[href*=support.getgrist.com] {
    display: none !important;
  }
}


@layer grist-custom {
  /* Stronger visible brand layer for home page. */
  [data-test-id=welcome-title],
  .test-welcome-title {
    visibility: hidden !important;
    position: relative !important;
  }

  [data-test-id=welcome-title]::before,
  .test-welcome-title::before {
    content: "Welcome to Digital Apache CRM";
    visibility: visible !important;
    position: absolute;
    left: 0;
    top: 0;
    font-size: 32px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--digital-apache-ink);
  }

  [data-test-id=tutorial],
  .test-tutorial,
  div:has(> img[src*=webinars]),
  a[href*=youtube],
  iframe[src*=youtube] {
    display: none !important;
  }

  h2, [class*=NewDocument] h2 {
    color: var(--digital-apache-ink) !important;
  }

  button, .test-create-doc, .test-import-doc,
  [data-test-id=create-doc], [data-test-id=import-doc] {
    border-radius: 10px !important;
    background: linear-gradient(135deg, var(--digital-apache-blue), var(--digital-apache-cyan)) !important;
  }

  [data-test-id=dm-org], .test-dm-org {
    border: 1px solid #d8e2f0 !important;
    box-shadow: 0 8px 20px rgba(31, 94, 255, .08) !important;
  }
}


@layer grist-custom {
  /* Digital Apache agency logo header */
  [data-test-id=dm-org], .test-dm-org {
    position: relative !important;
    min-width: 270px !important;
    height: 44px !important;
    padding-left: 12px !important;
    border: 1px solid #d8e2f0 !important;
    box-shadow: 0 8px 20px rgba(31, 94, 255, .08) !important;
    background: #fff !important;
  }

  [data-test-id=dm-org]::before, .test-dm-org::before {
    content: ;
    display: block;
    width: 205px;
    height: 52px;
    background-image: url(digital-apache-logo.png);
    background-repeat: no-repeat;
    background-size: contain;
    background-position: left center;
  }

  [data-test-id=dm-org] > *, .test-dm-org > * {
    visibility: hidden !important;
  }

  [data-test-id=dm-org]::after, .test-dm-org::after {
    content: CRM;
    position: absolute;
    right: 10px;
    top: 13px;
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--digital-apache-blue), var(--digital-apache-cyan));
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .04em;
    visibility: visible !important;
  }
}
