/* Search the Wire: isolated header instrument; no changes to APNU layout engines. */
#bar #wire-search{position:relative;z-index:80;display:flex;align-items:center;flex:0 1 270px;width:270px;min-width:155px;margin:0 10px 0 auto;box-sizing:border-box;text-transform:none;letter-spacing:normal}
#bar:has(#wire-search.is-open){position:relative;z-index:82}
#bar #wire-search .wire-search-box{position:relative;width:100%;min-width:0}
#wire-search .wire-search-field{display:flex;align-items:center;gap:6px;box-sizing:border-box;width:100%;height:37px;padding:0 9px;border:1px solid #acaeae;border-radius:7px;background:#fff;color:#272a2c;box-shadow:inset 0 1px 2px #00000013}
#wire-search .wire-search-glass{flex:none;font:700 22px/1 Arial,sans-serif;color:#6b7478}
#wire-search .wire-search-input{appearance:none;-webkit-appearance:none;box-sizing:border-box;min-width:0;width:100%;height:34px;margin:0;padding:0;border:0;outline:none;background:transparent;color:inherit;font:500 12px/1.3 Arial,Helvetica,sans-serif;letter-spacing:0;text-transform:none;box-shadow:none}
#wire-search .wire-search-input::-webkit-search-cancel-button{display:none}
#wire-search .wire-search-input::placeholder{color:#6a7277;opacity:1}
#wire-search .wire-search-field:focus-within{border-color:#c8102e;box-shadow:0 0 0 2px #c8102e28}
#wire-search .wire-search-clear{appearance:none;flex:none;cursor:pointer;box-sizing:border-box;width:21px;height:26px;border:0;background:none;color:#666;font:22px/1 Arial,sans-serif}
#wire-search .wire-search-clear[hidden],#wire-search .wire-search-panel[hidden]{display:none!important}
#wire-search .wire-search-toggle{display:none;align-items:center;justify-content:center;appearance:none;box-sizing:border-box;cursor:pointer;width:36px;height:36px;padding:0;border:1px solid currentColor;border-radius:7px;background:transparent;color:inherit}
#wire-search .wire-search-toggle:focus-visible{outline:2px solid #c8102e;outline-offset:2px}
#wire-search .wire-search-panel{position:absolute;z-index:200;right:0;top:calc(100% + 6px);width:min(420px,calc(100vw - 20px));max-height:min(520px,67vh);overflow-y:auto;overscroll-behavior:contain;box-sizing:border-box;padding:8px;border:1px solid #aaaeb1;border-radius:10px;background:#fafaf8;color:#252728;box-shadow:0 12px 35px #0004;text-transform:none;text-align:left}
#wire-search .wire-search-heading{margin:0;padding:8px 9px 6px;border-bottom:1px solid #dadada;color:#555;letter-spacing:.11em;font:700 10px/1.3 Arial,sans-serif}
#wire-search .wire-search-summary{margin:0;padding:8px 9px;font:500 11px/1.4 Arial,sans-serif;color:#666}
#wire-search a.wire-search-result{display:block!important;margin:0;padding:9px 10px;border-bottom:1px solid #e3e4e4;text-decoration:none;color:#202428;background:transparent;line-height:1.4}
#wire-search a.wire-search-result:hover,#wire-search a.wire-search-result:focus-visible{background:#e8ebed;color:#151719;outline:2px solid transparent}
#wire-search .wire-search-title{display:block;font:700 13px/1.35 Arial,sans-serif;white-space:normal}
#wire-search .wire-search-meta{display:block;margin-top:4px;color:#67717b;font:500 10px/1.3 Arial,sans-serif;white-space:normal}
#wire-search .wire-search-empty{padding:8px 9px;margin:0;font:12px/1.4 Arial,sans-serif;color:#51575a}
#wire-search .wire-search-archive-action,#wire-search .wire-search-back,#wire-search a.wire-search-archive-link{display:block;appearance:none;cursor:pointer;width:100%;box-sizing:border-box;margin:6px 0 0;padding:10px;border:0;border-radius:5px;background:#ececec;color:#24272a;font:700 11px/1.3 Arial,sans-serif;text-align:left;text-decoration:none}
#wire-search .wire-search-archive-action:hover,#wire-search .wire-search-back:hover,#wire-search a.wire-search-archive-link:hover{background:#d9dee1}
html[data-theme=dark] #bar #wire-search .wire-search-field{background:#131d27;border-color:#536474;color:#e9f2f8}
html[data-theme=dark] #bar #wire-search .wire-search-input::placeholder{color:#a1bac8}
html[data-theme=dark] #bar #wire-search .wire-search-glass{color:#93bdd2}
html[data-theme=dark] #wire-search .wire-search-panel{background:#17232e;border-color:#4d6478;color:#eef4f6;box-shadow:0 15px 34px #0009}
html[data-theme=dark] #wire-search .wire-search-heading,html[data-theme=dark] #wire-search .wire-search-summary,html[data-theme=dark] #wire-search .wire-search-empty{color:#c0ced9;border-color:#34485b}
html[data-theme=dark] #wire-search a.wire-search-result{color:#eef4f6;border-color:#34485b}
html[data-theme=dark] #wire-search a.wire-search-result:hover,html[data-theme=dark] #wire-search a.wire-search-result:focus-visible{background:#26394d;color:#fff}
html[data-theme=dark] #wire-search .wire-search-meta{color:#a0b5c9}
html[data-theme=dark] #wire-search :is(.wire-search-archive-action,.wire-search-back,a.wire-search-archive-link){background:#2e4356;color:#e8f1f7}
html[data-theme=terminal] #wire-search{display:none!important}
@media(min-width:1051px){
 html[data-theme=newsprint] #bar:has(#wire-search) .edition-dateline{margin-left:0!important}
 html[data-theme=dark] #bar:has(#wire-search) #ws{margin-left:0!important}
}
@media(min-width:701px) and (max-width:1239px){
 #bar #wire-search{flex:0 0 36px;width:36px;min-width:36px;margin-left:auto;margin-right:6px}
 #bar #wire-search .wire-search-toggle{display:flex}
 #bar #wire-search .wire-search-box{display:none;position:absolute;top:calc(100% + 6px);right:0;width:min(420px,calc(100vw - 20px))}
 /* Compact popup opens inward rather than beyond the tablet's left edge. */
 #bar #wire-search .wire-search-box{left:0;right:auto}
 #bar #wire-search.is-open .wire-search-box{display:block}
 #bar:has(#wire-search) .edition-dateline{margin-left:0!important}
}
@media(max-width:700px){
 html:is([data-theme=newsprint],[data-theme=dark]) #mast{overflow:visible}
 #mast>#wire-search{position:absolute;right:5px;bottom:0;z-index:85;width:34px;min-width:34px;height:38px;margin:0;padding:0;display:flex;align-items:center;justify-content:center}
 #mast>#wire-search .wire-search-toggle{display:flex;width:32px;height:32px;border:0;color:#fff;background:transparent}
 #mast>#wire-search .wire-search-box{display:none;position:absolute;top:calc(100% + 7px);right:4px;width:min(420px,calc(100vw - 16px))}
 #mast>#wire-search.is-open .wire-search-box{display:block}
 #mast>#wire-search .wire-search-panel{width:100%;max-height:58vh}
 html:is([data-theme=newsprint],[data-theme=dark]) #mast>.edition-dateline .edition-mobile-updated{margin-right:31px!important}
 #mast:has(>#wire-search.is-open){z-index:88}
}
@media(prefers-reduced-motion:reduce){#wire-search *{scroll-behavior:auto!important}}


/* Newsroom correction: keep search in flex flow with the real Audio Wire and
   live status widths. Never overlay the center of a 1200px-capped banner. */
@media(min-width:701px) and (max-width:1239px){
 html[data-theme=newsprint][data-statusat=top] #bar:has(>#wire-search){
  height:auto!important;min-height:62px;row-gap:8px;
 }
}
@media(min-width:1240px){
 html[data-theme=newsprint][data-statusat=top] #bar:has(>#wire-search){
  display:flex;flex-wrap:nowrap;column-gap:8px;
 }
 html[data-theme=newsprint][data-statusat=top] #bar>#wire-search{
  position:relative;left:auto;top:auto;transform:none;
  flex:1 1 225px;width:auto;max-width:250px;min-width:0;
  margin:0 4px 0 auto;
 }
 html[data-theme=newsprint][data-statusat=top] #bar .edition-dateline{
  flex:0 0 auto;margin-left:0!important;
 }
}

/* Tablet portrait: keep all three header instruments on ONE line.
   The Newsroom status capsule becomes a compact, two-line instrument,
   not a second full-width header row. No content or typography is removed. */
@media(min-width:701px) and (max-width:900px){
 html[data-theme=newsprint][data-statusat=top] #bar:has(>#wire-search){
  flex-wrap:nowrap!important;align-items:center;column-gap:8px;
  height:auto!important;min-height:62px;row-gap:0;
 }
 html[data-theme=newsprint][data-statusat=top] #bar>#wire-search{
  flex:0 0 36px;margin:0 auto!important;
 }
 html[data-theme=newsprint][data-statusat=top] #bar>.edition-dateline{
  display:grid!important;
  grid-template-columns:max-content max-content max-content;
  grid-template-rows:auto auto;
  flex:0 1 auto!important;width:max-content;min-width:0!important;
  max-width:calc(100% - 285px);margin:0!important;
  gap:0;padding:3px 8px;border-radius:8px;font-size:10px;
 }
 html[data-theme=newsprint][data-statusat=top] #bar>.edition-dateline .edition-live{
  grid-column:1;grid-row:1 / 3;align-self:center;
  padding:0 8px 0 0;white-space:nowrap;
 }
 html[data-theme=newsprint][data-statusat=top] #bar>.edition-dateline .edition-count{grid-column:2;grid-row:1}
 html[data-theme=newsprint][data-statusat=top] #bar>.edition-dateline .edition-sources{grid-column:3;grid-row:1}
 html[data-theme=newsprint][data-statusat=top] #bar>.edition-dateline .edition-updated{grid-column:2;grid-row:2}
 html[data-theme=newsprint][data-statusat=top] #bar>.edition-dateline .edition-time{grid-column:3;grid-row:2}
 html[data-theme=newsprint][data-statusat=top] #bar>.edition-dateline>span,
 html[data-theme=newsprint][data-statusat=top] #bar>.edition-dateline>time{
  padding:2px 7px;white-space:nowrap;
 }
 /* Night Shift already has a two-line readout inside its toolbar;
    do not push that readout to a separate second bar row either. */
 html[data-theme=dark][data-statusat=top] #bar:has(>#wire-search){
  grid-template-columns:max-content 36px minmax(0,1fr)!important;
  grid-template-rows:auto;height:auto!important;
 }
 html[data-theme=dark][data-statusat=top] #bar>.wire-brand-cluster{
  grid-column:1;grid-row:1;
 }
 html[data-theme=dark][data-statusat=top] #bar>#wire-search{
  grid-column:2;grid-row:1;justify-self:center;margin:0;
 }
 html[data-theme=dark][data-statusat=top] #bar #ws{
  grid-column:3!important;grid-row:1!important;justify-self:end!important;
  width:auto;min-width:0;
 }
}
@media(min-width:901px) and (max-width:1239px){
 html[data-theme=newsprint][data-statusat=top] #bar:has(>#wire-search){
  flex-wrap:nowrap!important;column-gap:8px;
 }
 html[data-theme=newsprint][data-statusat=top] #bar>.wire-brand-cluster{
  flex:0 0 auto;
 }
 html[data-theme=newsprint][data-statusat=top] #bar>#wire-search{
  margin-left:auto;margin-right:0;
 }
 html[data-theme=newsprint][data-statusat=top] #bar>.edition-dateline{
  flex:1 1 auto;min-width:0!important;flex-wrap:wrap;row-gap:5px;
 }
}
