/* Search-only overrides for MediaWiki's native OOUI and Codex controls. */
@media screen {
  html:root body.mw-special-Search #mw-content-text .mw-search-form-wrapper,
  html:root body.mw-special-Search #mw-search-top-table {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
  }

  html:root body.mw-special-Search #mw-content-text .oo-ui-textInputWidget .oo-ui-inputWidget-input {
    background: var(--xw-code-bg);
    color: var(--xw-ink);
    border-color: var(--xw-line-strong);
    box-shadow: none;
  }
  html:root body.mw-special-Search #mw-content-text .oo-ui-textInputWidget .oo-ui-inputWidget-input:focus {
    border-color: var(--xw-accent);
    box-shadow: 0 0 0 2px var(--xw-accent-soft);
  }
  html:root body.mw-special-Search #mw-content-text .oo-ui-buttonElement-framed .oo-ui-buttonElement-button,
  html:root body.mw-special-Search #mw-content-text :is(.cdx-button, .cdx-select),
  html:root body.mw-special-Search #mw-search-togglebox input[type="button"] {
    background: var(--xw-panel);
    color: var(--xw-link);
    border-color: var(--xw-border);
    border-radius: 4px;
    box-shadow: none;
  }
  html:root body.mw-special-Search #mw-content-text .oo-ui-buttonElement-button .oo-ui-labelElement-label { color: inherit; }
  html:root body.mw-special-Search #mw-content-text .oo-ui-flaggedElement-primary .oo-ui-buttonElement-button {
    background: #0c6888;
    color: #f2fbff;
    border-color: var(--xw-accent);
  }
  html:root body.mw-special-Search #mw-content-text .oo-ui-widget-enabled > .oo-ui-buttonElement-button:hover,
  html:root body.mw-special-Search #mw-content-text .cdx-button:not([disabled]):hover,
  html:root body.mw-special-Search #mw-search-togglebox input[type="button"]:hover {
    background: var(--xw-table-head);
    color: var(--xw-link-hover);
    border-color: var(--xw-line-strong);
  }
  html:root body.mw-special-Search #mw-content-text .oo-ui-flaggedElement-primary.oo-ui-widget-enabled .oo-ui-buttonElement-button:hover { background: #167c9b; color: #f2fbff; }
  html:root body.mw-special-Search #mw-content-text .cdx-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23586d82' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px 16px; padding-right: 30px; }
  html:root body.mw-special-Search #mw-content-text :is(.cdx-button, .cdx-select):focus-visible {
    outline: 2px solid var(--xw-accent);
    outline-offset: 2px;
  }
  html:root body.mw-special-Search #mw-content-text :is(.cdx-button[disabled], .cdx-button--fake-button--disabled, .oo-ui-widget-disabled .oo-ui-buttonElement-button) {
    background: transparent;
    color: var(--xw-muted);
    border-color: transparent;
    opacity: .55;
    cursor: not-allowed;
  }

  html:root body.mw-special-Search #mw-content-text .mw-search-profile-tabs {
    box-sizing: border-box;
    width: 100%;
    margin: 16px 0 22px;
    padding: 6px;
    border: 1px solid var(--xw-border);
    border-radius: 5px;
    background: var(--xw-panel);
    color: var(--xw-ink);
  }
  html:root body.mw-special-Search #mw-content-text .search-types ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  html:root body.mw-special-Search #mw-content-text .search-types li { margin: 0; padding: 0; }
  html:root body.mw-special-Search #mw-content-text .search-types a {
    display: block;
    padding: 7px 12px;
    border-radius: 3px;
    color: var(--xw-muted);
    text-decoration: none;
  }
  html:root body.mw-special-Search #mw-content-text .search-types a:hover { background: var(--xw-hover); color: var(--xw-link); }
  html:root body.mw-special-Search #mw-content-text .search-types .current a {
    background: var(--xw-accent-soft);
    color: var(--xw-link-hover);
    box-shadow: inset 0 -2px var(--xw-accent);
  }

  html:root body.mw-special-Search #mw-searchoptions {
    box-sizing: border-box;
    margin: 0 0 24px;
    padding: 16px 18px;
    border: 1px solid var(--xw-border);
    border-radius: 5px;
    background: var(--xw-surface);
    color: var(--xw-ink);
  }
  html:root body.mw-special-Search #mw-searchoptions :is(legend, h4) { color: var(--xw-heading); }
  html:root body.mw-special-Search #mw-searchoptions .oo-ui-labelElement-label { color: var(--xw-ink); white-space: normal; overflow-wrap: anywhere; }
  html:root body.mw-special-Search #mw-search-togglebox input[type="button"] { margin: 4px; padding: 4px 10px; border-style: solid; border-width: 1px; }
  html:root body.mw-special-Search #mw-searchoptions .divider { border-color: var(--xw-border); }
  html:root body.mw-special-Search #mw-searchoptions .checkbox-wrapper { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 20px; }
  html:root body.mw-special-Search #mw-searchoptions .checkbox-wrapper > div { width: auto; margin: 0; }
  html:root body.mw-special-Search #mw-searchoptions .oo-ui-checkboxInputWidget input + .oo-ui-checkboxInputWidget-checkIcon { background-color: var(--xw-code-bg); border-color: var(--xw-line-strong); }
  html:root body.mw-special-Search #mw-searchoptions .oo-ui-checkboxInputWidget input:checked + .oo-ui-checkboxInputWidget-checkIcon { background-color: #1b658b; border-color: var(--xw-accent); }

  html:root body.mw-special-Search #mw-content-text .cdx-table-pager { flex-wrap: wrap; gap: 8px; padding: 10px 12px; background: var(--xw-panel); color: var(--xw-ink); border-color: var(--xw-border); border-radius: 4px; }
  html:root body.mw-special-Search #mw-content-text .mw-search-result { padding: 14px 0; margin: 0; border-bottom: 1px solid var(--xw-border); }
  html:root body.mw-special-Search #mw-content-text .mw-search-result-heading { margin-bottom: 5px; font-size: 16px; overflow-wrap: anywhere; }
  html:root body.mw-special-Search #mw-content-text .searchresult { color: var(--xw-ink); overflow-wrap: anywhere; }
  html:root body.mw-special-Search #mw-content-text .searchmatch { padding: 0 .08em; border-radius: 2px; background: var(--xw-accent-soft); color: var(--xw-link-hover); }
  html:root body.mw-special-Search #mw-content-text :is(.mw-search-result-data, .mw-search-results-info) { color: var(--xw-muted); }

  html:root body.mw-special-Search .oo-ui-menuSelectWidget,
  html:root body.mw-special-Search .oo-ui-popupWidget-popup { background: var(--xw-surface); color: var(--xw-ink); border-color: var(--xw-border); }
  html:root body.mw-special-Search .oo-ui-menuOptionWidget { color: var(--xw-ink); }
  html:root body.mw-special-Search :is(.oo-ui-optionWidget-highlighted, .oo-ui-optionWidget-selected) { background: var(--xw-table-head); color: var(--xw-link-hover); }
}

@media screen and (max-width: 620px) {
  html:root body.mw-special-Search #mw-searchoptions .checkbox-wrapper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html:root body.mw-special-Search #mw-content-text .search-types a { padding: 7px 9px; font-size: 12px; }
  html:root body.mw-special-Search #mw-searchoptions { padding: 12px; }
}
@media screen and (max-width: 400px) {
  html:root body.mw-special-Search #mw-searchoptions .checkbox-wrapper { grid-template-columns: minmax(0, 1fr); }
}
@media screen {
  :root[data-xuewu-theme="dark"] body.mw-special-Search .oo-ui-textInputWidget > .oo-ui-iconElement-icon,
  :root[data-xuewu-theme="dark"] body.mw-special-Search .oo-ui-textInputWidget > .oo-ui-indicatorElement-indicator,
  :root[data-xuewu-theme="dark"] body.mw-special-Search .cdx-button__icon,
  :root[data-xuewu-theme="dark"] body.mw-special-Search .mw-helplink-icon { filter: brightness(0) invert(.8); }
  :root[data-xuewu-theme="dark"] body.mw-special-Search #searchText input::-webkit-search-cancel-button { filter: brightness(0) invert(.8); }
  :root[data-xuewu-theme="dark"] body.mw-special-Search #mw-content-text .cdx-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%239aaec2' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E"); }
}
