/* Matched search controls, above the input's z-index: 11. */
#nav_search_center #poisk-input-button[data-photo-search-text],
#nav_search_center #photo-search-launch[data-photo-search-launch]{position:absolute;z-index:12;top:50%;bottom:auto;transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:22px;height:22px;margin:0;padding:0;border:0;border-radius:4px;box-sizing:border-box;line-height:1;color:#000;background:transparent;cursor:pointer;transition:color .15s,background-color .15s}
#nav_search_center #poisk-input-button[data-photo-search-text]{right:27px}
#nav_search_center #photo-search-launch[data-photo-search-launch]{right:5px}
#nav_search_center #poisk-input-button[data-photo-search-text]:hover,
#nav_search_center #photo-search-launch[data-photo-search-launch]:hover{color:#000;background:#f0f5f1}
#nav_search_center #poisk-input-button[data-photo-search-text]:focus-visible,
#nav_search_center #photo-search-launch[data-photo-search-launch]:focus-visible{outline:2px solid #087c28;outline-offset:-2px}
#poisk-input-button[data-photo-search-text] #searchLoopDiv{display:flex;align-items:center;justify-content:center;width:20px;height:20px}
#poisk-input-button[data-photo-search-text] svg,
#photo-search-launch[data-photo-search-launch] svg{position:static;display:block;width:20px;height:20px;flex:none;pointer-events:none}
#nav_search_center #poisk-input[data-photo-search-input]{padding-right:50px;flex:1;min-width:0;width:auto}
html.photo-search-open{overflow:hidden}
#photo-search{box-sizing:border-box;width:min(1500px,96vw);max-width:96vw;max-height:94dvh;padding:24px;border:0;border-radius:16px;color:#333;background:white;overflow:auto;font-family:Arial,sans-serif}
#photo-search:has([data-upload]:not([hidden])){width:min(780px,94vw)}
#photo-search::backdrop{background:#0006}
#photo-search [hidden]{display:none!important}
#photo-search header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:18px}
#photo-search h2{font-size:24px;line-height:1.25;margin:0}#photo-search h3{font-size:17px;line-height:1.4;font-weight:600;margin:20px 0 12px}
#photo-search button{cursor:pointer;font:600 14px/1.3 Arial,sans-serif;border:1px solid #087c28;background:#087c28;color:white;padding:11px 18px;border-radius:9px;min-height:42px;box-sizing:border-box;transition:background-color .15s,border-color .15s,box-shadow .15s}
#photo-search button:hover{background:#066522;border-color:#066522}
#photo-search button:active{box-shadow:inset 0 2px 4px #0002}
#photo-search button:focus-visible{outline:3px solid #89c944;outline-offset:3px}
#photo-search [data-close]{font-size:30px;font-weight:400;line-height:1;border:0;background:none;color:#79818a;padding:0;width:36px;height:36px;min-height:36px;flex-shrink:0}
#photo-search [data-close]:hover{background:#f1f3f2;color:#333}
#photo-search .photo-secondary{color:#27603a;background:white;border-color:#cbd8ce}
#photo-search .photo-secondary:hover{background:#edf6ef;border-color:#83ad8e}
#photo-search .photo-drop{border:1px dashed #bdcfc1;padding:24px 16px;text-align:center;border-radius:12px;background:#f8fbf8}
#photo-search .photo-drop.dragging{border-color:green;background:#edf8ed}
#photo-search .photo-drop>div{display:flex;justify-content:center;flex-wrap:wrap;gap:10px}
#photo-search .photo-drop button{margin:0}#photo-search .photo-drop p{font-size:15px;line-height:1.4;margin:14px 0 6px}
#photo-search small{display:block;color:#666;margin:8px 0;font-size:12px;line-height:1.5}
#photo-search [data-examples]{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
#photo-search [data-examples] button{background:white;border:1px solid #e5e9e5;padding:8px;overflow:hidden;border-radius:10px}
#photo-search [data-examples] button:hover{border-color:#83ad8e;background:#f8fbf8;box-shadow:0 2px 8px #183c1510}
#photo-search [data-examples] img{display:block;width:100%;height:112px;object-fit:contain;border-radius:4px}
#photo-search [data-results]{display:grid;grid-template-columns:minmax(180px,280px) 1fr;gap:26px;align-items:start}
#photo-search aside{background:#f4f4f4;border-radius:16px;padding:14px;position:sticky;top:0}
#photo-search aside button{display:block;width:100%;margin-top:10px}
#photo-search .photo-crop{position:relative;overflow:hidden;touch-action:none;user-select:none;line-height:0}
#photo-search [data-preview]{width:100%;height:auto;display:block;pointer-events:none}
#photo-search [data-selection]{position:absolute;box-sizing:border-box;border:3px solid #77cf29;box-shadow:0 0 0 1000px #0007;cursor:move}
#photo-search [data-handle]{position:absolute;width:18px;height:18px;background:#77cf29;border:2px solid white;box-sizing:border-box;border-radius:3px}
#photo-search [data-handle=nw]{left:-5px;top:-5px;cursor:nwse-resize}#photo-search [data-handle=ne]{right:-5px;top:-5px;cursor:nesw-resize}
#photo-search [data-handle=sw]{left:-5px;bottom:-5px;cursor:nesw-resize}#photo-search [data-handle=se]{right:-5px;bottom:-5px;cursor:nwse-resize}
#photo-search [data-cards]{display:flex;flex-wrap:wrap;justify-content:space-around;align-items:flex-end;box-sizing:border-box;line-height:0;width:100%;margin:5px 0 0;padding:0 0 0 3px;list-style:none;min-width:0}
#photo-search [data-cards] .catalog_item{flex:0 0 auto;max-width:100%;box-sizing:border-box}
#photo-search [data-cards] .catfindimage{max-width:100%;object-fit:contain}
#photo-search [data-count]{font-size:20px;background:#f4f4f4;padding:4px 8px;border-radius:5px}
#photo-search [data-count]:empty{display:none}#photo-search [data-status]{font-size:17px;margin:16px 0 0}
#photo-search [data-status]:empty{display:none}
#photo-search [data-retry]{margin-top:14px}

@media(max-width:600px){#photo-search{padding:16px;width:100vw;max-width:100vw;max-height:100dvh;height:100dvh;border-radius:0}#photo-search:has([data-upload]:not([hidden])){width:94vw;height:auto;max-height:92dvh;border-radius:14px}#photo-search h2{font-size:22px}#photo-search [data-results]{grid-template-columns:1fr}#photo-search aside{position:static;max-width:280px;margin:auto}#photo-search [data-examples]{grid-template-columns:repeat(2,1fr)}#photo-search [data-examples] img{height:120px}#photo-search .photo-drop{padding:20px 12px}#photo-search .photo-drop>div{flex-direction:column}#photo-search .photo-drop button{width:100%}#photo-search [data-cards]{padding-left:0}}

/* The empty results area shows actual search stages, not an estimated percentage. */
#photo-search .photo-output{min-width:0;align-self:stretch;position:relative}
#photo-search [data-progress]{min-height:360px;height:100%;box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:36px 20px;gap:14px;background:radial-gradient(ellipse at center,#f2f8f3 0,transparent 65%);border-radius:16px}
#photo-search .photo-progress-ring{position:relative;width:88px;height:88px;margin-bottom:10px}
#photo-search .photo-progress-ring>svg{width:100%;height:100%;fill:none;stroke-width:3.5}
#photo-search .photo-ring-track{stroke:#e0ece3}
#photo-search .photo-ring-spin{stroke:#13853b;stroke-linecap:round;stroke-dasharray:65 149;transform-origin:40px 40px;animation:photo-search-spin 1.3s linear infinite}
#photo-search .photo-progress-ring .photo-progress-icon{position:absolute;width:30px;height:30px;left:29px;top:29px;stroke:#13853b;stroke-width:1.7;stroke-linecap:round}
#photo-search [data-progress-text]{font-size:20px;line-height:1.4;font-weight:600;color:#23442b}
#photo-search .photo-progress-caption{font-size:14px;line-height:1.5;color:#768279;max-width:310px}
#photo-search .photo-progress-steps{display:flex;gap:20px;margin-top:12px;font-size:12px;color:#a0aaa2}
#photo-search .photo-progress-steps span{display:flex;align-items:center;gap:6px}
#photo-search .photo-progress-steps span::before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor}
#photo-search [data-stage=prepare] [data-step=prepare],#photo-search [data-stage=submit] [data-step=submit],#photo-search [data-stage=search] [data-step=search]{color:#087c28;font-weight:600}
#photo-search:has([data-progress]:not([hidden])) [data-status]{display:none}
#photo-search:has([data-progress]:not([hidden])) [data-cards]{display:none}
@keyframes photo-search-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){#photo-search .photo-ring-spin{animation:none}}
@media(max-width:600px){#photo-search [data-progress]{min-height:240px;padding:24px 12px}#photo-search [data-progress-text]{font-size:17px}#photo-search .photo-progress-steps{gap:12px}}

/* Keep the search controls visible while scrolling through the catalog results. */
@media(min-width:601px){
    #photo-search:has([data-results]:not([hidden])){display:flex;flex-direction:column;height:90dvh;overflow:hidden}
    #photo-search:has([data-results]:not([hidden])) header{flex-shrink:0}
    #photo-search [data-results]{flex:1;min-height:0;grid-template-rows:minmax(0,1fr)}
    #photo-search [data-results] aside{position:static;max-height:100%;overflow:auto;box-sizing:border-box;overscroll-behavior:contain}
    #photo-search .photo-output{min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-gutter:stable;padding:6px;box-sizing:border-box}
    #photo-search [data-progress]{min-height:0}
    #photo-search [data-status],#photo-search [data-retry]{flex-shrink:0}
    #photo-search [data-retry]{align-self:flex-start}
}
