/* ── Plain UI: no hairline borders (UI_PLAIN, plugins/settings.php) ──────────────────────────────────────────────
   Linked only when a site is set plain; <html data-ui-plain="1"> carries it. Takes the 1px outline off the whole
   page: the CONTROLS — buttons, inputs, selects, text areas, chips and pills, tabs, segmented switches, menu options
   and the dropdown panels / sheets that hold them — the CARDS, tiles, panels and cover frames, and the PAGE CHROME —
   the header bar, banner strip, reader bars and drawers. A border turns transparent rather than vanishing, so nothing
   moves. Kept on purpose: keyboard focus (:focus-visible still paints the border, so a focused input shows its accent
   edge), checkbox / radio boxes (the border IS the box), spinners (drawn with borders), dashed placeholders, round
   avatar frames, the row dividers inside lists and menus (border-t / border-b between rows) and the tab underline.
   Inline-styled borders need !important, so every rule carries it — which also means UI_CONTROLS design 4 (outline)
   loses the border its active option is drawn with. Linked after ui-radius.css / ui-controls.css. */

/* A border made transparent uncovers the fill behind it. A gradient fill is laid out on the padding box and repeats
   past it, so its far end would show through the border as a 1px rim of the wrong shade (the chosen payment method in
   the Buy Coins dialog, the bar's cards, the report dialog, the bulk-unlock banner …): on a plain site every fill runs
   to the border's outer edge instead. Nothing changes for a box without a border. */
html[data-ui-plain] *, html[data-ui-plain] *::before, html[data-ui-plain] *::after { background-origin: border-box !important; }

/* ── Controls ── */
/* Tailwind-classed: an all-sides border class on a control element (a.rounded-xl / -2xl are cards — below) */
html[data-ui-plain] :is(button, input, select, textarea, summary, [role="button"], [role="tab"], [role="menuitem"], [role="menuitemradio"], [role="option"], [role="group"], a:not(.rounded-xl):not(.rounded-2xl)):is(.border, .border-2):not(.border-dashed):not(:focus-visible) { border-color: transparent !important; }
/* the same controls with the border written inline (style="…border:1px solid …" / border-color) */
html[data-ui-plain] :is(button, input, select, textarea, summary, [role="button"], [role="tab"], [role="menuitem"], [role="menuitemradio"], [role="option"], [role="group"], a:not(.rounded-xl):not(.rounded-2xl)):is([style*="border:"], [style*="border: "], [style*="border-color"]):not(:focus-visible) { border-color: transparent !important; }
/* chips and pills: spans / divs with text padding and a border (review tags, the sign-in page's feature pills, type badges …) */
html[data-ui-plain] :is(span, div).rounded-full[class*="px-"]:is(.border, [style*="border:"], [style*="border: "]) { border-color: transparent !important; }
html[data-ui-plain] .review-tag-pill, html[data-ui-plain] .review-tag-chip { border-color: transparent !important; }
/* hand-styled controls, by name (their sheets: recently-updated, reader-ui, coins-modal, the components' own <style>) */
html[data-ui-plain] :is(.ru-page, .ru-retry, .ru-seg, .disc-switch, .ec-hide, .fsel-btn, .fsel-search, .rv-select-btn, .pl2-tabs,
    #rd-menu-tab, .rd-btn, .rd-opt, .rd-sel, .rd-chip, .rd-color-input, .rd-group, .rd-end, .rd-hint kbd,
    #coins-modal .cm-method, #coins-modal .cm-step > button, #coins-modal .cm-preset:not(.is-on), #coins-modal .cm-chip, #coins-modal .cm-dd-btn, #coins-modal .cm-pay-addrbox, #coins-modal .cm-pay-addrbox button, #coins-modal .cm-pay-btn,
    #community-bar .cb-pill, #community-bar .cb-share-btn,
    .slider3-pill, .slider3-ctl, .slider5-chip, .slider5-nav, .slider6-meta, .slider6-pager, .slider8-nav,
    .series-l4 .l4-share a, .series-l4 .l4-share button, #site-nav[data-header] .hdr-link, #site-nav[data-header] #nav-search-input, #site-nav[data-header] .hdr-kbd):not(:focus-visible) { border-color: transparent !important; }
/* the reader menu's setting boxes (a label over a segmented bar / slider, or a switch row); inside a .rd-group only the
   row dividers are borders, and those stay */
html[data-ui-plain] :is(.rd-row-toggle, .rd-row-slider):not(.rd-group > *) { border-color: transparent !important; }
/* the report dialog (components/community-bar): its topic rows and the Details box — the chosen topic, the focused box
   and a field flagged as missing keep their coloured edge */
html[data-ui-plain] #cb-report-panel .cbr-field:not(.is-bad) .cbr-choice input:not(:checked):not(:focus-visible) + .cbr-opt,
html[data-ui-plain] #cb-report-panel .cbr-field:not(.is-bad) .cbr-box:not(:focus-within),
html[data-ui-plain] #cb-report-panel .cbr-note { border-color: transparent !important; }
/* quick bookmark: the + on covers, the dialog and its list buttons (a chosen list keeps its coloured edge) */
html[data-ui-plain] :is(.qb-btn, .qb-dialog, .qb-opt:not(.is-on)):not(:focus-visible) { border-color: transparent !important; }
/* the Appearance dialog: its frame and the theme cards (the one in use keeps its accent line) */
html[data-ui-plain] :is(.td-dialog, .td-opt:not([aria-checked="true"])):not(:focus-visible) { border-color: transparent !important; }
/* the offline downloads page (offline.js): its Select / Select all / Cancel and per-row delete buttons and the select bar */
html[data-ui-plain] :is(.mo-tb-btn, .mo-lib-del, .mo-bar.is-selecting):not(:focus-visible) { border-color: transparent !important; }
/* the locked-chapter dialog: its frame, the price panel and the secondary buttons (the fact dividers stay) */
html[data-ui-plain] :is(.cl-dialog, .cl-facts, .cl-btn:not(.is-primary)):not(:focus-visible) { border-color: transparent !important; }
/* the Bulk Unlock dialog (components/bulk-chapters): its frame (inline, hence the !important), price panel and plain buttons */
html[data-ui-plain] :is(#bulk-chapters-panel, .bu-facts, .bu-btn:not(.is-primary)):not(:focus-visible) { border-color: transparent !important; }
html[data-ui-plain] .hdr-kbd { background: rgb(var(--c-white) / .1); }
/* the dropdown menus, popovers, sheets and tooltips that hold options (several get their border inline from their scripts) */
html[data-ui-plain] :is(.theme-menu, #nav-search-popover, [id$="-dropdown"], [id$="-popover"], .rv-panel, .fsel-panel, #recent-updated-section .rc-pop, .rd-opt-list,
    #user-menu, #notif-menu, #home-sections-panel, #edit-profile-panel, #tl-create-panel, #cb-report-panel, #coins-modal .cm-dd-menu, .xp-tip, #mo-toast) { border-color: transparent !important; }
html[data-ui-plain] .mk-tt::after { border-color: transparent !important; }

/* ── Cards, tiles, panels, cover frames ── */
/* Tailwind-classed boxes with an all-sides border (not the dashed placeholders, not the round avatar frames) */
html[data-ui-plain] :is(div, section, aside, article, li, figure, a):is(.border, .border-2):not(.border-dashed):not(.rounded-full):not(:focus-visible) { border-color: transparent !important; }
html[data-ui-plain] :is(div, section, aside, article, li, figure, a):is([style*="border:"], [style*="border: "]):not(.rounded-full):not(:focus-visible) { border-color: transparent !important; }
/* hand-styled cards and frames, by name */
html[data-ui-plain] :is(.ru-card, .pl2-card, .pl2-stat, .series-l2 .l2-card, .series-l2 .l2-panel, .series-l3 .l3-card, .series-l3 .l3-avatar, .series-l4 .l4-card, .ec-panel, .disc-note,
    .slider2-card, .slider3-slide, .slider3-poster, .slider4-section, .slider4-cover, .poster-slider-section, .pv-row, .pv-panel, .series-l5 .l5-chapters, .slider5-card, .slider6-slide, .slider8-cover,
    #chapters-list.is-grid .chapter-row, #chapters-list.is-grid .ch-meta-inner, #sidebar-ch-list.is-grid .sidebar-ch-row, #sidebar-ch-list.is-grid .sch-meta-inner,
    #coins-modal .cm-card, #coins-modal .cm-box, #coins-modal .cm-sum, #coins-modal .cm-methods, #community-bar .cb-card, #community-bar[data-design="2"] .cb-grid) { border-color: transparent !important; }
html[data-ui-plain] #recent-updated-section .rc-group.has-more::before { border-color: transparent !important; }

/* ── Page chrome: the bars and drawers that frame the page ── */
/* header design 4's floating bar, the announcement strip under the header, the reader's top / bottom bars and its
   chapters drawer and side menu (the dividers between the rows inside them stay) */
html[data-ui-plain] :is(#site-nav .hdr-bar, #top-banner, #reader-nav, #reader-bottom-nav, #panel-chapters, .rd-menu) { border-color: transparent !important; }
