/* ai-round3-b / lane r2: the scheduled-task card of the member AI chat (ai-scheduled-task-card.js).

   The card IS the confirm / cancel card of prepared actions: .agent-capability-action-card and its head, state,
   data, note and controls, styled by ai-agent-capabilities.css and ai-chat-presentation.css. This file only adds
   what that card does not have: the foot slot (so the card keeps its height while the state is read), the red
   reason line, the waiting placeholder, the busy dots, press feedback and 44 px buttons on phones.
   Colours are the page's own tokens (--chat-*, --bb-theme-*); nothing here sets a glass value. */

#chat-center .scheduled-task-card{transform-origin:left top}
#chat-center .scheduled-task-card[data-task-fresh]{animation:scheduled-task-grow .22s cubic-bezier(.2,.8,.2,1)}
@keyframes scheduled-task-grow{from{opacity:0;transform:scale(.94)}to{opacity:1;transform:none}}

#chat-center .scheduled-task-card[data-task-state="active"] .agent-capability-action-state{color:var(--bb-theme-up, #2d6849);border-color:var(--bb-theme-up, rgba(45,104,73,.25));background:rgba(var(--bb-theme-up-rgb, 45,104,73), 0.07)}

#chat-center .scheduled-task-card .scheduled-task-foot{display:grid;gap:8px;align-content:center;min-inline-size:0;min-block-size:38px}

/* Labels never break inside a word (Содержание, Kandungan): the label column is as wide as its longest word, at least the card's usual 88 / 78. */
#chat-center .scheduled-task-card .agent-capability-action-data{grid-template-columns:min-content minmax(0,1fr)}
#chat-center .scheduled-task-card .agent-capability-action-data dt{min-inline-size:88px;overflow-wrap:normal;word-break:normal}
#chat-center .scheduled-task-card .scheduled-task-error{color:var(--bb-theme-down, #d64545)}
/* 确定取消这项任务？ — the one line the second step adds, in the card's own text colour so it is read before the buttons. */
#chat-center .scheduled-task-card .scheduled-task-ask{color:var(--chat-text)}

#chat-center .scheduled-task-card .agent-capability-action-controls button{position:relative;transition:transform .12s ease,opacity .16s ease}
#chat-center .scheduled-task-card .agent-capability-action-controls button:not(:disabled):active{transform:scale(.98)}
#chat-center .scheduled-task-card .agent-capability-action-controls button:focus-visible{outline:2px solid var(--chat-text);outline-offset:2px}
@media (hover: hover) and (pointer: fine){
  #chat-center .scheduled-task-card .agent-capability-action-controls button:not(:disabled):hover{opacity:.86}
}

/* The pressed button keeps its width and shows three dots until the server has answered. */
#chat-center .scheduled-task-card .agent-capability-action-controls button[aria-busy="true"]{color:transparent;cursor:progress}
#chat-center .scheduled-task-card .agent-capability-action-controls button[aria-busy="true"]::after{content:"";position:absolute;inset:0;margin:auto;inline-size:4px;block-size:4px;border-radius:50%;color:var(--chat-action-text);background:currentColor;box-shadow:-9px 0 0 currentColor,9px 0 0 currentColor;animation:scheduled-task-wait 1.2s ease-in-out infinite}
#chat-center .scheduled-task-card .agent-capability-action-controls button.secondary[aria-busy="true"]::after{color:var(--chat-text)}
@keyframes scheduled-task-wait{50%{opacity:.3}}

/* Waiting placeholder: plain rounded bars where the state and the buttons will be, no words. A tint of the text
   colour, so it shows on the light, dark and glass surfaces alike. */
#chat-center .scheduled-task-card .scheduled-task-skeleton{position:relative;display:block;overflow:hidden;border-radius:999px;background:rgba(var(--bb-theme-ink-rgb, 17,17,17), 0.07)}
#chat-center .scheduled-task-card .scheduled-task-skeleton::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,rgba(var(--bb-theme-ink-rgb, 17,17,17), 0),rgba(var(--bb-theme-ink-rgb, 17,17,17), 0.07),rgba(var(--bb-theme-ink-rgb, 17,17,17), 0));transform:translateX(-100%);animation:scheduled-task-sweep 1.4s linear infinite}
#chat-center .scheduled-task-card .scheduled-task-skeleton-chip{flex:0 0 auto;inline-size:52px;block-size:22px}
#chat-center .scheduled-task-card .scheduled-task-skeleton-row{inline-size:min(100%,200px);block-size:38px}
@keyframes scheduled-task-sweep{to{transform:translateX(100%)}}

@media (max-width: 800px),(pointer: coarse){
  #chat-center .scheduled-task-card .scheduled-task-foot{min-block-size:44px}
  #chat-center .scheduled-task-card .agent-capability-action-data dt{min-inline-size:78px}
  #chat-center .scheduled-task-card .scheduled-task-skeleton-row{block-size:44px}
  #chat-center .scheduled-task-card .agent-capability-action-controls button{flex:1 1 auto;min-height:44px;padding-inline:14px;font-size:14px}
}

@media (prefers-reduced-motion: reduce){
  #chat-center .scheduled-task-card[data-task-fresh],
  #chat-center .scheduled-task-card .agent-capability-action-controls button[aria-busy="true"]::after,
  #chat-center .scheduled-task-card .scheduled-task-skeleton::after{animation:none}
  #chat-center .scheduled-task-card .agent-capability-action-controls button{transition:none}
}
