/* Small production usability fixes. The design CSS remains in OpenInst.dc.html. */
x-dc{display:block}
button:disabled{opacity:.45;cursor:wait}
button:focus,input:focus,select:focus,textarea:focus{outline:none;box-shadow:none}
button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible,[role="switch"]:focus-visible{
  outline:2px solid #2563eb!important;
  outline-offset:3px;
}
/*
 * Chat composer: the rounded container is the input's visual boundary, so the
 * textarea never draws its own focus ring (the placeholder changes while a task
 * runs, so it cannot be the selector). Focus is shown on the container instead.
 */
textarea[data-r="composer-input"]:focus,
textarea[data-r="composer-input"]:focus-visible{
  outline:none!important;
  box-shadow:none!important;
}
.oi-composer{transition:border-color .15s ease,box-shadow .15s ease}
.oi-composer:focus-within{border-color:#cfcfcf!important;box-shadow:0 2px 14px rgba(0,0,0,.07)!important}
input[data-r="browser-url"]:focus,
input[data-r="browser-url"]:focus-visible{outline:none!important;border-color:#bdbdbd!important}

/* Chat typing indicator (agent is working on a reply). */
.oi-dots{display:inline-flex;align-items:center;gap:4px;height:14px}
.oi-dots i{width:6px;height:6px;border-radius:50%;background:#9a9ca0;display:block;animation:oiDot 1.2s ease-in-out infinite}
.oi-dots i:nth-child(2){animation-delay:.15s}
.oi-dots i:nth-child(3){animation-delay:.3s}
@keyframes oiDot{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
@media (prefers-reduced-motion:reduce){.oi-dots i{animation:none;opacity:.6}}
.oi-browser-live{animation:oiLiveIn .22s ease-out}
@keyframes oiLiveIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.oi-browser-live{animation:none}}

/*
 * Connector data is accessed on demand; OpenInst does not continuously mirror
 * Google/Lark/Feishu/etc. content into a generic local "external data" store.
 * The design export still carries an old Data privacy / External data demo card
 * whose copy implies continuous syncing and whose delete action is broader than
 * that label suggests. Remove that entire UI surface in production. Connector
 * Disconnect, Vault management, task history and Danger zone remain unchanged.
 */
[data-zh="数据隐私"],
[data-zh="管理来自已连接服务的数据"],
div:has(> span > span[data-zh="外部数据"]){display:none!important}

/*
 * Chat-channel disconnect guard UX.
 * Do not permanently advertise or explain disconnection below the channel card.
 * When Disconnect is disabled because it is the last linked chat entry point,
 * explain the constraint only on hover/focus of that disabled control.
 */
[data-zh^="至少保留一个聊天入口"]{display:none!important}
button[data-zh="解绑"]:disabled{
  position:relative;
  overflow:visible;
  opacity:1;
  cursor:not-allowed!important;
}
button[data-zh="解绑"]:disabled:hover::after,
button[data-zh="解绑"]:disabled:focus-visible::after{
  content:"Keep at least one chat channel connected.";
  position:absolute;
  right:0;
  bottom:calc(100% + 9px);
  z-index:90;
  width:max-content;
  max-width:240px;
  padding:8px 11px;
  border:1px solid #e6e6e6;
  border-radius:9px;
  background:#fff;
  color:#3f4145;
  box-shadow:0 6px 20px rgba(0,0,0,.09);
  font-size:12.5px;
  font-weight:400;
  line-height:1.45;
  white-space:normal;
  text-align:left;
  pointer-events:none;
}
html[lang^="zh"] button[data-zh="解绑"]:disabled:hover::after,
html[lang^="zh"] button[data-zh="解绑"]:disabled:focus-visible::after{
  content:"至少保留一个聊天入口";
}

@media(max-width:880px){[data-r="side"]>div:empty{display:none}}

/* Task list titles: two lines max, full text lives in the detail pane. */
.oi-clamp2{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}

/*
 * Installed app (home-screen PWA / Chrome app) on phones with a home indicator:
 * the page runs edge-to-edge (viewport-fit=cover), so the fixed bottom nav and
 * the chat composer above it must clear the safe-area inset.
 */
@media(max-width:880px){
  [data-r="side"]{height:calc(60px + env(safe-area-inset-bottom,0px))!important;padding-bottom:env(safe-area-inset-bottom,0px)!important;box-sizing:border-box!important}
  [data-r="chatwrap"]{height:calc(100dvh - 60px - env(safe-area-inset-bottom,0px))!important}
  [data-r="console-main"]{padding-bottom:calc(84px + env(safe-area-inset-bottom,0px))!important}
  [data-r="console-main"][data-chat="1"]{padding-bottom:0!important}
}
@media(display-mode:standalone){
  html,body{overscroll-behavior-y:none}
}
