/* 2Day.news V17.5 — supplemental corrections to the UNDEPLOYED V17.4 package.
   Keep approved V17.4 visuals, scrolling hotfix, data logic, and Worker unchanged. */

/* Desktop AI previews: keep the visible “More” action but remove the
   opaque/gradient pill that sits behind its label. */
@media (min-width: 901px) {
  body.headerless-concept .analysis-preview-more,
  body.headerless-concept .ask-preview-more {
    background: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    border: 0 !important;
  }
}

/* On mobile, draw the lower-right selected-article corner at the full-width
   analysis row's outer edge, not at the inset edge of its padded AI panel.
   Preserve the approved original shape, 3px stroke, and theme accent. */
@media (max-width: 900px) {
  html[data-device-category="mobile"][data-d2-border="mirrored"]
  #newsBody .news-row.selected + .analysis-row .analysis-panel::after {
    content: none !important;
    display: none !important;
  }
  /* Legacy table-row display shrinks the following AI row to its intrinsic
     content width. Both it and its cell must follow the news card's full width. */
  html[data-device-category="mobile"] body.headerless-concept
  #newsBody .news-row.selected + .analysis-row {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
  html[data-device-category="mobile"][data-d2-border="mirrored"]
  #newsBody .news-row.selected + .analysis-row > td {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  html[data-device-category="mobile"][data-d2-border="mirrored"]
  #newsBody .news-row.selected + .analysis-row > td::after {
    content: "" !important;
    display: block !important;
    position: absolute !important;
    right: 0 !important;
    bottom: 0 !important;
    width: clamp(47px, 18%, 76px) !important;
    aspect-ratio: 1 / 1 !important;
    background: var(--d2-accent) !important;
    -webkit-mask: url("d2-corner-mask.svg") center / 100% 100% no-repeat !important;
    mask: url("d2-corner-mask.svg") center / 100% 100% no-repeat !important;
    transform: rotate(180deg) !important;
    z-index: 5 !important;
    pointer-events: none !important;
  }
}
