:root {
  color-scheme: dark;
  --eco-bg: #080908;
  --eco-surface: #111110;
  --eco-raised: #191b16;
  --eco-stroke: #343a2d;
  --eco-control-stroke: #637854;
  --eco-text: #f3f1ec;
  --eco-muted: #bdb8ad;
  --eco-lime: #8ef35e;
  --eco-lime-soft: #21331c;
  --eco-lime-bright: #c1fa9d;
  --eco-gold: #d9c88f;
  --eco-warning-text: #fda4af;
}

html:root,
html:root body,
html:root body :is(.above_body, .below_body, .ui-page, #page-home, #header) {
  background: var(--eco-bg) !important;
  color: var(--eco-text) !important;
}

html:root body :is(#header, #footer, .bottomBar) {
  border-color: var(--eco-stroke) !important;
  box-shadow: none !important;
}

html:root body #header::before,
html:root body #header::after {
  background-image: none !important;
}

/* Shared forum surfaces and utilities. */
html:root body :is(#navbar, #breadcrumb, .breadcrumb, .body_wrapper, #contentMain, #navcustom,
  #modcp_nav, #usercp_nav, #usercp_content, .popupbody, .blockbody, .blockrow, .blockfoot) {
  background: var(--eco-surface) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-text) !important;
}

html:root body .body_wrapper #contentMain #breadcrumb.breadcrumb {
  background: var(--eco-surface) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-muted) !important;
}

html:root body :is(.blockhead, .blocksubhead, .thead_bar, .threadlisthead, .tcat, .tcatLeft,
  .tcatRight, .tcatWrap, .tcat_threadlist_controls, .threadinfohead, #pagination_top, #pagination_bottom) {
  background: var(--eco-raised) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-text) !important;
  text-shadow: none !important;
}

html:root body :is(#pagetitle, .pagetitle, #breadcrumb .navbit, #breadcrumb .lastnavbit) {
  background-color: transparent !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-muted) !important;
}

html:root body :is(#pagetitle, .pagetitle) :is(h1, h2, .threadtitle) {
  color: var(--eco-text) !important;
}

html:root body :is(#breadcrumb, .breadcrumb, #navcustom, #usercp_nav, #modcp_nav, .popupbody) a {
  color: var(--eco-lime) !important;
}

html:root body .popupbody :is(a:hover, a:focus-visible),
html:root body :is(.pagination, .pagenav) a:hover {
  background-color: var(--eco-lime-soft) !important;
  color: var(--eco-lime-bright) !important;
}

html:root body :is(.pagination, .pagenav, .pagination_top, .pagination_bottom) :is(a, .selected, span.current) {
  background-color: var(--eco-raised) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-lime) !important;
}

html:root body :is(#threadpagestats, #postpagestats_above, .threadpagestats, .postpagestats) {
  color: var(--eco-muted) !important;
}

html:root body :is(.pagination, .pagenav) :is(.selected, span.current),
html:root body :is(.pagination, .pagenav) .selected a {
  background: var(--eco-lime-soft) !important;
  border-color: var(--eco-control-stroke) !important;
  color: var(--eco-lime) !important;
}

/* Forum index, subforums and listing cards. */
html:root body :is(#forums, .forumbits) :is(.forumbitBody, .forumrow, .forumhead, .theadrow, .forumactionlinks),
html:root body :is(#threadlist, #threadlist .mmopro-thread-card, #threadlist .threadbit, #threadlist .threadbit > .table,
  #threadlist .threadbit .threadinfo, #threadlist .threadbit .threadstats, #threadlist .threadbit .threadlastpost),
html:root body .mmopro-layout-news #forum2 .forumrow,
html:root body #announcements :is(.announcerow, .announcement, .announceinfo) {
  background: var(--eco-surface) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-text) !important;
}

html:root body #announcements .announcerow :is(.announceinfo, dt) { color: var(--eco-muted) !important; }
html:root body #announcements .announcerow a { color: var(--eco-lime) !important; }

html:root body :is(#forums, .forumbits) :is(.forumhead, .theadrow),
html:root body #threadlist :is(.threadlisthead, .stickies, .announcements) > [data-role="list-divider"] {
  background: var(--eco-raised) !important;
}

html:root body :is(#forums, .forumbits) .forumtitle a,
html:root body :is(#threadlist, #searchbits) :is(.threadtitle, .searchtitle) a.title {
  color: var(--eco-text) !important;
}

html:root body :is(#forums, .forumbits) :is(.tcatDesc, .forumdescription, .forumstats, .forumlastpost, .subforums),
html:root body :is(#threadlist, #searchbits) :is(.threadmeta, .threaddetails, .threadstats, .threadlastpost, .threadpostedin),
html:root body :is(#pagetitle, .pagetitle) .description {
  color: var(--eco-muted) !important;
}

html:root body :is(#forums, .forumbits) :is(.forumtitle a:hover, .forumlastpost a, .subforums a),
html:root body :is(#threadlist, #searchbits) :is(.threadtitle a.title:hover, .searchtitle a.title:hover,
  .threadmeta a, .threadpostedin a, .threadlastpost a) {
  color: var(--eco-lime) !important;
}

html:root body :is(#threadlist, #searchbits) .prefix,
html:root body #threadlist .threadlisthead a,
html:root body :is(#forums, .forumbits) .tcat .forumtitle a {
  color: var(--eco-gold) !important;
}

/* Stats, community information and footer links. */
html:root body :is(#wgo, #wgo .blockbody, #mmopro-layout-stats, #mmopro-layout-stats #vsa_fh_stats,
  #mmopro-layout-stats .mmopro-stats-grid > tbody > tr > td[id], #navcustom, .mmopro-layout-panel,
  #footer, #footer_links, .bottomBar, .bottomBarLeft, .bottomBarRight) {
  background: var(--eco-surface) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-text) !important;
}

html:root body :is(#wgo .blocksubhead, #wgo .wgo_subblock h3, #mmopro-layout-stats .blockhead,
  #mmopro-layout-stats .mmopro-stats-grid .mmopro-stats-heading, #mmopro-layout-stats > summary, .mmopro-layout-news .blockhead) {
  background: var(--eco-raised) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-gold) !important;
}

html:root body :is(#wgo .wgo_subblock, #mmopro-layout-stats #vsa_fh_stats td, #mmopro-layout-stats #vsa_fh_stats .shade,
  #mmopro-layout-stats #vsastats_lpdiv > table > tbody > tr, .footer_time, .footer_copyright, .footer_morecopyright) {
  border-color: var(--eco-stroke) !important;
  color: var(--eco-muted) !important;
}

html:root body #wgo :is(.shade, .time) { color: var(--eco-muted) !important; }
html:root body #announcements .announcerow :is(.announcement, .announceinfo) { background: transparent !important; }

html:root body :is(#wgo, #mmopro-layout-stats #vsa_fh_stats, #footer, #footer_links,
  .footer_copyright, .footer_morecopyright, .bottomBar, .mmopro-layout-quicklinks) a {
  color: var(--eco-lime) !important;
}

html:root body #ad_global_above_footer font[color="#2980B9" i] { color: var(--eco-gold) !important; }

/* Threads and posts. Keep saved post styling and code formatting intact. */
html:root body #posts > .postcontainer,
html:root body #posts .postcontainer :is(.postbody, .postdetails, .postrow, .userinfo, .postfoot, .postfoot_container),
html:root body :is(.thread_info_block, .forum_info_block, .thread_info, .forum_info_form) {
  background: var(--eco-surface) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-text) !important;
}

html:root body #posts .postcontainer :is(.posthead, .userinfo_extra, .after_content) {
  background: var(--eco-raised) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-muted) !important;
}

html:root body #posts .postcontainer .postbody div[id^="post_message_"] > .postcontent,
html:root body #posts .postcontainer .posttitle {
  color: var(--eco-text) !important;
}

html:root body #posts .postcontainer :is(.posthead, .userinfo, .postfoot, .postcontrols) a {
  color: var(--eco-lime) !important;
}

html:root body #posts .postcontainer :is(.postdate, .usertitle, .userinfo_extra dt, .lastedited, .postcounter) {
  color: var(--eco-muted) !important;
}

/* BBCode output on threads, single posts and reply previews. */
html:root body :is(#posts, .postpreview, .postcontent) .bbcode_container {
  min-inline-size: 0;
  max-inline-size: 100%;
}

html:root body :is(#posts, .postpreview, .postcontent) .bbcode_container .bbcode_quote:not(.printable) {
  background: var(--eco-raised) !important;
  border-color: var(--eco-stroke) !important;
  border-inline-start: 3px solid var(--eco-control-stroke) !important;
  color: var(--eco-text) !important;
}

html:root body :is(#posts, .postpreview, .postcontent) .bbcode_quote .quote_container {
  background: transparent !important;
  border-color: var(--eco-stroke) !important;
  color: inherit !important;
  text-shadow: none !important;
}

html:root body :is(#posts, .postpreview, .postcontent) .bbcode_quote .bbcode_quote_container {
  background-image: none !important;
}

html:root body :is(#posts, .postpreview, .postcontent) .bbcode_container :is(.bbcode_postedby, .bbcode_description) {
  color: var(--eco-gold) !important;
  text-shadow: none !important;
}

html:root body :is(#posts, .postpreview, .postcontent) .bbcode_description a.view {
  color: var(--eco-lime) !important;
}

html:root body :is(#posts, .postpreview, .postcontent) .bbcode_container > :is(pre, div).bbcode_code {
  box-sizing: border-box;
  max-inline-size: 100%;
  min-inline-size: 0;
  padding: 10px 12px;
  overflow: auto;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
  background: var(--eco-bg) !important;
  border: 1px solid var(--eco-stroke) !important;
  border-radius: 6px;
  color: var(--eco-text) !important;
  text-shadow: none !important;
}

/* Remap the legacy PHP and HTML highlighters within code output. */
html:root body :is(#posts, .postpreview, .postcontent) .bbcode_code :is(
  span[style*="#000000" i], font[color="#000000" i]
) { color: var(--eco-text) !important; }

html:root body :is(#posts, .postpreview, .postcontent) .bbcode_code :is(
  span[style*="#0000bb" i], span[style*="#0000ff" i], span[style*="#000080" i],
  font[color="#0000bb" i], font[color="#0000ff" i], font[color="#000080" i]
) { color: #a9cdfa !important; }

html:root body :is(#posts, .postpreview, .postcontent) .bbcode_code :is(
  span[style*="#007700" i], span[style*="#008000" i], span[style*="#008080" i],
  font[color="#007700" i], font[color="#008000" i]
) { color: var(--eco-lime-bright) !important; }

html:root body :is(#posts, .postpreview, .postcontent) .bbcode_code :is(
  span[style*="#dd0000" i], span[style*="#800000" i], span[style*="#ff0000" i],
  font[color="#dd0000" i]
) { color: var(--eco-warning-text) !important; }

html:root body :is(#posts, .postpreview, .postcontent) .bbcode_code :is(
  span[style*="#ff8000" i], span[style*="#800080" i], font[color="#ff8000" i]
) { color: var(--eco-gold) !important; }

/* Thread actions retain their native icons and member-only behavior. */
html:root body #posts .postfoot :is(.postfoot_container, .textcontrols, .postcontrols, .postlinking) {
  background: var(--eco-surface) !important;
  border-color: var(--eco-stroke) !important;
}

html:root body #posts .postfoot a:is(.quickreply, .newreply, .multiquote, .editpost, .reputation,
  .mmopro-post-action:not([data-mmopro-action="infraction"], [data-mmopro-action="redcard"], [data-mmopro-action="yellowcard"], [data-mmopro-action="report"]),
  [name="dbtech_thanks_button"]) {
  background-color: var(--eco-raised) !important;
  border-color: var(--eco-control-stroke) !important;
  color: var(--eco-text) !important;
  text-shadow: none !important;
}

html:root body #posts .postfoot a:is(.reputation, .multiquote.highlight, .multiquote[aria-pressed="true"]),
html:root body #posts .postfoot a:is(.quickreply, .newreply, .multiquote, .editpost, .reputation, [name="dbtech_thanks_button"]):hover {
  background-color: var(--eco-lime-soft) !important;
  border-color: var(--eco-lime) !important;
  color: var(--eco-lime-bright) !important;
}

html:root body #posts .postfoot a:focus-visible,
html:root body :is(#newreplylink_top, #newreplylink_bottom):focus-visible {
  outline: 2px solid var(--eco-lime) !important;
  outline-offset: 2px;
}

/* The editor runtime supplies accessible names and the matching action glyphs. */
html:root body #posts .postfoot.mmopro-actions-ready :is(.postcontrols, .postlinking) {
  gap: 8px !important;
}

html:root body #posts .postfoot a.mmopro-post-action:not(
  [data-mmopro-action="editpost"], [data-mmopro-action="quickreply"],
  [data-mmopro-action="newreply"], [data-mmopro-action="likes"]
),
html:root body #posts .postfoot .textcontrols a.ip {
  box-sizing: border-box;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  inline-size: 44px !important;
  min-inline-size: 44px !important;
  min-block-size: 44px !important;
  margin: 0 !important;
  padding: 0 !important;
  gap: 0 !important;
  background: var(--eco-raised) !important;
  border: 1px solid var(--eco-control-stroke) !important;
  border-radius: 8px !important;
  font-size: 0 !important;
  text-shadow: none !important;
}

html:root body #posts .postfoot a.mmopro-post-action:not(
  [data-mmopro-action="editpost"], [data-mmopro-action="quickreply"],
  [data-mmopro-action="newreply"], [data-mmopro-action="likes"]
) > .mmopro-action-label {
  font-size: 0 !important;
}

html:root body #posts .postfoot .textcontrols a.ip::before {
  content: "";
  inline-size: 19px;
  block-size: 19px;
  background: var(--eco-text);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='13' rx='2'/%3E%3Cpath d='M8 21h8M12 17v4M7.5 8l2.5 2.5L7.5 13M13 13h3.5'/%3E%3C/svg%3E") center / contain no-repeat;
}

html:root body #posts .postfoot a.mmopro-post-action:is(
  [data-mmopro-action="reputation"], .highlight, [aria-pressed="true"]
),
html:root body #posts .postfoot a.mmopro-post-action:not(
  [data-mmopro-action="editpost"], [data-mmopro-action="quickreply"],
  [data-mmopro-action="newreply"], [data-mmopro-action="likes"]
):is(:hover, :focus-visible),
html:root body #posts .postfoot .textcontrols a.ip:is(:hover, :focus-visible) {
  background-color: var(--eco-lime-soft) !important;
  border-color: var(--eco-lime) !important;
}

/* Retired messengers on the public profile and the native Edit Profile form. */
html:root body #posts .userinfo .imlinks:not(:has(.mmopro-profile-socials)),
html:root body #posts .userinfo .imlinks :is(a:has(> img[src*="/im_"]), img[src*="/im_"]),
html:root body :is(#view-contactinfo-content, #view-aboutme-content, #page-member) :is(.im_img_link, .im_txt_link),
html:root body form:has(input[name="do"][value="updateprofile"]) fieldset:has(
  input[name="msn"], input[name="icq"], input[name="aim"], input[name="yahoo"], input[name="skype"]
) {
  display: none !important;
}

html:root body .mmopro-profile-socials {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-block: 8px;
}

html:root body .postbit .mmopro-profile-socials {
  justify-content: flex-start;
  margin: 8px 12px;
}

html:root body a.mmopro-profile-social {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-inline-size: 44px;
  min-block-size: 44px;
  padding-inline: 10px;
  border: 1px solid var(--eco-control-stroke);
  border-radius: 8px;
  background: var(--eco-raised);
  color: var(--eco-lime) !important;
  text-decoration: none;
  text-shadow: none;
}

html:root body a.mmopro-profile-social svg {
  inline-size: 15.2px;
  block-size: 15.2px;
  flex: 0 0 auto;
}

html:root body a.mmopro-profile-social:is(:hover, :focus-visible) {
  background: var(--eco-lime-soft);
  border-color: var(--eco-lime);
  color: var(--eco-lime-bright) !important;
}

html:root body a.mmopro-profile-social:focus-visible {
  outline: 2px solid var(--eco-lime);
  outline-offset: 2px;
}

html:root body #posts .mmopro-profile-socials {
  gap: 2px;
}

html:root body #posts .mmopro-profile-socials a.mmopro-profile-social {
  position: relative;
  isolation: isolate;
  inline-size: 44px;
  min-inline-size: 44px;
  min-block-size: 44px;
  padding: 0;
  border: 0;
  background: transparent;
}

html:root body #posts .mmopro-profile-socials a.mmopro-profile-social::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 4.4px;
  border: 1px solid var(--eco-control-stroke);
  border-radius: 7px;
  background: var(--eco-raised);
}

html:root body #posts .mmopro-profile-socials a.mmopro-profile-social:is(:hover, :focus-visible)::before {
  background: var(--eco-lime-soft);
  border-color: var(--eco-lime);
}

html:root body #posts > li.postcontainer:has(> [id^="dbtech_thanks_entries_"]) {
  background: var(--eco-raised) !important;
  border-color: var(--eco-stroke) !important;
}

html:root body #posts > li.postcontainer > [id^="dbtech_thanks_entries_"] .userinfo {
  color: var(--eco-muted) !important;
}

html:root body #posts > li.postcontainer > [id^="dbtech_thanks_entries_"] .userinfo :is(a, a span) {
  color: var(--eco-lime) !important;
}

/* Keep the add-on's Like label and counts together in a compact reaction row. */
html:root body #posts > li.postcontainer:has(> [id^="dbtech_thanks_entries_"]) {
  gap: .25rem .75rem !important;
  padding: .25rem .75rem !important;
}

html:root body #posts > li.postcontainer > [id^="dbtech_thanks_entries_"] {
  flex-basis: 0 !important;
}

html:root body #posts :is(li.postcontainer, div):has(> [id^="dbtech_thanks_entries_"]) > .postfoot {
  flex: 0 0 auto !important;
  margin-inline-start: auto !important;
  background: transparent !important;
}

html:root body #posts :is(li.postcontainer, div):has(> [id^="dbtech_thanks_entries_"]) > .postfoot
  :is(.textcontrols, .postlinking, [id^="dbtech_thanks_actions_"]) {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: flex-end !important;
  align-items: center;
  gap: .35rem;
  padding: 0 !important;
  background: transparent !important;
}

html:root body #posts .postfoot .dbtech-thanks-button-control {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

html:root body #posts .postfoot a[name="dbtech_thanks_button"][data-button="likes"] {
  inline-size: auto !important;
  min-block-size: 44px !important;
  border-color: var(--eco-control-stroke) !important;
  border-radius: 6px !important;
  color: var(--eco-lime-bright) !important;
  white-space: nowrap !important;
  overflow-wrap: normal !important;
}

html:root body #posts .postfoot a.mmopro-post-action[data-mmopro-action="likes"] {
  padding: .3rem .7rem !important;
}

/* The same palette covers the standalone and AJAX reputation forms. */
html:root body :is(.reputationpopupmenu .popupbody, form[action*="reputation.php"], #qr_defaultcontainer,
  form[action*="newreply.php"] .formcontrols, form[action*="editpost.php?do=updatepost"] .formcontrols) {
  background: var(--eco-surface) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-text) !important;
  text-shadow: none !important;
}

html:root body :is(.reputationpopupmenu .popupbody, form[action*="reputation.php"], #qr_defaultcontainer,
  form[action*="newreply.php"], form[action*="editpost.php?do=updatepost"])
  :is(label, .description, .ui-btn-text) {
  color: inherit !important;
  text-shadow: none !important;
}

html:root body :is(.reputationpopupmenu .popupbody, form[action*="reputation.php"], #qr_defaultcontainer,
  form[action*="newreply.php"], form[action*="editpost.php?do=updatepost"])
  :is(input[type="text"], textarea, select) {
  background: var(--eco-bg) !important;
  border-color: var(--eco-control-stroke) !important;
  color: var(--eco-text) !important;
  caret-color: var(--eco-lime);
}

html:root body :is(.reputationpopupmenu .popupbody, form[action*="reputation.php"], #qr_defaultcontainer,
  form[action*="newreply.php"], form[action*="editpost.php?do=updatepost"]) :is(input[type="radio"], input[type="checkbox"]) {
  accent-color: var(--eco-lime);
}

html:root body :is(.reputationpopupmenu .popupbody, form[action*="reputation.php"], #qr_defaultcontainer,
  form[action*="newreply.php"], form[action*="editpost.php?do=updatepost"])
  :is(input[type="submit"], input[type="reset"], button[type="submit"], button[name="cancel"], .ui-btn:has(> button)),
html:root body :is(#newreplylink_top, #newreplylink_bottom) {
  background: var(--eco-raised) !important;
  border-color: var(--eco-control-stroke) !important;
  color: var(--eco-text) !important;
  text-shadow: none !important;
  box-shadow: none !important;
}

html:root body :is(#newreplylink_top, #newreplylink_bottom, #quick_reply :is(#qr_submit, [name="sbutton"]),
  .reputationpopupmenu .popupbody [name="reputationsubmit"], form[action*="reputation.php"] [name="reputationsubmit"],
  form[action*="newreply.php"] :is([name="sbutton"], .ui-btn:has(> button[name="sbutton"]))) {
  background: var(--eco-lime) !important;
  border-color: var(--eco-lime) !important;
  color: var(--eco-bg) !important;
}

html:root body :is(#newreplylink_top, #newreplylink_bottom, #quick_reply :is(#qr_submit, [name="sbutton"]),
  .reputationpopupmenu .popupbody [name="reputationsubmit"], form[action*="reputation.php"] [name="reputationsubmit"],
  form[action*="newreply.php"] :is([name="sbutton"], .ui-btn:has(> button[name="sbutton"]))):hover {
  background-color: var(--eco-lime-bright) !important;
  border-color: var(--eco-lime-bright) !important;
}

html:root body :is(.reputationpopupmenu .popupbody, form[action*="reputation.php"], #qr_defaultcontainer,
  form[action*="newreply.php"], form[action*="editpost.php?do=updatepost"])
  :is(input, textarea, select, button):focus-visible {
  outline: 2px solid var(--eco-lime) !important;
  outline-offset: 2px;
}

html:root body :is(.reputationpopupmenu .popupbody, form[action*="reputation.php"], #qr_defaultcontainer,
  form[action*="newreply.php"], form[action*="editpost.php?do=updatepost"])
  :is(input[type="submit"]:disabled, button:disabled, .ui-btn:has(> button:disabled)) {
  background: var(--eco-surface) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-muted) !important;
}

/* Reply editor chrome and writing area. */
html:root body :is(#quick_reply, form[action*="newreply.php"], form[action*="editpost.php?do=updatepost"], .postbody)
  :is(.cke_skin_kama, .cke_wrapper, .cke_top, .cke_bottom, .cke_toolgroup, .cke_rcombo a, .mmopro-more-tools) {
  background: var(--eco-raised) !important;
  border-color: var(--eco-control-stroke) !important;
  color: var(--eco-text) !important;
  text-shadow: none !important;
}

html:root body :is(#quick_reply, form[action*="newreply.php"], form[action*="editpost.php?do=updatepost"], .postbody)
  :is(.cke_contents, .cke_contents textarea.cke_source) {
  background: var(--eco-bg) !important;
  color: var(--eco-text) !important;
}

html:root body :is(#quick_reply, form[action*="newreply.php"])
  :is(.cke_contents, .cke_contents iframe, .cke_contents textarea.cke_source, textarea[name="message"]) {
  background: var(--eco-surface) !important;
  border-color: var(--eco-control-stroke) !important;
  color: var(--eco-text) !important;
  caret-color: var(--eco-lime);
}

html:root body #qr_defaultcontainer #quick_reply :is(.wysiwyg_block, .cke_contents, .cke_contents iframe) {
  background: var(--eco-surface) !important;
}

html:root body :is(#quick_reply, form[action*="newreply.php"], form[action*="editpost.php?do=updatepost"], .postbody)
  .cke_button a:is(:hover, .cke_on) {
  background: var(--eco-lime-soft) !important;
  border-color: var(--eco-control-stroke) !important;
  color: var(--eco-lime-bright) !important;
}

/* Keep only the known low-contrast legacy BBCode colors readable across both styles. */
html:root body #posts .postcontent font:is([color="#1A1516" i], [color="#1A1A1A" i],
  [color="#1F1F1F" i]):not(pre font, code font, .bbcode_code font, .bbcode_php font, .bbcode_html font) {
  color: var(--eco-text) !important;
}

html:root body #posts .postcontent font[color="#800000" i]:not(pre font, code font, .bbcode_code font,
  .bbcode_php font, .bbcode_html font) {
  color: var(--eco-warning-text) !important;
}

html:root body #thread_controls a { color: var(--eco-lime) !important; }

/* Quick Navigation and its forum jump menu. */
html:root body #below_postlist:has(> #newreplylink_bottom) {
  box-sizing: border-box;
  display: flex !important;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: .5rem .75rem;
  margin-block: .75rem !important;
  padding-inline: clamp(.75rem, 2vw, 1.25rem);
}

html:root body #below_postlist > #newreplylink_bottom {
  position: static !important;
  float: none !important;
  display: inline-flex !important;
  align-items: center;
  gap: .35em;
  min-block-size: 40px;
  margin: 0 !important;
  padding: .45em .9em !important;
  font-style: normal !important;
  white-space: nowrap;
}

html:root body #below_postlist:has(> #newreplylink_bottom) > #pagination_bottom {
  float: none !important;
  width: auto !important;
  max-inline-size: 100%;
  margin: 0 !important;
  background: transparent !important;
}

html:root body :is(#showthread_navpopup, #forumdisplay_navpopup, #memberlist_navpopup, #navpopup, .navpopupmenu:has(> .navpopupbody)) > .shade {
  color: var(--eco-muted) !important;
}

html:root body :is(#showthread_navpopup, #forumdisplay_navpopup, #memberlist_navpopup, #navpopup, .navpopupmenu:has(> .navpopupbody)) > :is(a.popupctrl, a.textcontrol) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: .45em;
  min-height: 36px;
  padding: .35em .75em !important;
  background: var(--eco-raised) !important;
  border: 1px solid var(--eco-control-stroke) !important;
  border-radius: 6px !important;
  color: var(--eco-lime-bright) !important;
  box-shadow: none !important;
  text-shadow: none !important;
  text-decoration: none !important;
}

html:root body :is(#showthread_navpopup, #forumdisplay_navpopup, #memberlist_navpopup, #navpopup, .navpopupmenu:has(> .navpopupbody)) > a.popupctrl .ctrlcontainer {
  padding: 0 !important;
  background: none !important;
  color: inherit !important;
}

html:root body :is(#showthread_navpopup, #forumdisplay_navpopup, #memberlist_navpopup, #navpopup, .navpopupmenu:has(> .navpopupbody)) > a.popupctrl::after {
  content: '';
  inline-size: .4em;
  block-size: .4em;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-.12em) rotate(45deg);
}

html:root body :is(#showthread_navpopup, #forumdisplay_navpopup, #memberlist_navpopup, #navpopup, .navpopupmenu:has(> .navpopupbody)) >
  :is(a.popupctrl, a.textcontrol):is(:hover, :focus-visible, .active) {
  background: var(--eco-lime-soft) !important;
  border-color: var(--eco-lime) !important;
}

html:root body :is(#showthread_navpopup, #forumdisplay_navpopup, #memberlist_navpopup, #navpopup, .navpopupmenu:has(> .navpopupbody)) a:focus-visible {
  outline: 2px solid var(--eco-lime) !important;
  outline-offset: 2px;
}

html:root body :is(#showthread_navpopup, #forumdisplay_navpopup, #memberlist_navpopup, #navpopup, .navpopupmenu:has(> .navpopupbody)) > .navpopupbody {
  box-sizing: border-box;
  max-inline-size: calc(100vw - 2rem);
  border-color: var(--eco-control-stroke) !important;
  border-radius: 6px !important;
  box-shadow: 0 10px 26px #0007 !important;
}

html:root body :is(#showthread_navpopup, #forumdisplay_navpopup, #memberlist_navpopup, #navpopup, .navpopupmenu:has(> .navpopupbody)) .navpopupbody .optionlabel {
  background: var(--eco-raised) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-text) !important;
}

/* Thread utilities and profile reactions. */
html:root body #contentMain .dbtech_thanks_box {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html:root body :is(
  #contentMain .dbtech_thanks_box > div:not(:has(> .popupmenu)),
  #contentMain .dbtech_thanks_box .popupmenu > a.popupctrl,
  #postlist #inlinemod_formctrls > a.popupctrl,
  #thread_tags_list #tag_edit_link,
  #tag_edit_form .actionbuttons input.button
) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: .4em;
  min-height: 36px;
  padding: .45em .8em !important;
  background: var(--eco-raised) !important;
  border: 1px solid var(--eco-control-stroke) !important;
  border-radius: 6px !important;
  color: var(--eco-lime-bright) !important;
  font-size: .875rem !important;
  font-weight: 600 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  text-decoration: none !important;
}

html:root body :is(
  #contentMain .dbtech_thanks_box .popupmenu > a.popupctrl,
  #postlist #inlinemod_formctrls > a.popupctrl,
  #thread_tags_list #tag_edit_link,
  #tag_edit_form .actionbuttons input.button
):is(:hover, :focus-visible),
html:root body :is(#contentMain .dbtech_thanks_box, #postlist #inlinemod_formctrls) a.popupctrl.active {
  background: var(--eco-lime-soft) !important;
  border-color: var(--eco-lime) !important;
  color: var(--eco-lime-bright) !important;
}

html:root body :is(#contentMain .dbtech_thanks_box, #postlist #inlinemod_formctrls, #tag_edit_form)
  :is(a, input):focus-visible,
html:root body #thread_tags_list #tag_edit_link:focus-visible {
  outline: 2px solid var(--eco-lime) !important;
  outline-offset: 2px;
}

html:root body #contentMain .dbtech_thanks_box > div > img,
html:root body #contentMain .dbtech_thanks_box a.popupctrl > img {
  inline-size: 1em;
  block-size: 1em;
  object-fit: contain;
}

html:root body #contentMain .dbtech_thanks_box > div > span,
html:root body #contentMain .dbtech_thanks_box a.popupctrl > span {
  float: none !important;
  color: var(--eco-lime) !important;
  font-size: inherit !important;
  font-variant-numeric: tabular-nums;
}

html:root body #postlist #inlinemod_formctrls a.popupctrl .ctrlcontainer {
  padding: 0 !important;
  background: none !important;
  color: inherit !important;
}

html:root body #contentMain .dbtech_thanks_box .popupmenu > a.popupctrl::after,
html:root body #postlist #inlinemod_formctrls > a.popupctrl::after {
  content: '';
  inline-size: .4em;
  block-size: .4em;
  margin-inline: .2em .1em;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: translateY(-.12em) rotate(45deg);
}

html:root body :is(#postlist #inlinemod_formctrls, #contentMain .dbtech_thanks_box) .popupbody {
  box-sizing: border-box;
  max-inline-size: calc(100vw - 2rem);
  background: var(--eco-surface) !important;
  border: 1px solid var(--eco-control-stroke) !important;
  border-radius: 6px !important;
  box-shadow: 0 10px 26px #0007 !important;
}

html:root body :is(#postlist #inlinemod_formctrls, #contentMain .dbtech_thanks_box)
  .popupbody > li {
  background: transparent !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-text) !important;
}

html:root body #postlist #inlinemod_formctrls .popupbody > li > label {
  background: transparent !important;
  color: var(--eco-text) !important;
  text-shadow: none !important;
}

html:root body #postlist #inlinemod_formctrls .popupbody > li > label:is(:hover, :focus-within) {
  background: var(--eco-lime-soft) !important;
  color: var(--eco-lime-bright) !important;
}

html:root body :is(#postlist #inlinemod_formctrls, #tag_edit_form) input:is([type="radio"], [type="checkbox"]) {
  accent-color: var(--eco-lime);
}

html:root body #tag_edit_form :is(.formcontrols, #tagpopup_ctrl) {
  background: var(--eco-surface) !important;
  border-color: var(--eco-control-stroke) !important;
  color: var(--eco-text) !important;
}

html:root body #tag_edit_form .singledescription {
  color: var(--eco-muted) !important;
}

html:root body #member_content #view-thanks :is(.subsection, h4.subsectionhead-understate) {
  background: var(--eco-surface) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-text) !important;
}

html:root body #member_content #view-thanks .member_content .subsection {
  background: var(--eco-raised) !important;
  border-radius: 0 0 6px 6px;
}

html:root body #member_content #view-thanks h4.subsectionhead-understate {
  padding: .35rem .65rem;
  color: var(--eco-muted) !important;
}

html:root body #member_content #view-thanks li a[href*="/threads/"] {
  color: var(--eco-lime-bright) !important;
}

/* Public member profiles, including the native mobile tabs. */
html:root body :is(#member_content, #memberinfoheader, #memberinfonav,
  .tabbody:is(#page-aboutme, #page-visitormessage, #page-more)) {
  color: var(--eco-text) !important;
  text-shadow: none !important;
}

html:root body #member_content :is(#sidebar_container, .member_summary .mainblock, .profile_content,
  .userprof_content, .activitystream_block, .activitybit, .member_blockrow, .memberprofiletabunder),
html:root body :is(#memberinfoheader, .tabbody:is(#page-aboutme, #page-visitormessage, #page-more)),
html:root body .tabbody:is(#page-aboutme, #page-visitormessage, #page-more) :is(.ui-li, .ui-body-c, .ui-body-d, .ui-body-e) {
  background: var(--eco-surface) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-text) !important;
  text-shadow: none !important;
}

html:root body #member_content :is(.member_summary .userinfo, .userprof_headers, .userprof_blocksubhead,
  .subsectionhead, .subblocksubhead, #profile_tabs dd, .as-tabs dd, .userprof_button,
  .activitystream_block .moreactivity),
html:root body #memberinfonav a.ui-btn,
html:root body .tabbody:is(#page-aboutme, #page-visitormessage, #page-more) :is(.ui-bar, .ui-btn) {
  background: var(--eco-raised) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-text) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

html:root body #member_content :is(#profile_tabs, .as-tabs) :is(dd.userprof_module, dd.selected, a[aria-selected="true"]),
html:root body #memberinfonav a.ui-btn-active {
  background: var(--eco-lime-soft) !important;
  border-color: var(--eco-control-stroke) !important;
  color: var(--eco-lime-bright) !important;
  text-shadow: none !important;
}

html:root body #member_content :is(.member_username, .activitybit .title),
html:root body #memberinfoheader .member_username {
  color: var(--eco-text) !important;
}

html:root body #member_content :is(.stats dt, .aboutme_left, #view-aboutme dl dt, .meta, .totalvisits,
  .member_status, .usertitle, .activitybit :is(.datetime, .views, .excerpt)),
html:root body .tabbody:is(#page-aboutme, #page-visitormessage, #page-more) .name {
  color: var(--eco-muted) !important;
  text-shadow: none !important;
}

html:root body #member_content :is(#profile_tabs, .as-tabs, #usermenu, #view-stats_mini, #activitylist,
  .friends_list, #view-visitors, #view-aboutme) a,
html:root body .tabbody:is(#page-aboutme, #page-visitormessage, #page-more) a {
  color: var(--eco-lime) !important;
  text-shadow: none !important;
}

html:root body #member_content :is(a, button, input[type="button"]):focus-visible,
html:root body :is(#memberinfoheader, #memberinfonav, .tabbody:is(#page-aboutme, #page-visitormessage, #page-more)) a:focus-visible {
  outline: 2px solid var(--eco-lime) !important;
  outline-offset: 2px;
}

@media (max-width: 720px) {
  html:root body #member_content :is(#sidebar_container, #userprof_content_container) {
    box-sizing: border-box;
    float: none !important;
    min-inline-size: 0 !important;
    inline-size: 100% !important;
    margin-inline: 0 !important;
  }
}

/* Shared secondary pages and native forms. */
html:root body :is(.subforum > .shade, ul.codeblock .desc .shade,
  #contentMain .formcontrols :is(.description, .singledescription)) {
  color: var(--eco-muted) !important;
  text-shadow: none !important;
}

html:root body #member_content .userprof_blocksubhead a.textcontrol {
  color: var(--eco-lime-bright) !important;
}

html:root body #contentMain :is(.activitystream #activitylist .activitybit,
  #searchbits.mmopro-search-results > .threadbit) {
  background: var(--eco-surface) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-text) !important;
}

html:root body #contentMain .searchresults .searchlisthead {
  background: var(--eco-raised) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-text) !important;
  text-shadow: none !important;
}

html:root body :is(#contentMain .activitystream .moreactivity,
  #footer_links a[href$="#top"], #thread_info .mmopro-share-link) {
  background: var(--eco-raised) !important;
  border-color: var(--eco-control-stroke) !important;
  color: var(--eco-text) !important;
  text-shadow: none !important;
}

html:root body #posts > center > h2:has(font[color="brown" i]) {
  box-sizing: border-box;
  max-inline-size: 100%;
  padding: .5rem .75rem;
  border-block: 1px solid var(--eco-stroke);
  background: var(--eco-raised) !important;
  color: var(--eco-text) !important;
  font-size: 1rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

html:root body #posts > center > h2:has(font[color="brown" i]) :is(u, font) {
  color: inherit !important;
  font-size: inherit;
  text-decoration: none;
}

html:root body :is(.faqsearch #faqsearchquery, #tag_search #tagpopup_ctrl, #monthjump select) {
  max-inline-size: 100%;
  background: var(--eco-bg) !important;
  border-color: var(--eco-control-stroke) !important;
  color: var(--eco-text) !important;
  box-shadow: none !important;
}

html:root body :is(.faqsearch, #tag_search, #monthjump) :is(input[type="submit"], button[type="submit"]),
html:root body :is(.faqsearch, #registerform, .standard_error form[action*="login.php"]) input[type="reset"] {
  background: var(--eco-raised) !important;
  border: 1px solid var(--eco-control-stroke) !important;
  border-radius: 6px !important;
  color: var(--eco-text) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

html:root body :is(.faqsearch, #tag_search, #monthjump) :is(input, button, select):focus-visible,
html:root body :is(#calendar_content, #calendar_nav, #calendarpicker, #calendarpicker ~ .tabslight) a:focus-visible,
html:root body :is(#registerform, .standard_error form[action*="login.php"]) input[type="reset"]:focus-visible {
  outline: 2px solid var(--eco-lime) !important;
  outline-offset: 2px;
}

/* Calendar views and their native date controls. */
html:root body #calendar_main {
  display: flow-root;
  width: calc(100% - 17rem) !important;
  margin-inline-end: 0 !important;
}

html:root body #calendar_main #calendar_content {
  margin-inline-end: 0 !important;
  min-inline-size: 0;
}

html:root body #calendar_nav {
  box-sizing: border-box;
  width: 16rem !important;
  max-inline-size: 100%;
}

html:root body :is(#calendar_content, #calendar_nav) .calendar.mini table,
html:root body #calendar_content.month > .blockbody > table {
  width: 100% !important;
  table-layout: fixed;
}

html:root body :is(#calendar_content, #calendar_nav) .calendar.mini :is(th, td, .simpleday, .daynum) {
  padding-inline: .2rem !important;
}

html:root body :is(#calendar_content, #calendar_nav) :is(th, td, .eventlist, .events) {
  border-color: var(--eco-stroke) !important;
  overflow-wrap: anywhere;
}

html:root body :is(#calendar_content, #calendar_nav) :is(.events, td.othermonth, td.othermonth a) {
  background: var(--eco-surface) !important;
}

html:root body :is(#calendar_content, #calendar_nav) :is(td.today, td.today a.daynum) {
  background: var(--eco-lime-soft) !important;
  border-color: var(--eco-control-stroke) !important;
}

html:root body :is(#calendar_content, #calendar_nav) :is(.daynum, .weeklink, td a, .blockhead a) {
  color: var(--eco-lime-bright) !important;
}

html:root body :is(#calendar_content, #calendar_nav) :is(td.othermonth a, .simpleday),
html:root body #calendarpicker ~ .tabslight > dt {
  color: var(--eco-muted) !important;
}

html:root body :is(#monthjump .textcontrol, #calendar_nav #neweventbutton, #calendar_content .weekcontrols a,
  #calendarpicker a.popupctrl, #calendarpicker ~ .tabslight > dd > a) {
  background: var(--eco-raised) !important;
  border: 1px solid var(--eco-control-stroke) !important;
  border-radius: 6px !important;
  color: var(--eco-text) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

html:root body :is(#monthjump :is(.textcontrol, input.button), #calendar_nav #neweventbutton,
  #calendar_content .weekcontrols a, #calendarpicker a.popupctrl, #calendarpicker ~ .tabslight > dd > a,
  .faqsearch input.button, #tag_search input.button, #registerform input[type="reset"],
  .standard_error form[action*="login.php"] input[type="reset"]):hover,
html:root body #calendarpicker ~ .tabslight > dd.selected > a {
  background: var(--eco-lime-soft) !important;
  color: var(--eco-lime-bright) !important;
}

@media (max-width: 840px) {
  html:root body :is(#calendar_main, #calendar_nav) {
    float: none !important;
    width: 100% !important;
  }

  html:root body #calendar_nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    gap: .75rem;
  }
}

@media (max-width: 540px) {
  html:root body #registerform .blockrow:has(> .rightcol) > label {
    display: block;
    float: none !important;
    width: auto !important;
    margin-block-end: .35rem;
  }

  html:root body #registerform .blockrow > .rightcol {
    margin-inline: 0 !important;
    min-inline-size: 0;
  }

  html:root body #registerform .rightcol :is(input.textbox, select) {
    box-sizing: border-box;
    max-inline-size: 100%;
  }

  html:root body #monthjump {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
    float: none;
  }

  html:root body #calendar_content.month > .blockbody > table :is(th, td.events) {
    padding-inline: .15rem !important;
    font-size: .75rem;
  }

  html:root body #calendar_content.month .events ol li {
    box-sizing: border-box;
    float: none;
    width: auto;
    margin-inline-start: .6em;
  }

  html:root body #calendar_content .quarter .calendar.mini {
    float: none;
    width: 100%;
    margin-inline: 0;
  }

  html:root body #thread_info #posting_rules {
    margin-inline-end: 0 !important;
  }

  html:root body #forumrules .rules_link {
    box-sizing: border-box;
    width: 100% !important;
    padding-inline: 0 !important;
  }

  html:root body #posts > center:has(> ins.adsbygoogle) {
    max-inline-size: 100%;
    overflow-x: auto;
  }
}

/* Native account and search controls. Only palette and focus styling. */
html:root body :is(#mmopro-category-nav, #mmopro-list-filters, #searchform, #searchbits.mmopro-search-results > .threadbit > div,
  #forumsearch .popupbody, #popupsearch .popupbody, form[action*="register.php"] .formcontrols,
  form[action*="login.php"] .formcontrols, .standard_error) {
  background: var(--eco-surface) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-text) !important;
}

/* Keep the native redirect layout and give its fallback action a readable surface. */
html:root body:has(> .standard_error > form[name="postvarform"] #redirect_button) {
  min-width: 0 !important;
}

html:root body .standard_error:has(> form[name="postvarform"] #redirect_button) {
  box-sizing: border-box;
  max-width: calc(100% - 24px);
  background: transparent !important;
}

html:root body .standard_error > form[name="postvarform"]:has(#redirect_button) {
  border: 1px solid var(--eco-stroke) !important;
  border-radius: 10px !important;
  box-shadow: none !important;
}

html:root body .standard_error > form[name="postvarform"]:has(#redirect_button) > :is(.blockhead, .blockbody, .redirect_button) {
  margin: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}

html:root body .standard_error > form[name="postvarform"]:has(#redirect_button) > .blockhead {
  border-radius: 9px 9px 0 0 !important;
}

html:root body .standard_error > form[name="postvarform"] > .redirect_button:has(#redirect_button) {
  border-top: 1px solid var(--eco-stroke) !important;
  border-radius: 0 0 9px 9px !important;
}

html:root body :is(.standard_error #redirect_button, #page-redirect form[name="postvarform"])
  :is(a.textcontrol, #proceed_button) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  padding: 8px 14px !important;
  background: var(--eco-lime-soft) !important;
  border: 1px solid var(--eco-control-stroke) !important;
  border-radius: 7px !important;
  box-shadow: none !important;
  color: var(--eco-lime) !important;
  text-align: center;
  text-shadow: none !important;
  white-space: normal;
}

html:root body :is(.standard_error #redirect_button, #page-redirect form[name="postvarform"])
  :is(a.textcontrol, #proceed_button):hover {
  color: var(--eco-lime-bright) !important;
  border-color: var(--eco-lime) !important;
}

html:root body :is(.standard_error #redirect_button, #page-redirect form[name="postvarform"])
  :is(a.textcontrol, #proceed_button):focus-visible {
  outline: 2px solid var(--eco-gold) !important;
  outline-offset: 2px;
}

html:root body :is(#mmopro-category-nav #mmopro-category-results a, .mmopro-layout-quicklinks a, #mmopro-refine-search,
  #searchform.mmopro-advanced-search input[type="reset"]) {
  background: var(--eco-raised) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-text) !important;
}

html:root body :is(#mmopro-category-nav, #mmopro-list-filters, #searchform.mmopro-advanced-search, #forumsearch .mmopro-native-forum-search,
  #popupsearch .popupbody, #footer_select, #toplinks #navbar_loginform, form[action*="register.php"],
  form[action*="login.php"], .ui-page [data-role="content"] form) :is(input:not([type]),
  input[type="text"], input[type="password"], input[type="email"], input[type="search"], select, textarea),
html:root body :is(#page-home, .ui-page) [data-role="content"] :is(.ui-input-text, .ui-select .ui-btn) {
  background-color: var(--eco-bg) !important;
  border-color: var(--eco-control-stroke) !important;
  color: var(--eco-text) !important;
}

html:root body #navbar .searchBox .searchBoxInput :is(.gsc-input-box, input.gsc-input) {
  background-color: var(--eco-bg) !important;
  border-color: var(--eco-control-stroke) !important;
  color: var(--eco-text) !important;
}

html:root body #navbar .searchBox .searchBoxInput .gsc-search-button-v2 {
  background-color: var(--eco-lime-soft) !important;
  border-color: var(--eco-control-stroke) !important;
  color: var(--eco-lime) !important;
}

html:root body :is(#mmopro-category-nav, #mmopro-list-filters, #searchform, #forumsearch, #toplinks #navbar_loginform,
  form[action*="register.php"], form[action*="login.php"]) :is(input, textarea)::placeholder {
  color: var(--eco-muted) !important;
}

html:root body :is(#mmopro-category-nav, #mmopro-list-filters, #searchform, #forumsearch, #toplinks #navbar_loginform,
  form[action*="register.php"], form[action*="login.php"]) :is(input[type="radio"], input[type="checkbox"]) {
  accent-color: var(--eco-lime) !important;
}

html:root body :is(#mmopro-category-nav, #mmopro-list-filters, #searchform, #forumsearch, #toplinks #navbar_loginform,
  #footer_select, form[action*="register.php"], form[action*="login.php"]) :is(input, select, button, textarea):focus-visible {
  outline-color: var(--eco-gold) !important;
}

html:root body :is(#navbar #navtabs > li > a.navtab, #navbar .mmopro-layout-subnav > li > a,
  #navbar #navtabs > ul > li > a, #header.mmopro-header-login #toplinks .mmopro-header-link,
  #mmopro-category-nav #mmopro-category-clear, #mmopro-category-nav .mmopro-category-shortcuts button) {
  background: var(--eco-raised) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-text) !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

html:root body :is(#navbar #navtabs > li.selected > a.navtab, #navbar #navtabs > li > a.navtab:hover,
  #mmopro-category-nav button[aria-pressed="true"], #header.mmopro-header-login #toplinks .mmopro-register-link,
  #header.mmopro-header-login #toplinks :is(.loginbutton, #mmopro-login-toggle),
  #mmopro-list-filters input[type="submit"], #searchform.mmopro-advanced-search input[type="submit"],
  #forumsearch .mmopro-native-forum-search input[type="submit"], form[action*="register.php"] :is(input,button)[type="submit"],
  form[action*="login.php"] :is(input,button)[type="submit"]) {
  background: var(--eco-lime-soft) !important;
  color: var(--eco-lime) !important;
  border-color: var(--eco-control-stroke) !important;
  box-shadow: none !important;
}

html:root body :is(#mmopro-category-nav, #mmopro-list-filters, #forumsearch .popupbody, #searchform, #toplinks #navbar_loginform)
:is(label, .label, .mmopro-filter-help, .mmopro-search-help, .mmopro-category-parent, #mmopro-category-status) {
  color: var(--eco-muted) !important;
}

/* Native mobile classes also apply on phones using the dedicated style. */
html:root body :is(#page-home, .ui-page) [data-role="content"] {
  background: var(--eco-bg) !important;
  color: var(--eco-text) !important;
}

html:root body :is(#page-home, .ui-page) :is(.ui-body-a, .ui-listview, .ui-listview .ui-btn, .ui-listview .ui-li-static,
  .ui-listview > li:not([data-role="list-divider"]), .ui-select .ui-btn, .ui-controlgroup .ui-btn,
  .ui-collapsible-heading .ui-btn, .ui-collapsible-content) {
  background: var(--eco-surface) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-text) !important;
  text-shadow: none !important;
}

html:root body :is(#page-home, .ui-page) :is([data-role="list-divider"], .ui-li-divider, .ui-li-count, .pagetitle.ui-bar-b) {
  background: var(--eco-raised) !important;
  border-color: var(--eco-stroke) !important;
  color: var(--eco-gold) !important;
  text-shadow: none !important;
}

html:root body :is(#page-home, .ui-page) :is(.ui-listview, #threadlist, .pagenav, .ui-collapsible-heading) a {
  color: var(--eco-lime) !important;
  text-shadow: none !important;
}

@media (min-width: 901px) {
  html body #header.mmopro-header-login #toplinks.toplinks > ul.nouser {
    --eco-login-label-space: calc(13px * 1.4 + 5px);
    align-items: start !important;
  }

  html body #header.mmopro-header-login #toplinks > ul.nouser > li:not(.mmopro-login-item) {
    padding-block-start: var(--eco-login-label-space) !important;
  }

  html body #header.mmopro-header-login #toplinks #navbar_loginform {
    display: grid !important;
    grid-template-areas: 'fields submit' 'remember remember';
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 4px 8px;
    width: clamp(345px, 31vw, 440px) !important;
  }

  html body #header.mmopro-header-login #logindetails { grid-area: fields; }
  html body #header.mmopro-header-login #navbar_loginform #remember { display: contents !important; }
  html body #header.mmopro-header-login #remember > label { grid-area: remember; }
  html body #header.mmopro-header-login #remember > .loginbutton { grid-area: submit; }
}

#mmo-ecosystem-bar {
  position: relative;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  padding: 7px clamp(12px, 2vw, 25px);
  background: var(--eco-bg);
  border-block: 1px solid var(--eco-stroke);
  color: var(--eco-text);
  font: 600 14px/1.35 system-ui, sans-serif;
  text-shadow: none;
}

#mmo-ecosystem-bar:has(details[open]) { z-index: 10001; }

#mmo-ecosystem-bar .mmo-eco-name {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

#mmo-ecosystem-bar .mmo-eco-dot {
  flex: 0 0 8px;
  block-size: 8px;
  border-radius: 50%;
  background: var(--eco-lime);
}

#mmo-ecosystem-bar .mmo-eco-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#mmo-ecosystem-bar :is(.mmo-eco-action, summary) {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--eco-stroke);
  border-radius: 8px;
  background: var(--eco-surface);
  color: var(--eco-text);
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 130ms ease, border-color 130ms ease;
}

#mmo-ecosystem-bar details summary {
  list-style: none;
  background: var(--eco-lime) !important;
  border-color: var(--eco-lime) !important;
  color: #111b0a !important;
  text-shadow: none !important;
}

#mmo-ecosystem-bar summary::-webkit-details-marker { display: none; }
#mmo-ecosystem-bar details summary:hover { background: var(--eco-lime-bright) !important; }
#mmo-ecosystem-bar .mmo-eco-action:hover { background: var(--eco-raised); border-color: #66834c; }
#mmo-ecosystem-bar .mmo-eco-chevron {
  inline-size: 7px;
  block-size: 7px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg);
}
#mmo-ecosystem-bar details[open] .mmo-eco-chevron { transform: translateY(2px) rotate(225deg); }

#mmo-ecosystem-bar .mmo-eco-panel {
  box-sizing: border-box;
  position: absolute;
  z-index: 120;
  inset-block-start: 100%;
  inset-inline-end: clamp(10px, 2vw, 25px);
  width: min(466px, calc(100% - 20px));
  max-height: min(70vh, 410px);
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 8px;
  list-style: none;
  border: 1px solid #536344;
  border-radius: 12px;
  background: var(--eco-surface);
  box-shadow: 0 16px 42px #0009;
}

#mmo-ecosystem-bar details:not([open]) .mmo-eco-panel { display: none; }
#mmo-ecosystem-bar details[open] .mmo-eco-panel { animation: mmo-eco-enter 155ms cubic-bezier(.16,1,.3,1); }
#mmo-ecosystem-bar .mmo-eco-panel a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 44px;
  gap: 2px 8px;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--eco-text);
  text-decoration: none;
}
#mmo-ecosystem-bar .mmo-eco-panel a:hover,
#mmo-ecosystem-bar .mmo-eco-panel a:focus-visible {
  background: var(--eco-raised);
  border-color: var(--eco-stroke);
}
#mmo-ecosystem-bar .mmo-eco-meta { grid-column: 1; font-size: 12px; color: var(--eco-muted); }
#mmo-ecosystem-bar .mmo-eco-external { grid-area: 1 / 2 / 3 / 3; color: var(--eco-lime); }
#mmo-ecosystem-bar :is(a, summary):focus-visible {
  outline: 2px solid var(--eco-gold);
  outline-offset: 3px;
}

@keyframes mmo-eco-enter {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
  #mmo-ecosystem-bar { align-items: stretch; flex-wrap: wrap; gap: 5px 8px; }
  #mmo-ecosystem-bar .mmo-eco-name { min-height: 24px; }
  #mmo-ecosystem-bar .mmo-eco-action,
  #mmo-ecosystem-bar summary { padding-inline: 9px; font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  #mmo-ecosystem-bar :is(.mmo-eco-action, summary) { transition: none; }
  #mmo-ecosystem-bar details[open] .mmo-eco-panel { animation: none; }
}
