/* Index of Marks — clean view: remove internal framing without changing layout. */
html[data-lines-hidden="true"] body *,
html[data-lines-hidden="true"] body *::before,
html[data-lines-hidden="true"] body *::after {
  border-color: transparent !important;
  text-decoration-color: transparent !important;
}

/* Header/footer framing is structural and always remains visible. */
html[data-lines-hidden="true"] .site-header,
html[data-lines-hidden="true"] .detail-header,
html[data-lines-hidden="true"] .site-footer,
html[data-lines-hidden="true"] .site-footer-masthead {
  border-color: var(--fg) !important;
}

/* The color palette is an independent editing surface. Hide Borders must not
   alter its frame, internal dividers, inputs, validation underline or focus UI. */
html[data-lines-hidden="true"] .palette-popover,
html[data-lines-hidden="true"] .palette-popover *,
html[data-lines-hidden="true"] .palette-popover *::before,
html[data-lines-hidden="true"] .palette-popover *::after {
  border-color: var(--fg) !important;
  text-decoration-color: var(--fg) !important;
}

/* Hide Borders is a gallery control only. Detail pages keep the active state,
   when present, but never expose the toggle itself. */
body[data-detail-page] [data-lines-toggle] {
  display: none !important;
}

/* Toolbar controls remain fully usable, but their circular/pill containers
   disappear so only the control glyphs and text remain. */
html[data-lines-hidden="true"] .icon-button,
html[data-lines-hidden="true"] .search-input {
  background: transparent !important;
  box-shadow: none !important;
}

html[data-lines-hidden="true"] .icon-button:hover,
html[data-lines-hidden="true"] .icon-button:focus-visible,
html[data-lines-hidden="true"] .icon-button.is-active,
html[data-lines-hidden="true"] .icon-button[aria-expanded="true"] {
  background: transparent !important;
  color: var(--fg) !important;
}

/* Keep a quiet interaction cue after removing the button circles. */
@media (hover: hover) and (pointer: fine) {
  html[data-lines-hidden="true"] .icon-button:hover > svg,
  html[data-lines-hidden="true"] .icon-button:hover > span {
    opacity: .58;
  }
}

html[data-lines-hidden="true"] .collection-shuffle,
html[data-lines-hidden="true"] .archive-filter-marker,
html[data-lines-hidden="true"] .submit-mark,
html[data-lines-hidden="true"] .site-credit a {
  text-decoration: none !important;
}

/* The toggle swaps from the action icon (Selection Slash) to the restore icon
   (Selection) without changing its footprint in the toolbar. */
[data-lines-toggle] .clean-view-icon--restore { display: none; }
html[data-lines-hidden="true"] [data-lines-toggle] .clean-view-icon--hide { display: none; }
html[data-lines-hidden="true"] [data-lines-toggle] .clean-view-icon--restore { display: block; }
