/* Text link colour. Every text link reads --link-ink from tokens.css; buttons,
   cards, tiles, chips, menus, tabs, steppers and navigation bars keep their roles.
   Load this right after tokens.css so the layer outranks page colours.
   A plain anchor is a text link by default. Opt out with data-link-ink="keep"
   on the link or a wrapper. Screen only: print, signing canvases and authored
   documents are untouched. */
@layer text-links {
  @media screen {
    body:not(.ow-lease-esign, .ow-esign-fill, #public-signing-page) :is(
      /* Unclassed anchors that hold text only. */
      a:is(:not([class]), [class=""]):not(:has(div, p, h1, h2, h3, h4, h5, h6, img, picture, video, ul, ol, table, section, article, figure)):not(:where(
        menu *, [role="menu"] *, [role="menubar"] *, [role="tablist"] *, [role="listbox"] *,
        [class*="menu"]:not(.dashboard-submenu) *, [class*="tabs"] *, [class*="toc"] *, [class*="stepper"] *, [class*="-rail"] *,
        [class*="workspace-links"] *, [class*="pager"] *, [class*="pagination"] *,
        body > nav *, main > nav *, dialog > nav *, header[role="banner"] *,
        .is-done > *, .is-active > *,
        .ap-property *, .app-store-options *, .city-links *, .cm-history *, .criteria-resource-grid *, .cz-chip *,
        .doc-storage-title *, .ft-close-links *, .ft-shell > *, .gl-az *, .gl-az-track *, .lh-links *,
        .listing-preview-tools *, .lt-jump *, .marketing-guide-chapters *, .mn-shortcuts *,
        .mt-list-switch *, .mz-thread *, .nf-links *, .ow-btn-row *, .ow-msg-threads > li:not(.ow-msg-empty-row) > *,
        .ow-rental-navigation *, .ow-seg *, .period-switch *, .property-lease-draft-actions *, .published-rental *,
        .published-success-copy *, .pw-context *, .rc-related *, .resources-destinations *,
        .rs-mobile-logins *, .rs-nav *, .rw-context *, .sl-v2-foot *, .slease-state-grid *,
        .slp-related *, .sol-close-links *, .sx-topic-links *,
        .pf-social *, header.site *
      )),

      /* Named link classes. */
      a[class*="text-link"], button[class*="text-link"],
      a:is(.ow-textbtn, .ow-link-btn, .cm-text-btn, .da-view-all):not(.is-danger),
      :is(
        .ac-phone-receipt, .ac-receipt-link, .acct-filter-reset, .acct-filter-rules, .acct-report-open,
        .acct-settings-link, .ad-mono, .ad-small, .ad-strong, .add-property, .application-skip,
        .attention-title, .au-intro-help, .au-text, .auth-help-link, .back-properties, .building-add,
        .clr, .cmp-fit-footer, .cr-link, .cz-eyebrow, .db-morning-next, .db-record-link, .detail-actual,
        .dlv-record-link, .dpm-open, .ea-link, .exp-text-button, .ha-rel, .help-mozart-chat, .history-back, .history-person-link,
        .inquiry-confirmation-back, .kyc-change-type, .kyc-exit, .launch-motion, .launch-review-link,
        .launch-skip, .lb-info-link, .lc-header-link, .lc-link, .lc-tenant-email,
        .lc-title-property-link, .lease-title, .lf-link, .link-button, .listing-edit-back,
        .lw-card-details, .mn-back, .mn-balance-link, .mt-lu-swap, .mu-stepbar-exit, .mz-chat-try,
        .network-open-link, .oi-preview-link, .onboard-back, .op-row, .ow-back, .ow-card-footlink,
        .ow-card-link, .ow-doc-title, .ow-help-phone, .ow-lead-name, .ow-link, .ow-msg-clear,
        .ow-mt-title, .ow-payment-receipt, .ow-plan-fdesc, .ow-sd-card-link, .owcal-item-title,
        .pay-back, .pay-entity-link, .pay-help-link, .pay-skip, .pg-link, .pm-link, .pm-reset, .pn-link,
        .prop-notif, .property-attention-label, .property-next-link, .property-section-back,
        .property-status, .property-summary-action, .property-verification-link, .pw-verification-link,
        .px-full-back, .px-full-close, .px-inline-link, .px-link, .px-proof-link, .q-row, .quick-action,
        .rc-worksheet-link, .recommendation-back, .record-link, .res-archive-topic,
        .res-link, .resources-tenant-login, .rh-help-link, .rh-subcollection,
        .rm-account-back, .rm-back, .rm-resource, .rn-prescreener-learn, .rr-intro-learn, .rs-link,
        .rs-tree-article, .rt-row, .rt-sub, .sd-feature-link, .sd-read-more, .setup-back,
        .setup-dashboard, .setup-step, .sf-exit, .showings-add-photo, .slease-template-link, .slp-see,
        .social-review-url, .sol-link, .sr-coverage-link, .sv-full-report-link, .tmr-timeline-link,
        .tt-more, .tt-rf-open, .unit-name, .users-empty-action, .users-help, .voice-link, .vw-help,
        .wt-shortcut-link
      ):is(a, button),

      /* Utility-styled links: text utilities with no fill or frame. */
      a:is([class*="text-"], [class*="underline"], [class*="font-"]):not(
        [class^="bg-"], [class*=" bg-"], [class^="border"], [class*=" border"], [class*="btn"], [class*="button"],
        [class*="cta"], [class^="text-red-"], [class*=" text-red-"], [class^="text-rose-"], [class*=" text-rose-"], [class^="text-amber-"], [class*=" text-amber-"],
        [class*="nav"], [class*="tab"], [class*="menu"], [class*="toc"], [class*="logo"], [class*="grad"],
        [class*="hover:bg-"], [class*="pd-action"], [class*="pd-secondary"]
      ):not(:has(div, p, h1, h2, h3, h4, h5, h6, img, picture, video, ul, ol, table, section, article, figure))
    ):not(:where(
      [data-link-ink="keep"], [data-link-ink="keep"] *,
      [data-card-band="lead"] *, .billing-dialog-head *,
      :is(.documents-view, .expenses-view, .leases-view, .maintenance-view, .marketing-view) .ow-textbtn,
      [style*="background"], [aria-current], .is-on, .is-active, .active,
      [data-action-tone], .rental-marketing-action, .bc-next, .lb-collection-info-toggle,
      [contenteditable] *, .ql-editor *, .ProseMirror *, .ow-editor *,
      .document-preview *, .lease-document *, .rl-lease-wrap *,
      .dlv-review-sources *, .listing-preview-address *, .tour-copy > .text-link
    )) {
      /* The fallback keeps links coloured while a cached tokens.css predates the token. */
      --link-ink-live: var(--link-ink, #009fed);
      color: var(--link-ink-live) !important;
      &:is(:hover, :focus-visible) { color: color-mix(in srgb, var(--link-ink-live) 82%, var(--text, #0f172a)) !important; }
      /* A linked card still turns its designated title to the card's hover ink. */
      &[data-card-title] { color: var(--card-title-feedback, var(--link-ink-live)) !important; }
    }
  }
}
