/* Running-module bar shared by 识鸟、群鸟与问鸟. */
.input-capsule-slot{position:sticky;top:8px;z-index:72}
/* Navigation and its menus stay above the ordinary capsule. A full-screen
   preview is a modal and temporarily sits above both navigation layers. */
body:not(.public-publish-shell) .topnav{z-index:130}
body:not(.public-publish-shell) :is(.nav-launcher,#nav-dropdown){z-index:140!important}
body:not(.public-publish-shell) .image-upload-overlay:not(.hidden){z-index:160}
.public-publish-shell>header.public-topnav{position:sticky;top:0;z-index:130}
body:not(.public-publish-shell) :is(#page-vision.active,#page-flock.active,#page-reasoning.active):has(.upload-preview-overlay:not(.hidden)) .input-capsule-slot{z-index:160!important}
.environment-capsule.is-module-bar .upload-capsule-bar,
.reasoning-upload.is-module-bar .upload-capsule-bar{
  border-color:rgba(174,193,213,.72);
  background:linear-gradient(135deg,rgba(252,254,255,.78),rgba(235,242,249,.66));
  box-shadow:0 8px 28px rgba(39,63,88,.12),inset 0 1px 0 rgba(255,255,255,.86);
  -webkit-backdrop-filter:blur(22px) saturate(148%);
  backdrop-filter:blur(22px) saturate(148%);
}
.environment-capsule.is-module-bar:not(.is-expanded) .upload-capsule-bar{height:52px;min-height:52px;border-radius:17px;padding:5px 8px}
.environment-capsule.is-module-bar:not(.is-expanded) .environment-capsule-thumb-button,
.environment-capsule.is-module-bar:not(.is-expanded) .upload-capsule-actions,
.reasoning-upload.is-module-bar:not(.is-context-expanded) .upload-capsule-icon,
.reasoning-upload.is-module-bar:not(.is-context-expanded) .upload-capsule-thumb,
.reasoning-upload.is-module-bar:not(.is-context-expanded) .upload-capsule-actions{display:none}
.environment-capsule.is-module-bar:not(.is-expanded) .environment-capsule-summary,
.reasoning-upload.is-module-bar:not(.is-context-expanded) .upload-capsule-main{height:34px;min-height:34px;width:100%;padding:0 9px}
.environment-capsule.is-module-bar:not(.is-expanded) .upload-capsule-copy,
.reasoning-upload.is-module-bar:not(.is-context-expanded) .upload-capsule-copy{display:block;min-width:0;width:100%}
.environment-capsule.is-module-bar:not(.is-expanded) .upload-capsule-copy small,
.environment-capsule.is-module-bar:not(.is-expanded) .environment-capsule-state,
.reasoning-upload.is-module-bar:not(.is-context-expanded) .upload-capsule-copy small{display:none}
.environment-capsule.is-module-bar:not(.is-expanded) .upload-capsule-copy b,
.reasoning-upload.is-module-bar:not(.is-context-expanded) .upload-capsule-copy b{--module-dot:#5b86c2;--module-dot-halo:rgba(91,134,194,.12);display:flex;align-items:center;min-width:0;min-height:20px;padding-left:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#48657f;font-size:11.5px;font-weight:680;line-height:20px;letter-spacing:.01em}
.environment-capsule.is-module-bar:not(.is-expanded) .upload-capsule-copy b::before,
.reasoning-upload.is-module-bar:not(.is-context-expanded) .upload-capsule-copy b::before{content:"";display:block;flex:0 0 15px;width:15px;height:15px;margin:0 6px 0 0;border-radius:50%;background:radial-gradient(circle at center,var(--module-dot) 0 3.5px,var(--module-dot-halo) 4px 100%);animation:llm-module-breathe 1.35s ease-in-out infinite}
.environment-capsule.is-module-bar[data-module-state="done"] .upload-capsule-copy b::before,
.reasoning-upload.is-module-bar[data-module-state="done"] .upload-capsule-copy b::before{--module-dot:#5c9974;--module-dot-halo:rgba(92,153,116,.12);animation:none}
.environment-capsule.is-module-bar[data-module-state="error"] .upload-capsule-copy b::before,
.reasoning-upload.is-module-bar[data-module-state="error"] .upload-capsule-copy b::before{--module-dot:#c96b64;--module-dot-halo:rgba(201,107,100,.12);animation:none}
.reasoning-upload.is-module-bar{position:relative;z-index:7}
.reasoning-upload.is-module-bar:not(.is-context-expanded) .upload-capsule-bar{width:100%;height:var(--reasoning-capsule-height,42px);min-height:var(--reasoning-capsule-height,42px);max-height:var(--reasoning-capsule-height,42px);padding:4px 5px 4px 7px;border-radius:12px;box-sizing:border-box;cursor:pointer}
/* The upload capsule is also the live progress header. Keep the legacy
   one-line status hidden while it is active, including when its input card
   opens, so the status cannot insert a row above the result conversation. */
:is(#page-vision,#vision):has(.environment-capsule.is-module-bar) #vision-status,
:is(#page-flock,#flock):has(.environment-capsule.is-module-bar) #flock-status{display:none}
@keyframes llm-module-breathe{0%,100%{opacity:.55;transform:scale(.82)}50%{opacity:1;transform:scale(1)}}

.habitat-inspect-popover{position:fixed;z-index:160;display:flex;width:min(300px,calc(100vw - 20px));max-height:min(240px,calc(100dvh - 20px));min-width:0;flex-direction:column;overflow:hidden;border:1px solid color-mix(in srgb,var(--habitat-color) 18%,#d8e1e8);border-radius:13px;background:linear-gradient(145deg,color-mix(in srgb,var(--habitat-bg) 58%,rgba(253,254,255,.91)),rgba(244,248,251,.88));box-shadow:0 12px 34px rgba(32,49,66,.14),inset 0 1px 0 rgba(255,255,255,.42);-webkit-backdrop-filter:blur(18px) saturate(116%);backdrop-filter:blur(18px) saturate(116%);color:#52606d;box-sizing:border-box;animation:habitat-pop-in .16s ease-out}
.habitat-inspect-popover[hidden]{display:none}
.habitat-inspect-popover[data-placement="top"]::before{position:absolute;right:0;bottom:-10px;left:0;height:10px;content:""}
.habitat-inspect-body{min-height:0;padding:8px;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
.habitat-inspect-terms{display:flex;width:100%;flex-wrap:wrap;justify-content:space-between;column-gap:5px;row-gap:5px}
.habitat-inspect-terms::after{content:"";flex:1 1 0;min-width:0;height:0}
.habitat-inspect-term{display:inline-flex;max-width:100%;min-width:0;min-height:24px;align-items:center;justify-content:center;padding:3px 7px;border:1px solid color-mix(in srgb,var(--habitat-color) 14%,#dfe6eb);border-radius:7px;background:rgba(255,255,255,.46);color:var(--habitat-color);font-size:10.5px;line-height:1.25;text-align:center;white-space:normal;overflow-wrap:anywhere;word-break:break-word;box-sizing:border-box}
.habitat-inspect-term.is-current{border-color:color-mix(in srgb,var(--habitat-color) 54%,#fff);background:color-mix(in srgb,var(--habitat-bg) 72%,rgba(255,255,255,.38));box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--habitat-color) 15%,transparent);font-weight:680}
:is(#page-vision,#page-flock,#page-reasoning,#vision,#flock,#reasoning,#llm-detail-overlay) :is([data-habitat-category],[data-habitat-term]){cursor:default;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
:is(#page-vision,#page-flock,#page-reasoning,#vision,#flock,#reasoning,#llm-detail-overlay) .ai-semantic-tag:is([data-habitat-category],[data-habitat-term]){max-width:100%;justify-content:center;text-align:center;white-space:normal;overflow-wrap:anywhere;word-break:break-word}
:is(#page-vision,#page-flock,#page-reasoning,#vision,#flock,#reasoning,#llm-detail-overlay) .habitat-inspect-trigger:focus-visible{outline:2px solid color-mix(in srgb,var(--ai-tag-color,var(--choice-color,#5b86c2)) 66%,#fff);outline-offset:2px}
@keyframes habitat-pop-in{from{opacity:0;transform:translateY(5px) scale(.98)}to{opacity:1;transform:none}}
@media(max-width:640px){
  .input-capsule-slot{top:6px}
  .environment-capsule.is-module-bar:not(.is-expanded) .upload-capsule-bar{height:60px;min-height:60px;padding:7px}
  .environment-capsule.is-module-bar:not(.is-expanded) .environment-capsule-summary,
  .reasoning-upload.is-module-bar:not(.is-context-expanded) .upload-capsule-bar{padding:3px 5px 3px 7px}
  .reasoning-upload.is-module-bar:not(.is-context-expanded) .upload-capsule-main{height:44px;min-height:44px;padding:0 8px}
  .habitat-inspect-popover{width:min(260px,calc(100vw - 16px));max-height:min(168px,calc(100dvh - 16px));border-radius:11px}
  .habitat-inspect-body{padding:7px}
  .habitat-inspect-terms{column-gap:4px;row-gap:4px}
  .habitat-inspect-term{min-height:22px;padding:2px 6px;border-radius:6px;font-size:10px}
}
@media(prefers-reduced-motion:reduce){.environment-capsule.is-module-bar .upload-capsule-copy b::before,.reasoning-upload.is-module-bar .upload-capsule-copy b::before,.habitat-inspect-popover{animation:none}}
/* Controlled reference-image resources shared by identify, ask-bird and detail views. */
.bird-reference-avatar{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:0 0 58px;width:58px;height:58px;padding:0;overflow:hidden;border:1px solid rgba(204,216,226,.9);border-radius:50%;background:linear-gradient(145deg,rgba(246,249,251,.96),rgba(229,237,243,.9));color:#8ba0b1;cursor:pointer}
.bird-reference-avatar img{position:absolute;inset:0;z-index:1;width:100%;height:100%;object-fit:cover}
.bird-reference-placeholder{display:flex;align-items:center;justify-content:center;width:100%;height:100%;opacity:.72}
.bird-reference-placeholder svg{width:56%;height:56%;fill:none;stroke:currentColor;stroke-width:1.35;stroke-linecap:round;stroke-linejoin:round}
.bird-reference-avatar:not(.is-empty) .bird-reference-placeholder{opacity:.3}
.bird-reference-avatar.is-empty{cursor:default}
.bird-reference-hero{display:flex;align-items:center;gap:13px;min-width:0;margin:4px 0 12px}
.bird-reference-hero>div{min-width:0}
.bird-reference-hero .llm-detail-headline{margin:0}
.bird-detail-reference-head{margin:0}
.bird-detail-reference-head .bird-reference-avatar{flex-basis:48px;width:48px;height:48px}
.vision-final-candidate-layout{display:grid;grid-template-columns:58px minmax(0,1fr);gap:11px;align-items:start}
.bird-reference-strip{display:flex;gap:9px;max-width:100%;margin:0 0 12px;padding:10px;overflow-x:auto;border:1px solid rgba(214,223,230,.72);border-radius:14px;background:rgba(247,250,252,.68)}
.bird-reference-chip{display:flex;align-items:center;gap:7px;flex:0 0 auto;max-width:180px;color:#5d6d7c;font-size:11px}
.bird-reference-chip .bird-reference-avatar{flex-basis:46px;width:46px;height:46px}
.bird-reference-chip>span{max-width:112px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.bird-reference-overlay{position:fixed;inset:0;z-index:10080;display:grid;place-items:center;padding:30px;background:rgba(225,232,238,.3);-webkit-backdrop-filter:blur(3px) saturate(104%);backdrop-filter:blur(3px) saturate(104%)}
.bird-reference-overlay.hidden{display:none}
.bird-reference-viewer{display:flex;flex-direction:column;align-items:center;gap:10px;max-width:min(900px,100%);max-height:calc(100dvh - 60px);margin:0}
.bird-reference-frame{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:9px;max-width:100%}
.bird-reference-nav{display:grid;width:34px;height:44px;place-items:center;padding:0;border:1px solid rgba(190,205,217,.86);border-radius:9px;background:rgba(252,254,255,.9);color:#58738c;font-size:25px;line-height:1;cursor:pointer}
.bird-reference-nav[hidden]{display:none}
.bird-reference-stage{position:relative;display:flex;align-items:center;justify-content:center;min-width:min(68vw,320px);min-height:min(68vw,320px);max-width:100%;max-height:calc(100dvh - 110px);overflow:hidden;border-radius:18px;background:rgba(245,249,251,.82);color:#8799a8;box-shadow:0 24px 80px rgba(31,48,64,.18)}
.bird-reference-stage img{position:relative;z-index:1;display:block;max-width:min(900px,92vw);max-height:calc(100dvh - 110px);width:auto;height:auto;object-fit:contain}
.bird-reference-stage>.bird-reference-placeholder{position:absolute;inset:0}
.bird-reference-stage:not(.is-empty)>.bird-reference-placeholder{opacity:.22}
.bird-reference-viewer figcaption{color:#536576;font-size:13px;font-weight:680;text-align:center}
.llm-result-media-trigger{cursor:zoom-in}
.llm-dialog-portrait-close{display:none}

/* Publish owns explicit modal close buttons. Match the local portrait contract:
   a reliable 44px target with a quiet 22px surface and 13px glyph. */
.public-publish-shell :is(
  .llm-dialog-portrait-close,
  .upload-preview-head>.upload-capsule-action[aria-label*="关闭"],
  .image-overlay-head>.input-action[aria-label*="关闭"]
){
  position:absolute!important;top:7px!important;right:7px!important;z-index:90!important;
  display:grid!important;box-sizing:border-box!important;width:44px!important;height:44px!important;
  min-width:44px!important;min-height:44px!important;place-items:center;padding:0!important;
  border:0!important;border-radius:0!important;background:transparent!important;color:transparent!important;
  font-size:0!important;line-height:0!important;opacity:1!important;box-shadow:none!important;
  pointer-events:auto!important;cursor:pointer;isolation:isolate;-webkit-backdrop-filter:none!important;backdrop-filter:none!important
}
.public-publish-shell :is(
  .llm-dialog-portrait-close,
  .upload-preview-head>.upload-capsule-action[aria-label*="关闭"],
  .image-overlay-head>.input-action[aria-label*="关闭"]
)::before{
  content:""!important;position:absolute!important;inset:11px!important;z-index:0!important;pointer-events:none;
  border:1px solid rgba(151,169,185,.26)!important;border-radius:6px!important;
  background:rgba(249,252,254,.42)!important;box-shadow:0 1px 4px rgba(40,58,76,.035)!important;
  -webkit-backdrop-filter:blur(7px);backdrop-filter:blur(7px)
}
.public-publish-shell :is(
  .llm-dialog-portrait-close,
  .upload-preview-head>.upload-capsule-action[aria-label*="关闭"],
  .image-overlay-head>.input-action[aria-label*="关闭"]
)::after{
  content:"×"!important;position:absolute!important;inset:0!important;z-index:1!important;
  display:grid!important;place-items:center;color:rgba(76,96,116,.54)!important;
  font:400 13px/1 system-ui!important;pointer-events:none
}
.public-publish-shell :is(.llm-detail-card,.vision-target-card,.target-picker-card,.bird-reference-stage,.upload-preview-card,.image-overlay-card){position:relative}
.public-publish-shell :is(.llm-detail-head,.vision-target-heading,.target-picker-head,.upload-preview-head,.image-overlay-head){padding-right:60px}
.public-publish-shell .llm-detail-card{isolation:isolate}
.public-publish-shell .llm-detail-card>.llm-detail-head{position:relative;z-index:0}
.public-publish-shell .llm-detail-card>.llm-dialog-portrait-close{
  z-index:2!important;transform:translateZ(1px);will-change:transform
}
.public-publish-shell .page.active:has(.upload-preview-overlay:not(.hidden)) .input-capsule-slot{z-index:160!important}
.public-publish-shell :is(
  .llm-dialog-portrait-close,
  .upload-preview-head>.upload-capsule-action[aria-label*="关闭"],
  .image-overlay-head>.input-action[aria-label*="关闭"]
):is(:hover,:focus-visible){outline:0!important}
.public-publish-shell :is(
  .llm-dialog-portrait-close,
  .upload-preview-head>.upload-capsule-action[aria-label*="关闭"],
  .image-overlay-head>.input-action[aria-label*="关闭"]
):hover::before{border-color:rgba(125,148,168,.42)!important;background:rgba(253,254,255,.68)!important}
.public-publish-shell :is(
  .llm-dialog-portrait-close,
  .upload-preview-head>.upload-capsule-action[aria-label*="关闭"],
  .image-overlay-head>.input-action[aria-label*="关闭"]
):hover::after{color:rgba(62,82,102,.72)!important}
.public-publish-shell :is(
  .llm-dialog-portrait-close,
  .upload-preview-head>.upload-capsule-action[aria-label*="关闭"],
  .image-overlay-head>.input-action[aria-label*="关闭"]
):focus-visible::before{
  border-color:rgba(91,134,194,.64)!important;background:rgba(253,254,255,.76)!important;
  box-shadow:0 0 0 2px rgba(91,134,194,.20)!important
}
.public-publish-shell :is(
  .llm-dialog-portrait-close,
  .upload-preview-head>.upload-capsule-action[aria-label*="关闭"],
  .image-overlay-head>.input-action[aria-label*="关闭"]
):focus-visible::after{color:rgba(55,78,104,.82)!important}
#page-reasoning .reasoning-input-slot{flex:0 0 auto}
.vision-city-branch{z-index:10120!important;pointer-events:auto;overscroll-behavior:contain;touch-action:pan-y}

/* Month remains a distinct semantic filter, but purple is reserved for the
   compact-mode logo. Apply the same warm date palette in landscape and
   portrait so the responsive layer never rethemes the control. */
:is(#vision-month,#flock-month,#batch-month) .vision-choice{
  --choice-bg:#f8f1e6!important;
  --choice-color:#8f6a38!important;
}
:is(#vision-habitat,#flock-habitat,#batch-habitat) .vision-choice[data-value="高原"]{
  --choice-bg:#eef3e8!important;
  --choice-color:#617445!important;
}
@media(max-width:640px){
  .bird-reference-avatar{flex-basis:50px;width:50px;height:50px}
  .vision-final-candidate-layout{grid-template-columns:50px minmax(0,1fr);gap:9px}
  .bird-reference-overlay{padding:12px}
  .bird-reference-viewer{max-height:calc(100dvh - 24px)}
  .bird-reference-stage{grid-column:1;grid-row:1;width:100%;min-width:0;min-height:0;max-height:calc(100dvh - 68px);aspect-ratio:1;border-radius:14px}
  .bird-reference-stage img{max-width:94vw;max-height:calc(100dvh - 68px)}
  .bird-reference-frame{position:relative;width:min(88vw,300px);grid-template-columns:minmax(0,1fr);gap:0}
  .bird-reference-nav{grid-column:1;grid-row:1;z-index:9;width:28px;height:40px;align-self:center;border-radius:7px;font-size:21px}
  .bird-reference-nav.is-prev{justify-self:start;margin-left:4px}.bird-reference-nav.is-next{justify-self:end;margin-right:4px}
  .llm-dialog-portrait-close{position:absolute;top:7px;right:7px;z-index:8;width:30px;height:30px;min-width:30px!important;min-height:30px!important;padding:0;border:1px solid rgba(192,205,216,.85);border-radius:8px;background:rgba(252,254,255,.94);color:#63798e;font-size:18px;line-height:1;cursor:pointer;box-shadow:0 3px 12px rgba(42,61,81,.12)}
  .llm-detail-card.is-oversized>.llm-dialog-portrait-close,.vision-target-card>.llm-dialog-portrait-close,.target-picker-card>.llm-dialog-portrait-close,.bird-reference-stage>.llm-dialog-portrait-close{display:grid;place-items:center}
  .bird-reference-viewer,.vision-target-card,.target-picker-card{position:relative}
}

/* Keep the published Display photo as large and softly rounded as the local
   viewer.  Flock annotation media has its own pan and zoom layout. */
.public-publish-shell .bird-reference-overlay:not(.is-flock-annotation) .bird-reference-viewer{
  width:min(800px,100%);
}
.public-publish-shell .bird-reference-overlay:not(.is-flock-annotation) .bird-reference-frame{
  display:block;
  width:min(78dvh,760px,calc(100vw - 36px));
  max-width:100%;
}
.public-publish-shell .bird-reference-overlay:not(.is-flock-annotation) .bird-reference-stage{
  width:100%;
  overflow:hidden!important;
  border-radius:18px!important;
}
.public-publish-shell .bird-reference-overlay:not(.is-flock-annotation) .bird-reference-stage>img{
  position:relative!important;inset:auto!important;width:93%!important;height:auto!important;
  max-width:93%!important;max-height:93%!important;object-fit:contain!important;object-position:center!important;
  border-radius:14px!important;
}
.public-publish-shell .bird-reference-overlay:not(.is-flock-annotation) .bird-reference-stage[data-photo-orientation="portrait"]>img{
  width:auto!important;height:93%!important;
}
@media(max-width:640px){
  .public-publish-shell .bird-reference-overlay:not(.is-flock-annotation) .bird-reference-frame{
    width:min(92vw,78dvh,760px);
  }
  .public-publish-shell .bird-reference-overlay:not(.is-flock-annotation) .bird-reference-stage{
    border-radius:14px!important;
  }
  .public-publish-shell .bird-reference-overlay:not(.is-flock-annotation) .bird-reference-stage>img{
    border-radius:12px!important;
  }
}

/* The phone preview is visually portrait even inside a landscape desktop
   window. Only a standard landscape layout suppresses popup exit controls. */
@media (orientation:landscape){
  html:not([data-brand-visual-mode="phone"]) body[class] :is(
    .llm-dialog-portrait-close,
    .portrait-dialog-close,
    .portrait-dialog-native-close,
    .image-library-viewer-close,
    .upload-preview-head>.upload-capsule-action[aria-label*="关闭"],
    .image-overlay-head>.input-action[aria-label*="关闭"]
  ){display:none!important}
}
@media (orientation:landscape) and (max-width:600px){
  html[data-brand-visual-mode="phone"] body[class] :is(
    .llm-dialog-portrait-close,
    .portrait-dialog-close,
    .portrait-dialog-native-close,
    .image-library-viewer-close,
    .upload-preview-head>.upload-capsule-action[aria-label*="关闭"],
    .image-overlay-head>.input-action[aria-label*="关闭"]
  ){display:none!important}
}
