/* One consolidated results layout. CSE wrapper and thumbnail selectors must differ. */
body.search-results .search-container{max-width:1240px;}
body.search-results #site-navbar,body.search-results .searchbar,body.search-results .search-tabs{background:#fff;box-shadow:none;border:0;}
body.search-results .searchbar{padding:16px 0 8px;}
body.search-results .searchbar-logo-wrap{width:235px;padding-left:16px;}
body.search-results .search-logo{width:210px;height:auto;max-width:100%;}
body.search-results .searchbar-group{position:relative;height:48px;border:1px solid #d9dfe7;border-radius:999px;background:#fff;overflow:hidden;margin:0;}
body.search-results .searchbar-group .search-input{height:46px!important;padding:10px 62px 10px 20px!important;border:0!important;border-radius:999px;background:transparent;box-shadow:none!important;font-size:16px;}
body.search-results .searchbar-group .search-btn{position:absolute!important;top:0!important;right:0!important;bottom:0!important;height:46px!important;width:46px!important;padding:0!important;margin:0!important;border:0;border-radius:50%!important;background:#487aca;color:#fff;display:flex;align-items:center;justify-content:center;}
body.search-results .searchbar-group .search-btn .btn-text{display:flex;align-items:center;justify-content:center;}
body.search-results .search-tabs{padding:8px 0 14px;}
body.search-results .search-tabs .nav-tabs{border:0;gap:8px;}
body.search-results .search-tabs .nav-link{height:auto!important;margin:0!important;padding:8px 18px!important;border:1px solid #dce2ea!important;border-radius:999px;color:#333;font-size:14px;}
body.search-results .search-tabs .nav-link::before,body.search-results .search-tabs .nav-link::after{content:none!important;display:none!important;}
body.search-results .search-tabs .nav-link.active{background:#eef4ff;color:#487aca;border-color:#487aca!important;}
.mas-results-main{padding-right:28px!important;min-width:0;}
.mas-results-sidebar{padding:0 12px!important;}
.mas-results-sidebar .card{border-radius:10px;box-shadow:none;}
.mas-results-main .web-result{margin-bottom:20px;display:block!important;}
.mas-results-main .web-result-favicon,.mas-result-site{display:none!important;}
.mas-results-main .web-result-title-heading{font-size:1.25rem;line-height:1.35;}
.mas-results-main .web-result-desc{font-size:.9rem;line-height:1.55;}
#mas-image-top-slot{width:100%;}
.search-images-card.mas-top-images{border:0!important;background:transparent!important;box-shadow:none!important;margin:8px 0 18px!important;}
.mas-top-images .card-body{padding:0!important;}
.mas-top-images .images-card-heading{margin-bottom:10px;font-size:16px;}
.mas-top-images #search-images-cse .gsc-control-cse,.mas-top-images #search-images-cse .gsc-control-wrapper-cse,.mas-top-images #search-images-cse .gsc-resultsRoot,.mas-top-images #search-images-cse .gsc-results.gsc-imageResult{width:100%!important;max-width:100%!important;flex:none!important;margin:0!important;padding:0!important;}
/* Qwant desktop sizing: 180px high, proportional widths (minimum 144px), 8px gap. */
.mas-top-images #search-images-cse .gsc-expansionArea{display:flex!important;flex-wrap:nowrap!important;gap:8px!important;overflow-x:auto!important;scrollbar-width:thin;padding:0 0 8px!important;}
.mas-top-images #search-images-cse .gsc-expansionArea>.gsc-imageResult.gsc-result{flex:0 0 var(--mas-carousel-image-width,180px)!important;width:var(--mas-carousel-image-width,180px)!important;min-width:144px!important;height:180px!important;margin:0!important;padding:0!important;border:0!important;}
.mas-top-images #search-images-cse .gsc-result .gs-result,
.mas-top-images #search-images-cse .gsc-result .gs-image-thumbnail-box,
.mas-top-images #search-images-cse .gsc-result .gs-image-thumbnail-box .gs-image-box,
.mas-top-images #search-images-cse .gsc-result .gs-image-thumbnail-box .gs-image-box>a,
.mas-top-images #search-images-cse .gsc-result .gs-image-thumbnail-box img.gs-image{display:block!important;box-sizing:border-box!important;height:180px!important;width:100%!important;max-width:none!important;margin:0!important;padding:0!important;border:0!important;}
.mas-top-images #search-images-cse .gsc-result .gs-image-thumbnail-box .gs-image-box,
.mas-top-images #search-images-cse .gsc-result .gs-image-thumbnail-box img.gs-image{object-fit:cover!important;border-radius:12px!important;}
.mas-top-images .images-next-button{display:none!important;}
.mas-top-images .mas-image-carousel{display:none!important;}
/* The existing app already supplies Prev/Next inside this wrapper. */
.mas-results-main .gsc-cursor-box{display:block!important;}
.mas-results-main .gsc-cursor-page{display:none!important;}
.mas-results-main .gsc-cursor .myallsearch-page-nav{display:inline-flex!important;}
.mas-web-pagination{display:none!important;}
@media(max-width:767px){.mas-results-main{padding:0 12px!important;}.search-images-card.mas-top-images[style*="display: none"],.search-images-card.mas-top-images[data-main-search-empty="1"]{display:none!important;}body.search-results .searchbar-logo-wrap{width:auto;}body.search-results .search-logo{width:150px;}}
:is(.darkmode,.dark-mode,.theme-dark) #site-navbar,:is(.darkmode,.dark-mode,.theme-dark) .searchbar,:is(.darkmode,.dark-mode,.theme-dark) .search-tabs{background:#242424!important;}
:is(.darkmode,.dark-mode,.theme-dark) .searchbar-group{background:#303030;border-color:#555;}
:is(.darkmode,.dark-mode,.theme-dark) .search-tabs .nav-link{color:#ddd;border-color:#555!important;}
:is(.darkmode,.dark-mode,.theme-dark) .search-tabs .nav-link.active{background:#30415a;color:#91b7f3;}

/* Visible pill tabs, autocomplete dropdown, and native image carousel controls. */
body.search-results .search-tabs .nav-scrollable {height:auto!important;min-height:44px;overflow:visible!important;padding-top:2px;padding-bottom:4px;}
body.search-results .search-tabs .nav {height:auto!important;min-height:42px;align-items:center;}
body.search-results .search-tabs .nav-link {line-height:1.4!important;}
body.search-results .searchbar-group {overflow:visible!important;}
body.search-results .searchbar-group .xdsoft_autocomplete {display:block;width:100%;}
body.search-results .searchbar-group .xdsoft_autocomplete_dropdown {left:0;right:0;top:100%;width:100%!important;max-height:320px;z-index:1200;border:1px solid #d9dfe7;border-radius:12px;background:white;box-shadow:0 8px 24px #00000018;margin-top:5px;}
body.search-results .searchbar-group .search-btn {z-index:3;}
#infobox-list.infobox-card {border:1px solid #dce2e9!important;border-radius:12px!important;background:#fff;box-shadow:none!important;margin-top:8px!important;}
#infobox-list .card-body {padding:18px!important;}
#infobox-list .sidebar-card-heading {font-family:var(--mas-search-font);font-size:1.25rem!important;line-height:1.35!important;font-weight:600;}
#infobox-list .sidebar-card-heading strong {font-size:inherit;font-weight:600;}
.mas-carousel-controls {display:flex;gap:8px;margin-left:auto;}
.mas-carousel-controls button {width:30px;height:30px;border:1px solid #dce1e6;border-radius:50%;background:#f6f7f9;color:#6f7782;font-size:25px;line-height:1;display:flex;align-items:center;justify-content:center;cursor:pointer;}
.mas-carousel-controls button:disabled {opacity:.35;cursor:default;}
.mas-carousel-controls button:focus-visible {outline:2px solid #487aca;outline-offset:2px;}
.mas-top-images #search-images-cse .gsc-expansionArea::-webkit-scrollbar {height:5px;}
.mas-top-images #search-images-cse .gsc-expansionArea::-webkit-scrollbar-thumb {background:#c6ccd4;border-radius:9px;}
:is(.darkmode,.dark-mode,.theme-dark) #infobox-list.infobox-card {background:#303030;border-color:#555!important;}
:is(.darkmode,.dark-mode,.theme-dark) .searchbar-group .xdsoft_autocomplete_dropdown {background:#303030;border-color:#555;}

/* Remove scrolling-tab spacer exposed by the visible pill navigation. */
body.search-results .search-tabs .nav-scrollable .nav-tabs {
  padding: 0 !important;
  margin: 0 !important;
  height: auto !important;
  min-height: 42px;
}

/* Hide only the image carousel scrollbar; retain scrolling and arrow controls. */
.mas-top-images #search-images-cse .gsc-expansionArea {
  scrollbar-width: none !important;
  -ms-overflow-style: none;
}
.mas-top-images #search-images-cse .gsc-expansionArea::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

/* Slightly larger logo and wider right-hand cards on desktop. */
@media (min-width: 992px) {
  body.search-results .searchbar-logo-wrap { width: 265px; }
  body.search-results .search-logo { width: 240px; }
  body.search-results .mas-results-main {
    flex: 0 0 62%;
    max-width: 62%;
  }
  body.search-results .mas-results-sidebar {
    flex: 0 0 38%;
    max-width: 38%;
  }
  body.search-results .mas-results-sidebar > .card { width: 100%; }
}

/* Reference search bar: clean pill, grey clear X and bright blue search button. */
body.search-results .searchbar-group {height:50px;border-radius:999px;border-color:#cdd4df;background:#fff;box-shadow:none;}
body.search-results .searchbar-group .search-input {height:48px!important;padding-right:102px!important;font-size:17px!important;border-radius:999px;}
body.search-results .searchbar-group .search-btn {height:48px!important;width:62px!important;border-radius:999px!important;background:#487aca!important;color:#fff!important;}
body.search-results .searchbar-group .search-btn svg {width:23px;height:23px;}
body.search-results .mas-search-clear {position:absolute;right:72px;top:0;height:48px;width:32px;display:flex;align-items:center;justify-content:center;border:0;background:transparent;color:#697384;padding:0;z-index:4;cursor:pointer;}
body.search-results .mas-search-clear:hover {color:#333;}
body.search-results .mas-search-clear:focus-visible {outline:2px solid #487aca;outline-offset:-3px;border-radius:8px;}
@media(min-width:992px){body.search-results .searchbar .row>.col-md-6 {flex:0 1 640px;max-width:640px;min-width:0;}body.search-results .searchbar-toggler-pull-up{margin-left:22px!important;}}


/* Neutral suggestion hover and keyboard selection. */
body :is(#home-search-group,#searchForm .searchbox-group) .xdsoft_autocomplete_dropdown > div:hover,
body :is(#home-search-group,#searchForm .searchbox-group) .xdsoft_autocomplete_dropdown > div.active {
    background: #eef0f3 !important;
    color: #222 !important;
}
:is(.darkmode,.dark-mode,.theme-dark) body :is(#home-search-group,#searchForm .searchbox-group) .xdsoft_autocomplete_dropdown > div:hover,
:is(.darkmode,.dark-mode,.theme-dark) body :is(#home-search-group,#searchForm .searchbox-group) .xdsoft_autocomplete_dropdown > div.active,
body:is(.darkmode,.dark-mode,.theme-dark) :is(#home-search-group,#searchForm .searchbox-group) .xdsoft_autocomplete_dropdown > div:hover,
body:is(.darkmode,.dark-mode,.theme-dark) :is(#home-search-group,#searchForm .searchbox-group) .xdsoft_autocomplete_dropdown > div.active {
    background: #454a52 !important;
    color: #fff !important;
}


/* Qwant-style identity block for standard Web results only. */
.mas-results-main .web-result .web-result-source{
  display:flex!important;
  align-items:center!important;
  min-height:36px;
  margin:0 0 6px!important;
}
.mas-results-main .web-result .web-result-favicon-wrap{
  flex:0 0 32px;
  width:32px;
  height:32px;
  margin-right:10px;
  border:1px solid #e1e5ea;
  border-radius:50%;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  box-sizing:border-box;
}
.mas-results-main .web-result .web-result-favicon{
  display:block!important;
  width:20px!important;
  height:20px!important;
  max-width:20px!important;
  margin:0!important;
  padding:0!important;
  object-fit:contain;
  border:0;
  border-radius:3px;
}
.mas-results-main .web-result .web-result-source-text{
  min-width:0;
  line-height:1.15;
}
.mas-results-main .web-result .web-result-site-name{
  margin:0 0 3px;
  color:#30343a;
  font-size:14px;
  font-weight:500;
  line-height:1.15;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.mas-results-main .web-result .web-result-domain{
  display:block!important;
  margin:0!important;
  padding:0!important;
  color:#737b86;
  font-size:12px!important;
  font-weight:400;
  line-height:1.15;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.mas-results-main .web-result .web-result-title-heading{
  margin:0 0 5px!important;
  font-size:20px!important;
  line-height:1.25!important;
  font-weight:400;
}
.mas-results-main .web-result .web-result-desc{
  margin:0!important;
  line-height:1.45!important;
}
:is(.darkmode,.dark-mode,.theme-dark) .mas-results-main .web-result .web-result-favicon-wrap{
  background:#fff;
  border-color:#555;
}
:is(.darkmode,.dark-mode,.theme-dark) .mas-results-main .web-result .web-result-site-name{
  color:#f0f1f2;
}
:is(.darkmode,.dark-mode,.theme-dark) .mas-results-main .web-result .web-result-domain{
  color:#aeb4bc;
}


/* Qwant-style supporting text colours; keep existing MyAllSearch result-title blue. */
.mas-results-main .web-result .web-result-site-name {
    color: #2E3034 !important;
}
.mas-results-main .web-result .web-result-domain {
    color: #4F5968 !important;
}
.mas-results-main .web-result .web-result-desc {
    color: #4F5968 !important;
}


/* Dark-mode Web-result supporting text: readable while preserving title blue. */
.darkmode .mas-results-main .web-result .web-result-site-name {
    color: #F1F1F1 !important;
}

.darkmode .mas-results-main .web-result .web-result-domain,
.darkmode .mas-results-main .web-result .web-result-desc {
    color: #C7C7C7 !important;
}


/* Centre mobile search tabs; retain scrolling on narrow screens. */
@media (max-width: 767.98px) {
    body.search-results .search-tabs .nav-scrollable {
        padding-left: 12px !important;
        padding-right: 12px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    body.search-results .search-tabs .nav-scrollable::-webkit-scrollbar {
        display: none;
    }
    /* Extra specificity also overrides the later inline tab-spacing rule. */
    body.search-results .search-tabs .nav-scrollable .nav.nav-tabs {
        width: max-content;
        min-width: 100%;
        justify-content: center;
        flex-wrap: nowrap !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    body.search-results .search-tabs .nav-scrollable .nav {
        overflow: visible !important;
        padding-bottom: 0 !important;
    }
}


/* Larger centred mobile logo, with equal space for the menu on either side. */
@media (max-width: 767.98px) {
    body.search-results .searchbar .searchbar-logo-wrap {
        flex: 0 0 100%;
        width: 100% !important;
        max-width: 100%;
        margin: 0 !important;
        padding: 0 40px !important;
        justify-content: center;
    }
    body.search-results .searchbar .searchbar-logo-wrap > a {
        display: block;
        max-width: 100%;
    }
    body.search-results .searchbar .search-logo {
        display: block;
        width: 280px !important;
        max-width: 100%;
        height: auto !important;
    }
}


/* Wider mobile result cards: one outer gutter, no stacked wrapper padding. */
@media (max-width: 767.98px) {
    body.search-results .search-container:has(> .row > .mas-results-main) {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    body.search-results .mas-results-main {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    body.search-results .mas-results-main .gsc-results.gsc-webResult {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    body.search-results .mas-results-main .gsc-webResult.gsc-result:has(.web-result),
    body.search-results .mas-results-main .gs-webResult.gs-result:has(.web-result) {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}


/* Hide the Web-results image carousel and its toggle on mobile only. */
@media (max-width: 767.98px) {
    body.search-results #mas-image-top-slot,
    body.search-results .search-images-card.mas-top-images,
    body.search-results #show-images-control {
        display: none !important;
    }
}


/* Independent rectangular divider; do not use the card's rounded border. */
body.search-results .search-images-card.mas-top-images {
    border: 0 !important;
    border-radius: 0 !important;
    padding-bottom: 0 !important;
}
body.search-results .search-images-card.mas-top-images::after {
    content: '';
    display: block;
    flex: 0 0 1px;
    width: 100%;
    height: 1px;
    margin-top: 14px;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #e1e5eb;
    pointer-events: none;
}
:is(.darkmode, .dark-mode, .theme-dark) body.search-results .search-images-card.mas-top-images::after,
body.search-results:is(.darkmode, .dark-mode, .theme-dark) .search-images-card.mas-top-images::after {
    background: #505763;
}
