/* Short descriptions remain in the normal flow. Both lines open the same task. */
.cd32-admin-grid {
  gap: .8rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 44rem) {
  .cd32-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 74rem) {
  .cd32-admin-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
}
.cd32-admin-group { padding: .85rem .55rem .35rem; }
.cd32-admin-group h2 {
  font-size: 1.04rem;
  padding-inline: .4rem;
  margin-block-end: .25rem;
  overflow-wrap: anywhere;
}
.cd32-admin-group a.cd328-task {
  display: block;
  position: relative;
  min-height: 44px;
  padding: .5rem .4rem;
  border-radius: 3px;
  text-decoration: none;
}
.cd328-task-title { display: block; padding-inline-end: .95rem; }
.cd328-task::after {
  content: "";
  position: absolute;
  top: 1rem;
  inset-inline-end: .6rem;
  width: .35rem;
  height: .35rem;
  border: solid currentColor;
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}
.cd328-task:is(:hover,:focus-visible) { background: var(--bg); }
.cd328-task:is(:hover,:focus-visible) .cd328-task-title { text-decoration: underline; }
.cd328-task-description {
  display: block;
  margin-top: .12rem;
  font-size: .875rem;
  font-weight: 400;
  color: var(--muted);
}

/* Dark reading surface, including revision previews. Print uses existing styles.
   Do not filter/invert imagery, diagrams, PDFs or their contents. */
@media screen {
  html[data-cd29-theme=dark] .cd26-article {
    background: var(--card);
    color: var(--text);
    padding: 0;
  }
  html[data-cd29-theme=dark] .cd26-article a { color: var(--accent); }
  html[data-cd29-theme=dark] .cd26-article .muted { color: var(--muted); }

  /* Older HTML may include author-supplied inline colours or bgcolor attributes.
     Restrict overrides to text containers in the article and editor. */
  html[data-cd29-theme=dark] :is(.cd26-article,.cd14-editor)
    :is(p,div,span,font,strong,b,em,i,u,h1,h2,h3,h4,h5,h6,blockquote,ul,ol,li,pre,code,table,tr,td,th):is([color],[bgcolor],[style*="color" i],[style*="background" i]):not([class]) {
      background-color: transparent !important;
      color: inherit !important;
      border-color: var(--line);
  }
  html[data-cd29-theme=dark] :is(.cd26-article,.cd14-editor)
    a:is([color],[bgcolor],[style*="color" i],[style*="background" i]):not([class]) {
      background-color: transparent !important;
      color: var(--accent) !important;
  }
  html[data-cd29-theme=dark] .cd191-filename { color: #ffc2c5; }

  /* Legacy controls and tile letterboxing. */
  html[data-cd29-theme=dark] :is(.cd14-upload,.cd14-lock,.search-options,.skip-link,.editor .inline-thumb-wrap .del) {
    background: var(--card);
    color: var(--text);
    border-color: var(--line);
  }
  html[data-cd29-theme=dark] .cd14-new-inline { background: #193a31; color: #b1f1d0; border-color: #356353; }
  html[data-cd29-theme=dark] :is(.cd14-error,.badge.level-5) { background: #40252b; color: #ffd2d4; border-color: #8c4d58; }
  html[data-cd29-theme=dark] :is(.tile img.img,img.cd24-result-img,.cd14-file img,.cd14-view-grid img) { background-color: var(--bg); }
  html[data-cd29-theme=dark] .cd24-result .img:not(img) {
    background: var(--bg) !important;
    color: var(--text) !important;
  }
}
