/* Agent status badge (contract C2). Tone colors use the existing semantic tokens.
   Green is idle availability, not model connectivity. Only .aw-status-spinner moves,
   and only when the user has not asked for reduced motion. */

.aw-status{
  display:inline-flex;
  align-items:center;
  gap:6px;
  position:relative;
  vertical-align:middle;
  padding:2px 8px;
  border:1px solid transparent;
  border-radius:999px;
  font-size:12px;
  font-weight:600;
  line-height:1.4;
  white-space:nowrap;
}
.aw-status[data-tone="ok"]{
  color:var(--ui-success);
  background:var(--ui-success-surface);
  border-color:var(--ui-success-line);
}
.aw-status[data-tone="busy"]{
  color:var(--ui-ink);
  background:var(--ui-soft);
  border-color:var(--ui-line);
}
.aw-status[data-tone="wait"]{
  color:var(--ui-warning);
  background:var(--ui-warning-surface);
  border-color:var(--ui-warning-line);
}
.aw-status[data-tone="alert"]{
  color:var(--ui-danger);
  background:var(--ui-danger-surface);
  border-color:var(--ui-danger-line);
}
.aw-status[data-tone="neutral"]{
  color:var(--ui-muted);
  background:var(--ui-soft);
  border-color:var(--ui-line);
}

.aw-status-mark,
.aw-status-spinner{
  display:inline-block;
  flex:none;
}
/* Filled circle. Other tones override the shape so status is not color alone. */
.aw-status-mark{
  width:8px;
  height:8px;
  border-radius:50%;
  background:currentcolor;
}
.aw-status[data-tone="wait"] .aw-status-mark{
  border-radius:0;
}
/* Triangle. content-box keeps the border visible under the global border-box reset. */
.aw-status[data-tone="alert"] .aw-status-mark{
  box-sizing:content-box;
  width:0;
  height:0;
  border-radius:0;
  background:transparent;
  border-style:solid;
  border-width:0 5px 9px 5px;
  border-color:transparent transparent currentcolor transparent;
}
.aw-status[data-tone="neutral"] .aw-status-mark{
  width:12px;
  height:3px;
  border-radius:1px;
}

/* Static ring. The spin is added only inside prefers-reduced-motion: no-preference. */
.aw-status-spinner{
  box-sizing:content-box;
  width:10px;
  height:10px;
  border-radius:50%;
  border:2px solid currentcolor;
  background:transparent;
  animation:none;
}

.aw-status--compact{
  gap:0;
  padding:0;
}
.aw-status--compact[data-tone]{
  background:transparent;
  border-color:transparent;
}
/* Visually hidden, still in the accessibility tree. */
.aw-status--compact .aw-status-text{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap;
  border:0;
}

@media (prefers-reduced-motion: no-preference){
  .aw-status-spinner{
    border-right-color:transparent;
    animation:aw-status-spin 0.8s linear infinite;
  }
}
@keyframes aw-status-spin{
  from{transform:rotate(0deg)}
  to{transform:rotate(360deg)}
}
