/* The slot reserves only the resting width. Its glass surface grows back toward the brand. */
.site-search-slot {
  --resting-width: 7.6rem;
  --editing-width: 14.5rem;
  position: relative;
  z-index: 2;
  flex: 0 0 var(--resting-width);
  inline-size: var(--resting-width);
  block-size: 44px;
  pointer-events: auto;
}
.site-search-capsule {
  position: absolute;
  inset-block: 0;
  inset-inline-end: 0;
  inline-size: 100%;
  isolation: isolate;
  border-radius: 999px;
  color: #f5f8ff;
  box-shadow: 0 10px 30px -15px rgb(0 2 9 / 76%), 0 2px 5px rgb(0 4 14 / 25%);
  transition: inline-size 230ms cubic-bezier(.22,.72,.3,1);
}
.site-search-slot.is-editing .site-search-capsule { inline-size: var(--editing-width); }
.site-search-capsule::before, .site-search-capsule::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}
.site-search-capsule::before {
  z-index: -2;
  background: linear-gradient(114deg, rgb(230 246 255 / 10%), transparent 34%, rgb(0 10 26 / 9%) 63%, rgb(229 242 255 / 7%)), rgb(19 36 56 / 15%);
  backdrop-filter: blur(3px) saturate(1.27);
  -webkit-backdrop-filter: blur(3px) saturate(1.27);
  box-shadow: inset 0 2px 4px -2px rgb(255 255 255 / 46%), inset 0 -3px 5px -3px rgb(165 210 246 / 40%);
}
.site-search-capsule::after {
  z-index: -1;
  padding: 1px;
  background: linear-gradient(151deg, rgb(230 248 255 / 80%), rgb(208 236 255 / 29%) 21%, rgb(188 219 249 / 9%) 42%, rgb(194 226 253 / 17%) 66%, rgb(239 251 255 / 65%) 89%, rgb(219 243 255 / 37%));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
.site-search-capsule .site-search-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: inherit;
  color: inherit;
  cursor: pointer;
  font: 500 14px/1.2 "Segoe UI", "Microsoft YaHei", sans-serif;
  white-space: nowrap;
}
.site-search-capsule .site-search-entry:hover { background: rgb(226 239 248 / 6%); }
.site-search-capsule .site-search-entry:focus-visible {
  outline: 1px solid #c2d6e5; outline-offset: 2px;
}
.site-search-capsule:has(input:focus-visible) { box-shadow: inset 0 0 0 1px #adccdd80, 0 4px 16px #03081040; }
.site-search-capsule [hidden], html[data-search-placement] .site-search-slot { display: none; }
.site-search-capsule .search-glyph { position: relative; display:block; flex:none; width: 17px; height: 17px; }
.site-search-capsule .search-glyph::before { content: ""; position: absolute; inset: 1px 4px 4px 1px; border: 1.7px solid currentColor; border-radius: 50%; }
.site-search-capsule .search-glyph::after { content: ""; position: absolute; width: 7px; height: 1.7px; right: 0; bottom: 2px; background: currentColor; border-radius: 2px; transform: rotate(45deg); }
html:not([data-search-placement]) body > header:has(> .right-glass) { grid-template-columns: minmax(0,1fr) auto auto; column-gap: 12px; }
header > .site-search-slot { grid-area: 1 / 2; }
header > .site-search-slot + .right-glass { grid-area: 1 / 3; }
.partner-header-inner > .site-search-slot, .catalog-header > .site-search-slot, .reader-head > .site-search-slot { margin-inline-start: auto; }
html:not([data-search-placement]) .partner-header-inner { column-gap: 12px; }
.reader-head > .site-search-slot + .doc-actions { margin-left: 0; }
@media(max-width: 899px) {
  .site-search-slot { --resting-width: 44px; --editing-width: 13rem; }
  .site-search-entry .search-label { display: none; }
}
@media(max-width: 700px) {
  html:not([data-search-placement]) :is(body > header:has(> .right-glass), .partner-header-inner) {
    display: grid; height: auto; grid-template-columns: minmax(0,1fr) 44px; grid-template-rows: auto auto; gap: 4px 8px;
  }
  html:not([data-search-placement]) :is(header > .brand, .partner-header-inner > .catalog-brand) { grid-area: 1 / 1; }
  :is(header, .partner-header-inner) > .site-search-slot { grid-area: 1 / 2; justify-self: end; }
  :is(header, .partner-header-inner) > .site-search-slot + :is(.right-glass, .glass-nav) { grid-area: 2 / 1 / 3 / -1; justify-self: end; }
}
@media(max-width: 480px) {
  .catalog-header:not(.partner-header) { display:grid; grid-template-columns: minmax(0,1fr) auto; height: auto; padding-block: 6px; gap: 2px 8px; }
  .catalog-header > .site-search-slot { grid-area: 1 / 2; }
  .catalog-header > .catalog-home { grid-area: 2 / 1 / 3 / -1; justify-self: end; }
  .reader-head:has(> .site-search-slot.is-editing) > .doc-id { visibility: hidden; }
}
@media (max-width: 480px), (min-width: 701px) and (max-width: 960px) {
  :is(header,.partner-header-inner):has(> .site-search-slot.is-editing) > :is(.brand,.catalog-brand) > :not(.brand-symbol) { visibility: hidden; }
}
@media(prefers-reduced-motion: reduce) {
  .site-search-capsule { transition: none; }
}
